Interface BillingService
-
- All Known Implementing Classes:
BillingServiceImpl
public interface BillingService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.math.BigDecimal
calculateBruttoAmount(java.util.List<CommerceItem> items, Order.Tax tax)
Calculates gross amount in cents for order.java.math.BigDecimal
calculateDeliveryAmount(Order order)
Calculates delivery amount for order.java.math.BigDecimal
calculateItemsTotalAmount(java.util.Collection<CommerceItem> items)
Sums prices of commerce items.java.math.BigDecimal
calculateItemsTotalBruttoAmount(java.math.BigDecimal amount, java.math.BigDecimal taxAmount)
Calculates gross amount for order.java.math.BigDecimal
calculateNettoAmount(java.util.List<CommerceItem> items)
Calculates net amount in cents for order.java.math.BigDecimal
calculatePayoutAmount(Order order)
Calculates amount in cents for payout.java.math.BigDecimal
calculateServiceFee(java.math.BigDecimal amount)
Calculates service fee for given amount.java.math.BigDecimal
calculateServiceFeeBruttoAmount(Order order)
Calculates amount in cents for service fee.java.math.BigDecimal
calculateServiceFeeNettoAmount(Order order)
Calculates service fee for given amount.java.math.BigDecimal
calculateTaxAmount(java.math.BigDecimal amount, java.math.BigDecimal taxRate)
Calculates tax amount for order.java.math.BigDecimal
getServiceFee()
Service fee coefficient.
-
-
-
Method Detail
-
getServiceFee
java.math.BigDecimal getServiceFee()
Service fee coefficient.- Returns:
- coefficient
-
calculateServiceFee
java.math.BigDecimal calculateServiceFee(java.math.BigDecimal amount)
Calculates service fee for given amount.- Parameters:
amount
- amount- Returns:
- service fee
-
calculateServiceFeeNettoAmount
java.math.BigDecimal calculateServiceFeeNettoAmount(Order order)
Calculates service fee for given amount.- Parameters:
order
- order- Returns:
- net service fee amount
-
calculateServiceFeeBruttoAmount
java.math.BigDecimal calculateServiceFeeBruttoAmount(Order order)
Calculates amount in cents for service fee.- Parameters:
order
- order- Returns:
- gross service fee amount
-
calculatePayoutAmount
java.math.BigDecimal calculatePayoutAmount(Order order)
Calculates amount in cents for payout.- Parameters:
order
- order- Returns:
- payout amount in coins/cents
-
calculateItemsTotalAmount
java.math.BigDecimal calculateItemsTotalAmount(java.util.Collection<CommerceItem> items)
Sums prices of commerce items.- Parameters:
items
- items- Returns:
- items total amount
-
calculateItemsTotalBruttoAmount
java.math.BigDecimal calculateItemsTotalBruttoAmount(java.math.BigDecimal amount, java.math.BigDecimal taxAmount)
Calculates gross amount for order.- Parameters:
amount
- net amounttaxAmount
- tax amount- Returns:
- gross amount
-
calculateTaxAmount
java.math.BigDecimal calculateTaxAmount(java.math.BigDecimal amount, java.math.BigDecimal taxRate)
Calculates tax amount for order.- Parameters:
amount
- net amounttaxRate
- tax rate in decimals- Returns:
- tax amount
-
calculateDeliveryAmount
java.math.BigDecimal calculateDeliveryAmount(Order order)
Calculates delivery amount for order.- Parameters:
order
- order- Returns:
- delivery amount
-
calculateBruttoAmount
java.math.BigDecimal calculateBruttoAmount(java.util.List<CommerceItem> items, Order.Tax tax)
Calculates gross amount in cents for order.- Parameters:
items
- commerce itemstax
- tax object- Returns:
- gross amount in coins/cents
-
calculateNettoAmount
java.math.BigDecimal calculateNettoAmount(java.util.List<CommerceItem> items)
Calculates net amount in cents for order.- Parameters:
items
- commerce items- Returns:
- net amount in coins/cents
-
-