public class CartItemValidationActivity extends Object implements CheckoutWorkflowActivity
CheckoutWorkflowActivity
is responsible for validating that the cart's
CartItems
include all necessary selections and data so that we can clearly
understand what is being purchased and must later be fulfilled.Constructor and Description |
---|
CartItemValidationActivity(CatalogProvider catalogProvider,
CartItemConfigurationService cartItemConfigurationService,
org.springframework.context.MessageSource messageSource) |
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 Map<String,String> |
gatherCartItemConfigErrors(com.broadleafcommerce.cart.client.domain.CartItem cartItem)
Gathers all of the config error messages for the
CartItem into a map. |
protected CartItemConfigurationService |
getCartItemConfigurationService() |
protected CatalogProvider |
getCatalogProvider() |
protected org.springframework.context.MessageSource |
getMessageSource() |
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 |
validateCartItems(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates that each of the cart's
CartItems include all necessary selections
and data |
public CartItemValidationActivity(CatalogProvider catalogProvider, CartItemConfigurationService cartItemConfigurationService, org.springframework.context.MessageSource messageSource)
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 validateCartItems(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartItems
include all necessary selections
and datacart
- contextInfo
- Context information around sandbox and multitenant state.protected Map<String,String> gatherCartItemConfigErrors(com.broadleafcommerce.cart.client.domain.CartItem cartItem)
CartItem
into a map.cartItem
- protected CatalogProvider getCatalogProvider()
protected CartItemConfigurationService getCartItemConfigurationService()
protected org.springframework.context.MessageSource getMessageSource()
Copyright © 2021. All rights reserved.