Class PaymentTaxAddressSourceHandler
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.service.fulfillment.address.PaymentTaxAddressSourceHandler
-
- All Implemented Interfaces:
TaxAddressSourceHandler
,org.springframework.core.Ordered
public class PaymentTaxAddressSourceHandler extends Object implements TaxAddressSourceHandler
Populates the tax address from the billing address.- Author:
- Marie Standeven (marieStandeven)
-
-
Constructor Summary
Constructors Constructor Description PaymentTaxAddressSourceHandler(PaymentProvider<PaymentSummary> paymentProvider, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.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()
.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.protected com.broadleafcommerce.order.common.domain.Address
getBillingAddress(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
int
getOrder()
protected PaymentProvider<PaymentSummary>
getPaymentProvider()
protected com.broadleafcommerce.common.extension.TypeFactory
getTypeFactory()
void
setOrder(int order)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.broadleafcommerce.cartoperation.service.fulfillment.address.TaxAddressSourceHandler
canHandle
-
-
-
-
Constructor Detail
-
PaymentTaxAddressSourceHandler
public PaymentTaxAddressSourceHandler(PaymentProvider<PaymentSummary> paymentProvider, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Detail
-
canHandle
public 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)
Description copied from interface:TaxAddressSourceHandler
Return true if this TaxAddressSourceHandler can handle the passed in request, i.e. this TaxAddressSourceHandler can populate the tax address.- Specified by:
canHandle
in interfaceTaxAddressSourceHandler
- 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
public 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)
Description copied from interface:TaxAddressSourceHandler
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.- Specified by:
buildTaxAddressFromSource
in interfaceTaxAddressSourceHandler
- 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
-
getBillingAddress
@Nullable protected com.broadleafcommerce.order.common.domain.Address getBillingAddress(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
getPaymentProvider
protected PaymentProvider<PaymentSummary> getPaymentProvider()
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
getOrder
public int getOrder()
- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
-
-