Class CartStalePricingValidationActivity

    • Method Detail

      • execute

        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)
        Description copied from interface: CheckoutWorkflowActivity
        Method responsible for executing some work against the cart that is required for checkout. This may include, but is not limited to, cart validation checks, inventory reservations, or payment authorizations.
        Specified by:
        execute in interface CheckoutWorkflowActivity
        Parameters:
        cart - The Cart that we're attempting to checkout with.
        requestId - The id used to identify changes tied to the specific execution request
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        The final state of the cart following the execution of the activity.
      • rollback

        public com.broadleafcommerce.cart.client.domain.Cart rollback​(@NonNull
                                                                      @NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
                                                                      String requestId,
                                                                      @Nullable
                                                                      com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: CheckoutWorkflowActivity
        Method responsible for rolling back any work that was done during the execution of the #execute(Cart, String) method.
        Specified by:
        rollback in interface CheckoutWorkflowActivity
        Parameters:
        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 request
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        The final state of the cart following the rollback of the activity.
      • validateCartHasLatestPricing

        protected com.broadleafcommerce.cart.client.domain.Cart validateCartHasLatestPricing​(com.broadleafcommerce.cart.client.domain.Cart cart,
                                                                                             @Nullable
                                                                                             com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • determineOldCartPrice

        protected javax.money.MonetaryAmount determineOldCartPrice​(com.broadleafcommerce.cart.client.domain.Cart cart)
      • determineCartWithLatestPrices

        @Nullable
        protected com.broadleafcommerce.cart.client.domain.Cart determineCartWithLatestPrices​(com.broadleafcommerce.cart.client.domain.Cart cart,
                                                                                              @Nullable
                                                                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • latestPriceIsHigher

        protected boolean latestPriceIsHigher​(javax.money.MonetaryAmount latestCartPrice,
                                              javax.money.MonetaryAmount oldCartPrice)
      • latestPriceIsLower

        protected boolean latestPriceIsLower​(javax.money.MonetaryAmount latestCartPrice,
                                             javax.money.MonetaryAmount oldCartPrice)
      • getPricingChangeMessage

        protected String getPricingChangeMessage​(javax.money.MonetaryAmount oldCartPrice,
                                                 javax.money.MonetaryAmount latestCartPrice)
      • createCartAlert

        protected com.broadleafcommerce.cart.client.domain.CartAlert createCartAlert​(String message)
      • getMessageSource

        protected org.springframework.context.MessageSource getMessageSource()
      • getCartProvider

        protected CartProvider getCartProvider()
      • setCartOperationService

        @Autowired
        public void setCartOperationService​(CartOperationService cartOperationService)