All Known Implementing Classes:
DefaultDelegatingTaxService, DefaultTaxService

public interface TaxService
Service for calculating and applying taxes to a Cart, typically by integrating with one or more TaxProviders, depending if there should be estimated and actual taxes calculated.
Author:
Chad Harchar (charchar)
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    applyTaxes(com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, boolean actual, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Deprecated.
    There is no reason to have estimated and actual.
    void
    applyTaxes(com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimate, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Calculates and applies taxes to a cart.
    boolean
    canCalculateTaxes(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Whether the cart contains the information required to calculate taxes.
  • Method Details

    • applyTaxes

      @Deprecated default void applyTaxes(com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, boolean actual, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated.
      There is no reason to have estimated and actual.
      Calculates and applies taxes to a cart.
      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:
    • applyTaxes

      void applyTaxes(com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimate, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Calculates and applies taxes to a cart.
      Parameters:
      cart - The cart to apply taxes against.
      estimate - Hint indicating whether to try to provide only an estimate, possibly for better performance
      contextInfo - (Optional) Additional sandbox, tenant, and application info
    • canCalculateTaxes

      boolean canCalculateTaxes(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Whether the cart contains the information required to calculate taxes.
      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.