Interface TaxAddressSourceHandler
- All Superinterfaces:
org.springframework.core.Ordered
- All Known Implementing Classes:
PaymentTaxAddressSourceHandler
,ShippingTaxAddressSourceHandler
public interface TaxAddressSourceHandler
extends org.springframework.core.Ordered
Determines how to populate the tax address based on the value of
FulfillmentGroup.getTaxAddressSource()
.- Author:
- Marie Standeven (marieStandeven)
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.tax.domain.TaxAddress
buildTaxAddressFromSource
(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Populates the tax address from the source specified by the value ofFulfillmentGroup.getTaxAddressSource()
.default boolean
canHandle
(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) Return true if this TaxAddressSourceHandler can handle the passed in request, i.e.default boolean
canHandle
(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Return true if this TaxAddressSourceHandler can handle the passed in request, i.e.default com.broadleafcommerce.tax.domain.TaxAddress
populateTaxAddressFromAddress
(@NonNull com.broadleafcommerce.tax.domain.TaxAddress taxAddress, @NonNull com.broadleafcommerce.order.common.domain.Address address) Populates the givenTaxAddress
with the givenAddress
.Methods inherited from interface org.springframework.core.Ordered
getOrder
-
Method Details
-
canHandle
default boolean canHandle(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup) Return true if this TaxAddressSourceHandler can handle the passed in request, i.e. this TaxAddressSourceHandler can populate the tax address.- Parameters:
cart
- The cart with items to be taxedfulfillmentGroup
- The fulfillment group to be taxed.- Returns:
true
if this TaxAddressSourceHandler can handle the passed in request
-
canHandle
default boolean canHandle(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Return true if this TaxAddressSourceHandler can handle the passed in request, i.e. this TaxAddressSourceHandler can populate the tax address.- Parameters:
cart
- The cart with items to be taxedfulfillmentGroup
- The fulfillment group to be taxed.contextInfo
- Context information around sandbox and multitenant state.- Returns:
true
if this TaxAddressSourceHandler can handle the passed in request
-
buildTaxAddressFromSource
com.broadleafcommerce.tax.domain.TaxAddress buildTaxAddressFromSource(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Populates the tax address from the source specified by the value ofFulfillmentGroup.getTaxAddressSource()
. For example, if the source isDefaultAddressSource.PAYMENT_ADDRESS
, then the tax address will be populated by the billing address from the cart payment.- Parameters:
cart
- The cart with items to be taxedfulfillmentGroup
- The fulfillment group to be taxed.contextInfo
- Context information around sandbox and multitenant state.- Returns:
- The populated tax address
-
populateTaxAddressFromAddress
default com.broadleafcommerce.tax.domain.TaxAddress populateTaxAddressFromAddress(@NonNull @NonNull com.broadleafcommerce.tax.domain.TaxAddress taxAddress, @NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address) Populates the givenTaxAddress
with the givenAddress
.- Parameters:
taxAddress
- theTaxAddress
to populateaddress
- theAddress
to populate theTaxAddress
with- Returns:
- the populated
TaxAddress
-