Vaulting a credit card without a checkout authorization
These steps describe the flow of requests and responses required to vault a payment method without the typical checkout authorization with Payment Services enabled.
Workflow
Run the
getVaultConfigquery to fetch the vault configuration details for the available payment methods. Attributeis_vault_enabledset totrue.Commerce returns the vault configuration details.
Run the
createVaultCardSetupTokenmutation to create a temporarysetup_tokenassociated to the given payment source.Commerce forwards token request to PayPal.
PayPal returns the temporary
setup_tokento Commerce.Commerce receives the
setup_token.PayPal SDK updates the credit card information in the storefront.
Run the
createVaultCardPaymentTokenmutation to create a permanentvault_token_idand associate it with an optional card description, visible in the storefront.Commerce forwards
setup_tokento PayPal.PayPal returns a permanent
vault_token_idto Commerce.Commerce vaults the payment method.
Additional payment information
The setup token is generated with an empty card number in the payment_source object purposefully. The PayPal SDK, in conjunction with hosted fields or credit cards field components, securely updates the setup token with payment details.
See PayPal SDK developer documentation for more information.
To run the createVaultCardPaymentToken mutation, use the setup_token generated by the createVaultCardSetupToken mutation.
