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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
    The reference number used for COD Fee Items' tax request.
    static final String
    Deprecated.
    Default name for the TaxDetail for taxes associated with fulfillment, shipping, and handling.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultTaxService(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 Type
    Method
    Description
    protected 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 the FulfillmentGroup.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.
    Add FulfillmentItemTaxDetails 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)
    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 sets FulfillmentItem.getMerchandiseTotalTax() and FulfillmentGroup.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 given TaxProvider.
    protected void
    applyTaxResponse(TRES taxResponse, F fulfillmentGroup, @NonNull javax.money.CurrencyUnit expectedCurrency)
    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.
    protected List<TI>
    buildTaxItemsForFulfillment(F fulfillmentGroup)
    Deprecated.
     
    protected List<TI>
    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.
     
    protected List<TRES>
    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 on CartPricing.
    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.
    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 given FulfillmentGroup has sufficient address to calculate taxes.
    protected com.broadleafcommerce.tax.TaxProvider<TREQ,TRES>
    Deprecated.
     
    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.
     
    Deprecated.
     
    protected com.broadleafcommerce.tax.TaxProvider<TREQ,TRES>
    Deprecated.
     
    protected Optional<F>
    getFulfillmentGroupForCOD(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
    Deprecated.
     
    protected List<F>
    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 the CartItem.
    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 in calculateFeeItemsTaxes(Cart, TaxProvider, ContextInfo) and process all the tax responses together.
    protected String
    getTaxId(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Deprecated.
     
    protected String
    getTaxItemIdForFulfillment(F fulfillmentGroup)
    Deprecated.
    Extension point to modify the TaxItem.getItemId() for fulfillment tax items.
    protected String
    getTaxItemIdForLineItem(F fulfillmentGroup, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem)
    Deprecated.
     
    protected com.broadleafcommerce.tax.TaxProvider<TREQ,TRES>
    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 cart
    protected 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.
     
    protected Map<String,TRES>
    getTaxResponseMap(@NonNull List<TRES> taxResponses)
    Deprecated.
    Returns a map of tax responses, with the key as the TaxResponse.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
    Deprecated.
     
    protected boolean
    shouldCalculateItemTaxes(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
    Deprecated.
     
    protected boolean
    shouldTaxFulfillment(F fulfillmentGroup, @NonNull javax.money.CurrencyUnit currencyUnit)
    Deprecated.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • COD_REFERENCE_NUMBER

      public static final String COD_REFERENCE_NUMBER
      Deprecated.
      The reference number used for COD Fee Items' tax request.
      See Also:
    • DEFAULT_FULFILLMENT_TAX_NAME

      public static final String DEFAULT_FULFILLMENT_TAX_NAME
      Deprecated.
      Default name for the TaxDetail 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

      @Autowired public void setCustomerProvider(CustomerProvider customerProvider)
      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 interface TaxService
      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 given FulfillmentGroup has sufficient address to calculate taxes.

      By default, for an address to be sufficient, it must have TaxAddress.getCountry() and TaxAddress.getStateProvinceRegion() at the very least.

      For different address requirements, customization should be added here

      Parameters:
      fg - the FulfillmentGroup to check the address for
      cart - the Cart that the FulfillmentGroup belongs to
      contextInfo - 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 interface TaxService
      Parameters:
      cart - The cart to apply taxes against.
      estimated - Hint indicating whether to try to provide only an estimate, possibly for better performance
      contextInfo - (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 interface TaxService
      Parameters:
      cart - The cart to apply taxes against.
      estimated - Whether to provide an estimate
      actual - Whether to provide the actual
      contextInfo - (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 given TaxProvider.
      Parameters:
      cart - Cart to be taxed
      taxProvider - The TaxProvider 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 in calculateFeeItemsTaxes(Cart, TaxProvider, ContextInfo) and process all the tax 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 sets FulfillmentItem.getMerchandiseTotalTax() and FulfillmentGroup.getTotalTax().
      Parameters:
      cart - The cart with items to be taxed
      fulfillmentGroups - The group to be taxed with items to be taxed
      taxProvider - The TaxProvider 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 taxed
      taxProvider - The TaxProvider that calculates the tax
      contextInfo - 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 on CartPricing. Determine how much of the total tax amount is included in the subtotal.
      Parameters:
      cart - Cart to be taxed
      expectedCurrency - The currency to use
      taxResponse - The TaxResponse 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 the CartItem.
      Parameters:
      cartItem - the CartItem
      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 the FulfillmentGroup.getFulfillmentTaxableAmount(). That should have generated a TaxInfo. We create FulfillmentItemTaxDetails for each item, prorated based on merchandise value of each item, with the remainder arbitrarily going to the last item. The assumption is that TaxInfo.getTaxCalculated() is exactly equal to the sum of all TaxDetail.getTaxCalculated(). This also assumes that TaxInfo.getTaxableAmount() is exactly equal to the sum of all TaxDetail.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.
      Add FulfillmentItemTaxDetails to the fulfillment item.
      Parameters:
      taxResponse - The tax response
      taxInfo - The tax info
      fulfillmentItem - The fulfillment item
    • getTaxResponseMap

      protected Map<String,TRES> getTaxResponseMap(@NonNull @NonNull List<TRES> taxResponses)
      Deprecated.
      Returns a map of tax responses, with the key as the TaxResponse.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)
      Calculates and sets FulfillmentItem.getMerchandiseTotalTax() and FulfillmentGroup.getTotalTax().
      Parameters:
      cart - The cart with items to be taxed
      fulfillmentGroup - The group to be taxed with items to be taxed
      taxProvider - The TaxProvider 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)
      Parameters:
      fulfillmentGroup -
      fulfillmentItem -
      Returns:
    • buildTaxItemsForFulfillment

      protected List<TI> buildTaxItemsForFulfillment(@NonNull F fulfillmentGroup)
      Deprecated.
    • getTaxItemIdForFulfillment

      protected String getTaxItemIdForFulfillment(@NonNull F fulfillmentGroup)
      Deprecated.
      Extension point to modify the TaxItem.getItemId() for fulfillment tax items. For some TaxProviders, there may be a affix like FR (for freight) to add to the FulfillmentGroup.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)
      Takes the TaxResponse and applies the results to the FulfillmentGroup and its items.
      Parameters:
      taxResponse - Tax response to apply
      fulfillmentGroup - 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 protected List<TI> buildTaxItemsForLineItems(@NonNull F fulfillmentGroup)
      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

      protected <T> T getInstance(Class<?> clazz)
      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 - The TaxProvider 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

      @Nullable protected com.broadleafcommerce.tax.TaxProvider<TREQ,TRES> getEstimatedTaxProvider()
      Deprecated.
    • getActualTaxProvider

      protected com.broadleafcommerce.tax.TaxProvider<TREQ,TRES> getActualTaxProvider()
      Deprecated.
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
      Deprecated.
    • getTaxAddressSourceHandlers

      protected List<TaxAddressSourceHandler> getTaxAddressSourceHandlers()
      Deprecated.
    • getAuthenticationUtils

      protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()
      Deprecated.
    • getCustomerProvider

      protected CustomerProvider getCustomerProvider()
      Deprecated.