@dkatzel, .
, :
product.paymentPrice(countryId, currency, fixedPriceMatrix)
, , .
countryId = ...
currency = ...
fixedPriceMatrix = ...
basePrice = ...
countryPrice = ...
product = new Product(id, basePrice, countryPrice...)
paymentPrice = product.paymentPrice(countryId, currency, fixedPriceMatrix)
( ), .
Value PaymentPrice
paymentPrice = new PaymentPrice(basePriceForYourCountry, currency, fixedPriceMatrix)
value = paymentPrice.value()
countryPrice = new Product(id, basePrice).countryPrice(countryId);
PaymentPriceCalculator factory:
class PaymentPriceCalculator {
PaymentPrice paymentPrice(product, countryId, currency) {
fixedPriceMatrix = fixedPriceMatrixStore.get()
return new PaymentPrice(product.countryPrice(countryId), currency, fixedPriceMatrix())
}
}
:
( PaymentPrice )
. . countryId, .