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.
By default, this activity uses CartPaymentStatusService to determine the current status of each Payment in the cart. It then validates:
That the cart has at least 1 active payment
That the payment amounts are all 0 or greater (not null)
That the sum of them matches the cart’s total
That the payment gateway type is present and supported
The DefaultPaymentGatewayTransactionServiceProvider is used to make this determination.
If no transaction service is found matching the PaymentGatewayType on the payment, it will response with an UnsupportedOperationException, which will be converted to a CheckoutWorkflowActivityException by the activity.
And that the sum of all successful authorization, successful capture, unconfirmed, and pending PaymentTransactions match the cart’s total
|
Note
|
Since 2.3.0. For a broader overview of checkout requirements for subscriptions, see Subscription Checkout. |
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.