Broadleaf Microservices
  • v1.0.0-latest-prod

Stale Pricing Validation Workflow Activity

The CartStalePricingValidationActivity activity is responsible for validating that the cart and its items have the actual (latest) prices.

Firstly, we check if we already updated the cart pricing on this request during cart resolution. If we have already updated the pricing on this request, we use the cart on this request. If we have not already updated the pricing on this request, we will fetch the cart and evaluate the latest prices, including the latest prices from the catalog. If the pricing is different from the current cart, we update the cart with the latest pricing and add a cart alert for the changed pricing.

  • If the new cart total is less than the previous cart total, the cart will be updated with the new prices and, if the property CartStalePricingActivityProperties#shouldRejectLowerPrice is true, the exception CheckoutWorkflowActivityException is thrown with the failure type STALE_CART_PRICING_LOWER.

  • If the new cart total is higher than the previous cart total, the cart will be updated with the new prices and the exception CheckoutWorkflowActivityException will be thrown with the failure type STALE_CART_PRICING_HIGHER.

  • Otherwise, if the cart total is the same as the previous cart total, we continue on with the checkout workflow.