paymentDetailsSubmit
Continue a payment that paymentCreate answered with a PaymentSdkAction, with what the provider's component reported once the shopper acted, such as PayPal's approval. Pass the component's data as it is.
Answers what happens next as paymentCreate does: a payment that covers a cart orders it, and the order comes back on PaymentComplete, or PaymentPending while the provider confirms. A refusal releases the cart, so the shopper can pay another way.
A guest cart needs its email first, set from what the component reported, since the order is created from the cart. Without it this answers a ValidationError before anything is charged.
Arguments
| Argument | Type | Description |
|---|---|---|
target | PaymentTargetInput! | The cart or order the payment was created against |
paymentId | ID! | The payment PaymentSdkAction named |
details | JSON! | What the provider's component reported, verbatim |
Returns
| Field | Type | Description |
|---|---|---|
next | PaymentNext | What the shopper does next, when the details were accepted |
paymentErrors | [PaymentDetailsSubmitError!] | Error details if the payment could not be continued |
Example
mutation PaymentDetailsSubmit( $target: PaymentTargetInput! $paymentId: ID! $details: JSON!) { paymentDetailsSubmit( target: $target paymentId: $paymentId details: $details ) { next { __typename ... on PaymentRedirect { redirectUrl } ... on PaymentComplete { __typename } ... on PaymentSdkAction { provider action } } paymentErrors { __typename ... on PaymentError { code message } ... on ValidationError { message } } }}{ "target": { "id": "id-1", "type": "CART" }, "paymentId": "id-1", "details": {}}{ "data": { "paymentDetailsSubmit": { "next": { "__typename": "PaymentRedirect", "redirectUrl": "https://example.com/" }, "paymentErrors": [ { "__typename": "PaymentError", "code": "TARGET_NOT_FOUND", "message": "Example" } ] } }}The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.
Served by
| @evolve-framework/commercetools | Resolved |
| @evolve-framework/medusa | Not resolved |
| @evolve-framework/sfcc | Not resolved |
Used by
The storefront packages that send it, in these GraphQL documents:
- @evolve-storefront/feature-cart:
ExpressPaymentDetailsSubmit

