Edit in GitHubLog an issue

Vault a card during a checkout authorization

These steps describe the flow of requests and responses required to vault a credit card during a typical checkout authorization with Payment Services enabled.

The following conditions must be true to vault a card during checkout:

Workflow

Payment Services sequence diagram

  1. Run the getPaymentConfig query to fetch the payment configuration needed to render details of hosted fields.

  2. Commerce returns the payment configuration information.

  3. Run the setPaymentMethodOnCart mutation to set the payment method.

  4. Adobe Commerce returns a Cart object.

  5. Run the createPaymentOrder mutation with vaultIntent set to true to begin the authorization process.

  6. Commerce forwards the request to PayPal.

  7. PayPal returns an id value.

  8. Adobe Commerce generates a order_id and forwards the value in the mp_order_id field and the PayPal response in the id field.

  9. Run setPaymentMethodOnCart again with is_active_payment_token_enabler set to true. This indicates whether a customer-entered credit/debit card should be tokenized for later usage.

  10. Adobe Commerce returns a token.

  11. (Optional) If hosted fields and the Signifyd integration are enabled, run the getPaymentOrder query.

  12. (Optional) Adobe Commerce returns details about the payment order.

  13. Run the placeOrder mutation.

  14. Commerce sends an authorization request to PayPal.

  15. PayPal returns the result to Commerce.

  16. Commerce creates an order.

  17. Paypal returns a vault token.

  18. Commerce stores the vault token for the vaulted card.

Additional information

It is only possible to vault configuration details for hosted fields. See getPaymentConfig query for more information.

setPaymentMethodOnCart mutation example

The following example shows the setPaymentMethodOnCart mutation with the attribute is_active_payment_token_enabler set to true.

Request:

Copied to your clipboard
mutation {
setPaymentMethodOnCart ( input: {
cart_id: "uocGxUi5H97XFAMhY3s66q4aFYG3Bmdr",
payment_method: {
code: "payment_services_paypal_hosted_fields",
payment_services_paypal_hosted_fields: {
payment_source: "cc",
payments_order_id: "mp-order-a4babd34-13d3-4ac0-b1b0-109bb7be1574",
paypal_order_id: "9R90936863877801D",
is_active_payment_token_enabler: true
}
}
}
) {
cart {
id
selected_payment_method {
code
}
}
}
}

Response:

Copied to your clipboard
{
"data": {
"setPaymentMethodOnCart": {
"cart": {
"id": "uocGxUi5H97XFAMhY3s66q4aFYG3Bmdr",
"selected_payment_method": {
"code": "payment_services_paypal_hosted_fields"
}
}
}
}
}
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.