org.broadleafcommerce.core.pricing.service
Class TaxServiceImpl

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

@Service(value="blTaxService")
public class TaxServiceImpl
extends Object
implements TaxService


Field Summary
protected  ModuleConfigurationService moduleConfigService
           
protected  boolean mustCalculate
           
protected  List<TaxProvider> providers
           
 
Constructor Summary
TaxServiceImpl()
           
 
Method Summary
 Order calculateTaxForOrder(Order order)
          Calculates tax for the order.
 void cancelTax(Order order)
          Some tax providers store tax details from an order on an external system for reporting and tax reconcilliation.
 Order commitTaxForOrder(Order order)
          Commits tax for the order.
 void setMustCalculate(boolean mustCalculate)
          Sets whether or not this service is required to delegate to a tax provider.
 void setTaxProviders(List<TaxProvider> providers)
          Sets a list of TaxProvider implementations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mustCalculate

protected boolean mustCalculate

providers

protected List<TaxProvider> providers

moduleConfigService

protected ModuleConfigurationService moduleConfigService
Constructor Detail

TaxServiceImpl

public TaxServiceImpl()
Method Detail

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 -


Copyright © 2013. All Rights Reserved.