Broadleaf Microservices
  • v1.0.0-latest-prod

Payment Method Validation Workflow Activity

Overview

The following documentation is only relevant prior to version 1.7.0-GA. For payment interactions in 1.7.0-GA and later releases, see Payment Transaction Components (Since 1.7.0-GA) and Checkout Payment Architecture.

Activity that validates that the cart contains payments with amounts sufficient for its total price. Additionally, this activity validates that the PaymentGatewayType is specified by each payment to ensure they can be authorized and captured.

Default Implementation Details

By default, this activity uses CartPaymentStatusService to determine the current status of each Payment in the cart. It then validates:

  1. That the cart has at least 1 active payment

  2. That the payment amounts are all 0 or greater (not null)

  3. That the sum of them matches the cart’s total

  4. That the payment gateway type is present and supported

  5. And that the sum of all successful authorization, successful capture, unconfirmed, and pending PaymentTransactions match the cart’s total

Subscription Payment Validation

Note
Since 2.3.0. For a broader overview of checkout requirements for subscriptions, see Subscription Checkout.

Subscription User Validation

If a subscription item is present in the cart, require that the user is logged in

Subscription Payment Validation

  • If a cart contains a subscription item, then the checkout flow validates that…​

    • The user has active saved payment methods (ie `SavedPaymentMethod`s in PaymentTransactionService) in their wallet to support recurring billing.

    • Alternatively if the wallet is empty, then the cart’s Payment must be saved for future use (customer unable to opt-out of this option)

    • If the cart total is $0 (eg a free trial), then allow no Payments to be declared if the customer has a saved payment method

    • If the cart payment’s type is ADD_TO_BILL…​

      • And the customer is anonymous, then reject the usage of an AddToBill-typed payment method

      • And the customer is logged in, then skip the wallet & cart payment validation logic

If any of these fail, then a CheckoutWorkflowActivityException is throw with failureType INVALID_PAYMENT_CONFIG, which is then handled by CheckoutWorkflowActivity and can be referenced by the checkout initiator in the CheckoutResponse.