Class TaxServiceImpl

java.lang.Object
org.broadleafcommerce.core.pricing.service.TaxServiceImpl
All Implemented Interfaces:
TaxService

@Service("blTaxService") public class TaxServiceImpl extends Object implements TaxService
  • Field Details

  • Constructor Details

    • TaxServiceImpl

      public TaxServiceImpl()
  • Method Details

    • calculateTaxForOrder

      public Order calculateTaxForOrder(Order order) throws TaxException
      Description copied from interface: TaxService
      Calculates tax for the order.
      Specified by:
      calculateTaxForOrder in interface TaxService
      Returns:
      Throws:
      TaxException
    • commitTaxForOrder

      public Order commitTaxForOrder(Order order) throws TaxException
      Description copied from interface: TaxService
      Commits tax for the order. Some implemenations may do nothing. Others may delegate to a tax provider that stores taxes in another system for reporting or reconcilliation.
      Specified by:
      commitTaxForOrder in interface TaxService
      Returns:
      Throws:
      TaxException
    • cancelTax

      public void cancelTax(Order order) throws TaxException
      Description copied from interface: TaxService
      Some tax providers store tax details from an order on an external system for reporting and tax reconcilliation. This allows one to cancel or undo tax recording in an external system. Typically, this will be called to offset a call to commitTaxForOrder. This might be called, for example, in a rollback handler for a checkout workflow activity that calls commitTaxForOrder.
      Specified by:
      cancelTax in interface TaxService
      Throws:
      TaxException
    • setTaxProviders

      public void setTaxProviders(List<TaxProvider> providers)
      Sets a list of TaxProvider implementations.
      Parameters:
      providers -
    • setMustCalculate

      public void setMustCalculate(boolean mustCalculate)
      Sets whether or not this service is required to delegate to a tax provider. Setting this value to true will cause an exception if no tax providers are configured, or if none are eligible.
      Parameters:
      mustCalculate -