public class CartOfferValidationActivity extends Object implements CheckoutWorkflowActivity
CheckoutWorkflowActivity
is responsible for validating that the cart's offers, offer
codes, and campaign codes are still valid.Constructor and Description |
---|
CartOfferValidationActivity(ExternalOfferProvider offerProvider,
CampaignProvider campaignProvider,
org.springframework.context.MessageSource messageSource,
CartOperationService cartService) |
Modifier and Type | Method and Description |
---|---|
com.broadleafcommerce.cart.client.domain.Cart |
execute(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String requestId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method responsible for executing some work against the cart that is required for checkout.
|
protected CampaignProvider |
getCampaignProvider() |
protected CartOperationService |
getCartService() |
protected org.springframework.context.MessageSource |
getMessageSource() |
protected ExternalOfferProvider |
getOfferProvider() |
com.broadleafcommerce.cart.client.domain.Cart |
rollback(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String requestId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Method responsible for rolling back any work that was done during the execution of the
#execute(Cart, String) method. |
protected void |
validateCampaignCodeUsages(com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validate that the campaign codes used in the specified cart are still valid upon checkout.
|
protected void |
validateOfferAndOfferCodeUsages(com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validate that the offers and offer codes used in the specified cart are still valid upon
checkout.
|
public CartOfferValidationActivity(ExternalOfferProvider offerProvider, CampaignProvider campaignProvider, org.springframework.context.MessageSource messageSource, CartOperationService cartService)
public com.broadleafcommerce.cart.client.domain.Cart execute(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CheckoutWorkflowActivity
execute
in interface CheckoutWorkflowActivity
cart
- The Cart
that we're attempting to checkout with.requestId
- The id used to identify changes tied to the specific execution requestcontextInfo
- Context information around sandbox and multitenant state.public com.broadleafcommerce.cart.client.domain.Cart rollback(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String requestId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CheckoutWorkflowActivity
#execute(Cart, String)
method.rollback
in interface CheckoutWorkflowActivity
cart
- The Cart
that we were attempting to checkout with, but ran into an
exception/error.requestId
- The id used to identify changes tied to the specific execution requestcontextInfo
- Context information around sandbox and multitenant state.protected void validateOfferAndOfferCodeUsages(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
cart
- the Cart
that we're attempting to checkout with.contextInfo
- context surrounding sandboxing and multitenant stateprotected void validateCampaignCodeUsages(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
cart
- the Cart
that we're attempting to checkout with.contextInfo
- context surrounding sandboxing and multitenant stateprotected ExternalOfferProvider getOfferProvider()
protected CampaignProvider getCampaignProvider()
protected org.springframework.context.MessageSource getMessageSource()
protected CartOperationService getCartService()
Copyright © 2021. All rights reserved.