Class BillingServiceImpl

    • Constructor Detail

      • BillingServiceImpl

        public BillingServiceImpl()
    • Method Detail

      • getServiceFee

        public java.math.BigDecimal getServiceFee()
        Description copied from interface: BillingService
        Service fee coefficient.
        Specified by:
        getServiceFee in interface BillingService
        Returns:
        coefficient
      • calculateServiceFee

        public java.math.BigDecimal calculateServiceFee​(java.math.BigDecimal amount)
        Description copied from interface: BillingService
        Calculates service fee for given amount.
        Specified by:
        calculateServiceFee in interface BillingService
        Parameters:
        amount - amount
        Returns:
        service fee
      • calculateServiceFeeNettoAmount

        public java.math.BigDecimal calculateServiceFeeNettoAmount​(Order order)
        Description copied from interface: BillingService
        Calculates service fee for given amount.
        Specified by:
        calculateServiceFeeNettoAmount in interface BillingService
        Parameters:
        order - order
        Returns:
        net service fee amount
      • calculateServiceFeeBruttoAmount

        public java.math.BigDecimal calculateServiceFeeBruttoAmount​(Order order)
        Description copied from interface: BillingService
        Calculates amount in cents for service fee.
        Specified by:
        calculateServiceFeeBruttoAmount in interface BillingService
        Parameters:
        order - order
        Returns:
        gross service fee amount
      • calculatePayoutAmount

        public java.math.BigDecimal calculatePayoutAmount​(Order order)
        Description copied from interface: BillingService
        Calculates amount in cents for payout.
        Specified by:
        calculatePayoutAmount in interface BillingService
        Parameters:
        order - order
        Returns:
        payout amount in coins/cents
      • calculateItemsTotalAmount

        public java.math.BigDecimal calculateItemsTotalAmount​(java.util.Collection<CommerceItem> items)
        Description copied from interface: BillingService
        Sums prices of commerce items.
        Specified by:
        calculateItemsTotalAmount in interface BillingService
        Parameters:
        items - items
        Returns:
        items total amount
      • calculateItemsTotalBruttoAmount

        public java.math.BigDecimal calculateItemsTotalBruttoAmount​(java.math.BigDecimal amount,
                                                                    java.math.BigDecimal taxAmount)
        Description copied from interface: BillingService
        Calculates gross amount for order.
        Specified by:
        calculateItemsTotalBruttoAmount in interface BillingService
        Parameters:
        amount - net amount
        taxAmount - tax amount
        Returns:
        gross amount
      • calculateTaxAmount

        public java.math.BigDecimal calculateTaxAmount​(java.math.BigDecimal amount,
                                                       java.math.BigDecimal taxRate)
        Description copied from interface: BillingService
        Calculates tax amount for order.
        Specified by:
        calculateTaxAmount in interface BillingService
        Parameters:
        amount - net amount
        taxRate - tax rate in decimals
        Returns:
        tax amount
      • calculateBruttoAmount

        public java.math.BigDecimal calculateBruttoAmount​(java.util.List<CommerceItem> items,
                                                          Order.Tax tax)
        Description copied from interface: BillingService
        Calculates gross amount in cents for order.
        Specified by:
        calculateBruttoAmount in interface BillingService
        Parameters:
        items - commerce items
        tax - tax object
        Returns:
        gross amount in coins/cents
      • calculateNettoAmount

        public java.math.BigDecimal calculateNettoAmount​(java.util.List<CommerceItem> items)
        Description copied from interface: BillingService
        Calculates net amount in cents for order.
        Specified by:
        calculateNettoAmount in interface BillingService
        Parameters:
        items - commerce items
        Returns:
        net amount in coins/cents