Class CartStalePricingValidationActivity
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.service.checkout.workflow.activity.CartStalePricingValidationActivity
-
- All Implemented Interfaces:
CheckoutWorkflowActivity,RequiresSecurePaymentInformationActivity
public class CartStalePricingValidationActivity extends Object implements RequiresSecurePaymentInformationActivity
ThisCheckoutWorkflowActivityis responsible for validating that theCartand itsCartItemshave the actual (latest) prices.- If the prices are accurate, the checkout attempt will continue.
- If the new cart total is less than the previous the cart will be updated with the new prices,
and if the property
shouldRejectLowerPriceis "true" the exceptionCheckoutWorkflowActivityExceptionwill be thrown with theDefaultCheckoutFailureTypes.STALE_CART_PRICING_LOWERfailure type. - If the new cart total is higher than the previous the cart will be updated with the new
prices and the exception
CheckoutWorkflowActivityExceptionwill be thrown with theDefaultCheckoutFailureTypes.STALE_CART_PRICING_HIGHERfailure type.
- Author:
- Dima Myroniuk (dmyroniuk)
-
-
Constructor Summary
Constructors Constructor Description CartStalePricingValidationActivity(org.springframework.context.MessageSource messageSource, CartProvider cartProvider, CartStalePricingValidationActivityProperties properties, StaleCartPricingResultHolder staleCartPricingResultHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CheckoutProcessDtoexecute(@NonNull CheckoutProcessDto processDto, @NonNull Map<String,String> securityCodes, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Method responsible for executing some work against the cart that requires secure payment information in checkout.protected CartOperationServicegetCartOperationService()protected CartOperationServicePropertiesgetCartOperationServiceProperties()protected CartPricingServicegetCartPricingService()Deprecated.since 1.6, usegetCartOperationService()instead.protected CartProvidergetCartProvider()protected org.springframework.context.MessageSourcegetMessageSource()protected CartStalePricingValidationActivityPropertiesgetProperties()protected StaleCartPricingResultHoldergetStaleCartPricingResultHolder()protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()CheckoutProcessDtorollback(@NonNull CheckoutProcessDto processDto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Method responsible for rolling back any work that was done during the execution of theCheckoutWorkflowActivity.execute(CheckoutProcessDto, ContextInfo)method.voidsetCartOperationService(CartOperationService cartOperationService)voidsetCartOperationServiceProperties(CartOperationServiceProperties cartOperationServiceProperties)voidsetTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)protected CheckoutProcessDtovalidateCartHasLatestPricing(@NonNull CheckoutProcessDto processDto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)-
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.checkout.workflow.activity.RequiresSecurePaymentInformationActivity
execute
-
-
-
-
Constructor Detail
-
CartStalePricingValidationActivity
public CartStalePricingValidationActivity(org.springframework.context.MessageSource messageSource, CartProvider cartProvider, CartStalePricingValidationActivityProperties properties, StaleCartPricingResultHolder staleCartPricingResultHolder)
-
-
Method Detail
-
execute
public CheckoutProcessDto execute(@NonNull @NonNull CheckoutProcessDto processDto, @NonNull @NonNull Map<String,String> securityCodes, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:RequiresSecurePaymentInformationActivityMethod responsible for executing some work against the cart that requires secure payment information in checkout.- Specified by:
executein interfaceRequiresSecurePaymentInformationActivity- Parameters:
processDto- TheCheckoutProcessDtothat we're attempting to checkout with.securityCodes- Secure codes that are passed to the gateway for verification during authorization or capture transactions.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The final state of the
CheckoutProcessDtofollowing the execution of the activity.
-
rollback
public CheckoutProcessDto rollback(@NonNull @NonNull CheckoutProcessDto processDto, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CheckoutWorkflowActivityMethod responsible for rolling back any work that was done during the execution of theCheckoutWorkflowActivity.execute(CheckoutProcessDto, ContextInfo)method.- Specified by:
rollbackin interfaceCheckoutWorkflowActivity- Parameters:
processDto- TheCheckoutProcessDtothat we were attempting to checkout with, but ran into an exception/error.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The final state of the
CheckoutProcessDtofollowing the rollback of the activity.
-
validateCartHasLatestPricing
protected CheckoutProcessDto validateCartHasLatestPricing(@NonNull @NonNull CheckoutProcessDto processDto, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
getMessageSource
protected org.springframework.context.MessageSource getMessageSource()
-
getCartProvider
protected CartProvider getCartProvider()
-
getCartOperationService
protected CartOperationService getCartOperationService()
-
setCartOperationService
@Autowired public void setCartOperationService(CartOperationService cartOperationService)
-
getProperties
protected CartStalePricingValidationActivityProperties getProperties()
-
getStaleCartPricingResultHolder
protected StaleCartPricingResultHolder getStaleCartPricingResultHolder()
-
getCartPricingService
@Deprecated protected CartPricingService getCartPricingService()
Deprecated.since 1.6, usegetCartOperationService()instead.
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
getCartOperationServiceProperties
protected CartOperationServiceProperties getCartOperationServiceProperties()
-
setCartOperationServiceProperties
@Autowired public void setCartOperationServiceProperties(CartOperationServiceProperties cartOperationServiceProperties)
-
-