You can store your shoppers' payment details so that they can pay without entering their payment details again. Storing payment details creates an associated token that can be used for subsequent payments.
Because the payment session contains all the information needed to securely create and pay with tokens, Drop-in handles the sensitive payment data for you. This minimizes your PCI DSS scope and qualifies you for the simplest form of PCI validation (SAQ A).
You can:
- Store payment details : Create a token when the shopper makes a payment, or with a zero-value authorization to verify payment details without collecting a payment.
- Make a one-click payment : Use the token for shopper-initiated payments where the returning shopper uses their stored payment details for a faster checkout.
Requirements
Before you begin, take into account the following requirements, limitations, and preparations.
| Requirement | Description |
|---|---|
| Integration type | A standard integration. |
| API credential roles | Make sure that you have the following roles:
|
| Webhooks | Subscribe to the Recurring tokens life cycle events webhook type. |
| Setup steps | Before you begin: |
How it works
The following diagrams show the flow for storing payment details and making a one-click payment.
Storing payment details:
- The shopper proceeds to checkout on your website.
- Your server creates a payment session with additional tokenization parameters. Adyen returns session data.
- Your client website creates an instance of
AdyenCheckoutand initializes Drop-in with the session data. - The shopper selects their payment method, selects the checkbox to store their payment details, and submits their payment. Drop-in handles the payment flow.
- Adyen authorizes the payment and creates a token for the shopper's payment details.
- Your webhook server receives a webhook message with the token associated with the shopper's stored payment details.
- You store the token and the shopper reference in your database.
Making a one-click payment:
- The shopper proceeds to checkout on your website.
- Your server creates a payment session with additional tokenization parameters. Adyen returns session data.
- Your client website creates an instance of
AdyenCheckoutand initializes Drop-in with the session data. - The shopper selects their stored payment method and submits the payment. Drop-in handles the payment flow.
- Your webhook server receives a webhook message with the outcome of the payment.
Store payment details
To store your shopper's payment details and get a token that you can use for future payments:
- Before the shopper pays on your website, ask for their consent to store their payment details for future payments.
- Create a session with tokenization parameters.
- Get the token from the webhook.
Create a session with tokenization parameters
When the shopper proceeds to make a payment, create a session and include the following additional parameters for tokenization:
| Parameter | Required | Description |
|---|---|---|
shopperInteraction |
Indicates the sales channel through which the shopper gives their card details. Set to Ecommerce. | |
recurringProcessingModel |
The type of recurring payment the token is intended for. Set to CardOnFile. | |
storePaymentMethodMode |
Indicates if the shopper's payment details will be stored. Possible values:
|
To store the shopper's payment details without collecting a payment, you can use a zero-value authorization: set the amount.value to 0 to verify the payment details. If you want to store the payment details as part of an actual transaction, use the amount for the current transaction.
The token is created after a successful payment authorization to ensure that the shopper's payment details are linked to an active account that can be charged.
Get the token from the webhook
After the transaction is authorized, you receive a recurring.token.created webhook with the token you can use for future payments. Store the storedPaymentMethodId together with the shopperReference, so that you associate the token with the shopper.
To receive these updates, enable the Recurring tokens life cycle events webhook. We recommend that you set up the webhook with all default events.
Make a one-click payment
After you have stored a shopper's payment details, you can use the token for one-click payments where the returning shopper uses their stored payment details for a faster checkout.
-
From your server, make a POST /sessions request including:
Parameter Required Description shopperReferenceYour unique identifier for the shopper. We use it to check if you have stored payment details associated with this shopper. shopperInteractionIndicates the sales channel through which the shopper uses the stored payment details. Set to Ecommerce. recurringProcessingModelThe type of recurring payment. Set to CardOnFile. If you set this to any other value, we internally change it to CardOnFile. If you use 3D Secure for PSD2 SCA compliance, some issuing banks require SCA for ContAuth with CardOnFile transactions. See the PSD2 SCA compliance guide for more information.
-
If the shopper selects the option to pay with their stored payment details, Drop-in handles the payment flow.
-
Get the outcome of the payment in a webhook message.
Test and go live
Follow our testing guide for tokenization and make sure that you can successfully store payment details and make payments with a token.
When you are ready to go live:
- Enable the Recurring tokens life cycle events webhooks in your live Customer Area.
- Follow the Tokenization end-to-end testing checklist.