Class DefaultTaxService<F extends com.broadleafcommerce.cart.client.domain.FulfillmentGroup,TREQ extends com.broadleafcommerce.tax.domain.TaxRequest,TRES extends com.broadleafcommerce.tax.domain.TaxResponse,TI extends com.broadleafcommerce.tax.domain.TaxItem>
java.lang.Object
com.broadleafcommerce.cartoperation.service.pricing.DefaultTaxService<F,TREQ,TRES,TI>
- All Implemented Interfaces:
TaxService
@Deprecated
public class DefaultTaxService<F extends com.broadleafcommerce.cart.client.domain.FulfillmentGroup,TREQ extends com.broadleafcommerce.tax.domain.TaxRequest,TRES extends com.broadleafcommerce.tax.domain.TaxResponse,TI extends com.broadleafcommerce.tax.domain.TaxItem>
extends Object
implements TaxService
Deprecated.
The default
TaxService
which integrates with TaxProviders
. This
service connects to an actualTaxProvider
for accurate actual tax amounts and an optional
estimatedTaxProvider
for quick estimated tax amounts. Callers of this class can choose to
get taxes for either or both actual and estimated. A typical scenario would be to use a quick
synchronous call for estimated taxes when performing cart operations and then get the actual
taxes through a 3rd party provider once the cart is finalized in checkout and ready for the
customer to review final pricing.- Author:
- Chad Harchar (charchar)
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultTaxService
(com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> estimatedTaxProvider, com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> actualTaxProvider, com.broadleafcommerce.common.extension.TypeFactory typeFactory) Deprecated.DefaultTaxService
(com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> estimatedTaxProvider, com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> actualTaxProvider, com.broadleafcommerce.common.extension.TypeFactory typeFactory, List<TaxAddressSourceHandler> handlers) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFulfillmentItemTaxDetails
(@NonNull com.broadleafcommerce.tax.domain.TaxResponse taxResponse, @NonNull com.broadleafcommerce.tax.domain.TaxInfo taxInfo, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) Deprecated.This takes the total from theFulfillmentGroup.getFulfillmentTaxableAmount()
.protected void
addFulfillmentItemTaxDetails
(@NonNull com.broadleafcommerce.tax.domain.TaxResponse taxResponse, @NonNull com.broadleafcommerce.tax.domain.TaxInfo taxInfo, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem) Deprecated.AddFulfillmentItemTaxDetails
to the fulfillment item.void
applyTaxes
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, boolean actual, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Calculates and applies taxes to a cart.void
applyTaxes
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Calculates and applies taxes to a cart.protected void
applyTaxesForGroup
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, F fulfillmentGroup, @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.protected void
applyTaxesForGroups
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull List<F> fulfillmentGroups, @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Calculates and setsFulfillmentItem.getMerchandiseTotalTax()
andFulfillmentGroup.getTotalTax()
.protected void
applyTaxesInternal
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Performs the bulk of the tax calculations and application for a givenTaxProvider
.protected void
applyTaxResponse
(TRES taxResponse, F fulfillmentGroup, @NonNull javax.money.CurrencyUnit expectedCurrency) Deprecated.In favor ofapplyTaxResponses(List, List, CurrencyUnit)
protected void
applyTaxResponses
(@NonNull List<TRES> taxResponses, @NonNull List<F> fulfillmentGroups, @NonNull javax.money.CurrencyUnit expectedCurrency) Deprecated.protected TI
buildTaxItemForFeeItem
(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Deprecated.protected TI
buildTaxItemForLineItem
(F fulfillmentGroup, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem) Deprecated.Since 1.2.buildTaxItemsForFulfillment
(F fulfillmentGroup) Deprecated.buildTaxItemsForLineItems
(F fulfillmentGroup) Deprecated.Since 1.2.protected Collection<? extends TI>
buildTaxItemsForLineItems
(F fulfillmentGroup, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated.protected void
calculateActualTaxesForCart
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.protected void
calculateEstimatedTaxesForCart
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.calculateFeeItemsTaxes
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Calculates the taxes for the fee items.protected void
calculateIncludedTaxes
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull javax.money.CurrencyUnit expectedCurrency, @NonNull List<TRES> taxResponse) Deprecated.Set VAT properties onCartPricing
.boolean
canCalculateTaxes
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Whether the cart contains the information required to calculate taxes.protected TaxAddressSourceHandler
findTaxAddressSourceHandler
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, F fulfillmentGroup, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.protected boolean
fulfillmentGroupHasSufficientAddress
(F fg, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Determines if the givenFulfillmentGroup
has sufficient address to calculate taxes.Deprecated.protected Optional<TaxAddressSourceHandler>
getAddressSourceForFeeTaxCalculation
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, F fulfillmentGroup, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils
Deprecated.protected CustomerProvider
Deprecated.Deprecated.getFulfillmentGroupForCOD
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated.getFulfillmentGroups
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated.protected <T> T
getInstance
(Class<?> clazz) Deprecated.protected String
getProductDescription
(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Deprecated.Retrieves the description of the product represented by theCartItem
.protected List<TaxAddressSourceHandler>
Deprecated.protected javax.money.MonetaryAmount
getTaxesForFeeItems
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.Instead of calculating the total taxes for fee items separately, calculate incalculateFeeItemsTaxes(Cart, TaxProvider, ContextInfo)
and process all thetax responses
together.protected String
getTaxId
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.protected String
getTaxItemIdForFulfillment
(F fulfillmentGroup) Deprecated.Extension point to modify theTaxItem.getItemId()
for fulfillment tax items.protected String
getTaxItemIdForLineItem
(F fulfillmentGroup, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem) Deprecated.getTaxProvider
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Determine which tax provider to use for calculating taxes for the cartprotected TREQ
getTaxRequest
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, F fulfillmentGroup, @NonNull TaxAddressSourceHandler handler, @NonNull List<TI> taxItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.getTaxResponseMap
(@NonNull List<TRES> taxResponses) Deprecated.Returns a map of tax responses, with the key as theTaxResponse.getFulfillmentGroupReferenceNumber()
protected com.broadleafcommerce.common.extension.TypeFactory
Deprecated.protected boolean
isCODSelected
(@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) Deprecated.protected boolean
isEstimatedProvider
(@NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Determine if the given provider calculates estimated taxes or actual taxes.protected void
setAllTaxToZero
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated.void
setAuthenticationUtils
(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) Deprecated.void
setCustomerProvider
(CustomerProvider customerProvider) Deprecated.protected boolean
shouldCalculateItemTaxes
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated.protected boolean
shouldTaxFulfillment
(F fulfillmentGroup, @NonNull javax.money.CurrencyUnit currencyUnit) Deprecated.
-
Field Details
-
COD_REFERENCE_NUMBER
Deprecated.The reference number used for COD Fee Items'tax request
.- See Also:
-
DEFAULT_FULFILLMENT_TAX_NAME
Deprecated.Default name for theTaxDetail
for taxes associated with fulfillment, shipping, and handling.- See Also:
-
-
Constructor Details
-
DefaultTaxService
public DefaultTaxService(@Nullable com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> estimatedTaxProvider, com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> actualTaxProvider, com.broadleafcommerce.common.extension.TypeFactory typeFactory, List<TaxAddressSourceHandler> handlers) Deprecated. -
DefaultTaxService
public DefaultTaxService(com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> estimatedTaxProvider, com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> actualTaxProvider, com.broadleafcommerce.common.extension.TypeFactory typeFactory) Deprecated.
-
-
Method Details
-
setAuthenticationUtils
@Autowired public void setAuthenticationUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) Deprecated. -
setCustomerProvider
Deprecated. -
canCalculateTaxes
public boolean canCalculateTaxes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Description copied from interface:TaxService
Whether the cart contains the information required to calculate taxes.- Specified by:
canCalculateTaxes
in interfaceTaxService
- Parameters:
cart
- The cart to determine whether taxes can be calculated for.contextInfo
- Additional sandbox and tenant info- Returns:
- Whether the cart contains the information required to calculate taxes.
-
fulfillmentGroupHasSufficientAddress
protected boolean fulfillmentGroupHasSufficientAddress(@NonNull F fg, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Determines if the givenFulfillmentGroup
has sufficient address to calculate taxes.By default, for an address to be sufficient, it must have
TaxAddress.getCountry()
andTaxAddress.getStateProvinceRegion()
at the very least.For different address requirements, customization should be added here
- Parameters:
fg
- theFulfillmentGroup
to check the address forcart
- theCart
that theFulfillmentGroup
belongs tocontextInfo
- the contextInfo for this request- Returns:
- true if the given
FulfillmentGroup
has sufficient address to calculate taxes, otherwise false
-
applyTaxes
public void applyTaxes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Description copied from interface:TaxService
Calculates and applies taxes to a cart.- Specified by:
applyTaxes
in interfaceTaxService
- Parameters:
cart
- The cart to apply taxes against.estimated
- Hint indicating whether to try to provide only an estimate, possibly for better performancecontextInfo
- (Optional) Additional sandbox, tenant, and application info
-
applyTaxes
public void applyTaxes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, boolean actual, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Description copied from interface:TaxService
Calculates and applies taxes to a cart.- Specified by:
applyTaxes
in interfaceTaxService
- Parameters:
cart
- The cart to apply taxes against.estimated
- Whether to provide an estimateactual
- Whether to provide the actualcontextInfo
- (Optional) Additional sandbox, tenant, and application info- See Also:
-
calculateActualTaxesForCart
protected void calculateActualTaxesForCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated. -
calculateEstimatedTaxesForCart
protected void calculateEstimatedTaxesForCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated. -
applyTaxesInternal
protected void applyTaxesInternal(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Performs the bulk of the tax calculations and application for a givenTaxProvider
.- Parameters:
cart
- Cart to be taxedtaxProvider
- TheTaxProvider
to facilitate tax calculations
-
getTaxesForFeeItems
@Deprecated(forRemoval=true) protected javax.money.MonetaryAmount getTaxesForFeeItems(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.Instead of calculating the total taxes for fee items separately, calculate incalculateFeeItemsTaxes(Cart, TaxProvider, ContextInfo)
and process all thetax responses
together. -
buildTaxItemForFeeItem
protected TI buildTaxItemForFeeItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Deprecated. -
getFulfillmentGroupForCOD
protected Optional<F> getFulfillmentGroupForCOD(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated. -
isCODSelected
protected boolean isCODSelected(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) Deprecated. -
getAddressSourceForFeeTaxCalculation
protected Optional<TaxAddressSourceHandler> getAddressSourceForFeeTaxCalculation(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull F fulfillmentGroup, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated. -
applyTaxesForGroups
protected void applyTaxesForGroups(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull List<F> fulfillmentGroups, @NonNull @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Calculates and setsFulfillmentItem.getMerchandiseTotalTax()
andFulfillmentGroup.getTotalTax()
.- Parameters:
cart
- The cart with items to be taxedfulfillmentGroups
- The group to be taxed with items to be taxedtaxProvider
- TheTaxProvider
that calculates the tax
-
calculateFeeItemsTaxes
protected List<TRES> calculateFeeItemsTaxes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Calculates the taxes for the fee items.- Parameters:
cart
- The cart with items to be taxedtaxProvider
- TheTaxProvider
that calculates the taxcontextInfo
- Context information around sandbox and multitenant state- Returns:
- the
tax responses
for the fee items
-
getTaxId
@Nullable protected String getTaxId(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated. -
calculateIncludedTaxes
protected void calculateIncludedTaxes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull javax.money.CurrencyUnit expectedCurrency, @NonNull @NonNull List<TRES> taxResponse) Deprecated.Set VAT properties onCartPricing
. Determine how much of the total tax amount is included in the subtotal.- Parameters:
cart
- Cart to be taxedexpectedCurrency
- The currency to usetaxResponse
- TheTaxResponse
response containing calculated taxes.
-
buildTaxItemsForLineItems
protected Collection<? extends TI> buildTaxItemsForLineItems(@NonNull F fulfillmentGroup, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated. -
getProductDescription
protected String getProductDescription(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Deprecated.Retrieves the description of the product represented by theCartItem
.- Parameters:
cartItem
- theCartItem
- Returns:
- The description of the product that was added to the cart.
-
getTaxRequest
protected TREQ getTaxRequest(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull F fulfillmentGroup, @NonNull @NonNull TaxAddressSourceHandler handler, @NonNull @NonNull List<TI> taxItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated. -
applyTaxResponses
protected void applyTaxResponses(@NonNull @NonNull List<TRES> taxResponses, @NonNull @NonNull List<F> fulfillmentGroups, @NonNull @NonNull javax.money.CurrencyUnit expectedCurrency) Deprecated. -
addFulfillmentItemTaxDetails
protected void addFulfillmentItemTaxDetails(@NonNull @NonNull com.broadleafcommerce.tax.domain.TaxResponse taxResponse, @NonNull @NonNull com.broadleafcommerce.tax.domain.TaxInfo taxInfo, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) Deprecated.This takes the total from theFulfillmentGroup.getFulfillmentTaxableAmount()
. That should have generated aTaxInfo
. We createFulfillmentItemTaxDetails
for each item, prorated based on merchandise value of each item, with the remainder arbitrarily going to the last item. The assumption is thatTaxInfo.getTaxCalculated()
is exactly equal to the sum of allTaxDetail.getTaxCalculated()
. This also assumes thatTaxInfo.getTaxableAmount()
is exactly equal to the sum of allTaxDetail.getTaxableAmount()
. By default, no rounding is performed in this method.- Parameters:
taxResponse
-taxInfo
-fulfillmentGroup
-
-
addFulfillmentItemTaxDetails
protected void addFulfillmentItemTaxDetails(@NonNull @NonNull com.broadleafcommerce.tax.domain.TaxResponse taxResponse, @NonNull @NonNull com.broadleafcommerce.tax.domain.TaxInfo taxInfo, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem) Deprecated.AddFulfillmentItemTaxDetails
to the fulfillment item.- Parameters:
taxResponse
- The tax responsetaxInfo
- The tax infofulfillmentItem
- The fulfillment item
-
getTaxResponseMap
Deprecated.Returns a map of tax responses, with the key as theTaxResponse.getFulfillmentGroupReferenceNumber()
- Parameters:
taxResponses
- A list of tax responses- Returns:
- A map of tax responses.
-
applyTaxesForGroup
@Deprecated protected void applyTaxesForGroup(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull F fulfillmentGroup, @NonNull @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Calculates and setsFulfillmentItem.getMerchandiseTotalTax()
andFulfillmentGroup.getTotalTax()
.- Parameters:
cart
- The cart with items to be taxedfulfillmentGroup
- The group to be taxed with items to be taxedtaxProvider
- TheTaxProvider
that facilitates calculating the tax
-
getTaxItemIdForLineItem
protected String getTaxItemIdForLineItem(@NonNull F fulfillmentGroup, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem) Deprecated. -
buildTaxItemForLineItem
@Deprecated protected TI buildTaxItemForLineItem(@NonNull F fulfillmentGroup, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem) Deprecated.Since 1.2. UsebuildTaxItemsForLineItems(FulfillmentGroup, Cart)
- Parameters:
fulfillmentGroup
-fulfillmentItem
-- Returns:
-
buildTaxItemsForFulfillment
Deprecated. -
getTaxItemIdForFulfillment
Deprecated.Extension point to modify theTaxItem.getItemId()
for fulfillment tax items. For someTaxProviders
, there may be a affix likeFR
(for freight) to add to theFulfillmentGroup.getReferenceNumber()
.- Parameters:
fulfillmentGroup
- Fulfillment group from which to derive an id- Returns:
TaxItem.getItemId()
for fulfillment tax items
-
applyTaxResponse
@Deprecated protected void applyTaxResponse(@NonNull TRES taxResponse, @NonNull F fulfillmentGroup, @NonNull @NonNull javax.money.CurrencyUnit expectedCurrency) Deprecated.In favor ofapplyTaxResponses(List, List, CurrencyUnit)
Takes theTaxResponse
and applies the results to theFulfillmentGroup
and its items.- Parameters:
taxResponse
- Tax response to applyfulfillmentGroup
- Group to which to apply the response
-
setAllTaxToZero
protected void setAllTaxToZero(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated. -
shouldCalculateItemTaxes
protected boolean shouldCalculateItemTaxes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated. -
buildTaxItemsForLineItems
Deprecated.Since 1.2. UsebuildTaxItemsForLineItems(FulfillmentGroup, Cart)
- Parameters:
fulfillmentGroup
-- Returns:
-
shouldTaxFulfillment
protected boolean shouldTaxFulfillment(@NonNull F fulfillmentGroup, @NonNull @NonNull javax.money.CurrencyUnit currencyUnit) Deprecated. -
findTaxAddressSourceHandler
@Nullable protected TaxAddressSourceHandler findTaxAddressSourceHandler(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull F fulfillmentGroup, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated. -
getInstance
Deprecated. -
getFulfillmentGroups
protected List<F> getFulfillmentGroups(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Deprecated. -
getTaxProvider
@Nullable protected com.broadleafcommerce.tax.TaxProvider<TREQ,TRES> getTaxProvider(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Determine which tax provider to use for calculating taxes for the cart- Parameters:
cart
- The cart to be taxed.estimated
- Whether the calculated tax is an estimate.contextInfo
- Context information around sandbox and multitenant state.- Returns:
- A
TaxProvider
that can be used to calculate taxes for the cart.
-
isEstimatedProvider
protected boolean isEstimatedProvider(@NonNull @NonNull com.broadleafcommerce.tax.TaxProvider<TREQ, TRES> taxProvider, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Determine if the given provider calculates estimated taxes or actual taxes.- Parameters:
taxProvider
- TheTaxProvider
used to calculate taxes for the cart.cart
- The cart to be taxed.contextInfo
- Context information around sandbox and multitenant state.- Returns:
- True if the given
TaxProvider
calculates estimated taxes.
-
getEstimatedTaxProvider
Deprecated. -
getActualTaxProvider
Deprecated. -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()Deprecated. -
getTaxAddressSourceHandlers
Deprecated. -
getAuthenticationUtils
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()Deprecated. -
getCustomerProvider
Deprecated.
-
applyTaxesForGroups(Cart, List, TaxProvider, ContextInfo)