Class TaxServiceImpl
java.lang.Object
org.broadleafcommerce.core.pricing.service.TaxServiceImpl
- All Implemented Interfaces:
TaxService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ModuleConfigurationServiceprotected booleanprotected List<TaxProvider> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateTaxForOrder(Order order) Calculates tax for the order.voidSome tax providers store tax details from an order on an external system for reporting and tax reconcilliation.commitTaxForOrder(Order order) Commits tax for the order.voidsetMustCalculate(boolean mustCalculate) Sets whether or not this service is required to delegate to a tax provider.voidsetTaxProviders(List<TaxProvider> providers) Sets a list ofTaxProviderimplementations.
-
Field Details
-
mustCalculate
protected boolean mustCalculate -
providers
-
moduleConfigService
-
-
Constructor Details
-
TaxServiceImpl
public TaxServiceImpl()
-
-
Method Details
-
calculateTaxForOrder
Description copied from interface:TaxServiceCalculates tax for the order.- Specified by:
calculateTaxForOrderin interfaceTaxService- Returns:
- Throws:
TaxException
-
commitTaxForOrder
Description copied from interface:TaxServiceCommits 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:
commitTaxForOrderin interfaceTaxService- Returns:
- Throws:
TaxException
-
cancelTax
Description copied from interface:TaxServiceSome 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:
cancelTaxin interfaceTaxService- Throws:
TaxException
-
setTaxProviders
Sets a list ofTaxProviderimplementations.- 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-
-