Requirements
Before you begin, take into account the following requirements, limitations, and preparations.How it works:
- You make a card acquisition request on the terminal to get the card details.
- The shopper presents their card to the payment terminal.
- You use identifiers from the card acquisition response to check if you recognize the shopper. If it is a first-time shopper, you collect their details like phone number or email. You can use card identifiers to tokenize the card for future recurring payments.
-
You send a payment request to pre-authorize an amount.
We recommend that you also tokenize the card for future recurring payments. This enables you to recover the full payment in case an authorization adjustment fails. - The shopper enters the store, takes items, and leaves the store.
- If the purchase amount is different from the pre-authorized amount, you send an authorization adjustment request, followed by a capture request.
-
If the authorization adjustment fails for any reason, you can capture the pre-authorized amount. After that:
- If you tokenized the card, you can make a recurring online payment for the remaining amount.
- If you collected the shopper’s email or phone number, you can send them a payment link for the remaining amount.
1. Get the card details
In your back-end, implement a trigger for the card acquisition request on the terminal to prompt the shopper to present a card. From the response, you can take certain details such as the card alias to determine if the shopper should be let in.-
Create a
SaleToPOIDataJSON object with:Operation.Type: PaymentOperation.Variant: PreAuthToEnterShop. Hides the pre-authorization amount specified inCardAcquisitionTransaction.TotalAmountfrom showing on the initial screen. This is to prevent shoppers from thinking they need to pay to enter the store.
-
Encode the
OperationJSON object to Base64. You will pass the resulting string inSaleData.SaleToPOIData. Converted to a Base64-encoded string -
Create a
SaleToAcquirerDataJSON object with:-
authorisationType: PreAuth. Pre-authorizes the amount specified inCardAcquisitionTransaction.TotalAmount. -
recurringProcessingModel: UnscheduledCardOnFile. Enforces cardholder authentication during pre-authorisation (if configured by our Support Team). To tokenize the card, include this field in both the card acquisition and the follow-up pre-authorization payment request. If the PSD2 SCA compliance rules apply to your business, we recommend enforcing cardholder authentication. To enable this, contact our Support Team.
-
-
Encode the JSON object to Base64. You will pass the resulting string in
SaleData.SaleToAcquirerData. Converted to a Base64-encoded string -
Make a card acquisition request, including:
-
The CardAcquisitionRequest.SaleData object with:
The following example shows a card acquisition response with an amount of EUR 10. Card acquisition response -
The CardAcquisitionRequest.SaleData object with:
-
From the CardAcquisitionResponse, save the following details :
POIData.POITransactionID: since you are continuing with a payment, keep theTimeStampand theTransactionIDbecause you need these card acquisition details in your payment request.Response.AdditionalResponse.alias: this is a value that uniquely represents the shopper’s card number (PAN), for example A37317672402294. With this, you can recognize the card that a shopper is using and identify if they are returning customers. You cannot use the card alias for making payments.
AdditionalResponsecan be a Base64-encoded or URL-encoded. To always receive theAdditionalResponsein one of those formats, contact our Support Team.
2. Optional: Get the shopper’s details
If the shopper is entering the store for the first time, you can ask them to enter their contact details, or to provide consent to tokenize their card.- Ask the shopper’s consent to save their details. For this, you can use confirmation or signature input requests.
- Collect the shopper’s contact details. For this you can use phone number or text input requests. You can then use these details when tokenizing the card or to send the shopper a payment link.
- Save the shopper’s contact details and the card alias received in the
Response.AdditionalResponse.aliasof the card acquisition response.
3. Pre-authorize an amount
After you collect the card and shopper details, send a payment request to pre-authorize the amount specified in the card acquisition request. You can also tokenize the card with Adyen. This enables recurring payments with the shopper’s card and allows you to recover failed payments in case the shopper has insufficient funds at the time of purchase. If you plan to tokenize the card, make sure that you enable receiving shopper identifiers and check with our Support Team if your account is correctly configured for your tokenization use case.-
Prepare the
SaleData.SaleToAcquirerDatavalue for the pre-authorization payment request that you will make.
Include the following data elements:-
authorisationType: PreAuth. This indicates this is a pre-authorization request. -
To tokenize the card, also include:
shopperReference: Your unique reference for this shopper. Minimum length: three characters. Note that the value is case-sensitive. Do not include personally identifiable information (PII), such as name or email address.recurringProcessingModel: UnscheduledCardOnFile. Creates a recurring contract for transactions that occur on a non-fixed schedule and/or have variable amounts. Enforces cardholder authentication (if configured by our Support Team).shopperEmail: Optional. The shopper’s email address, if you collected that.
SaleData.SaleToAcquirerDatavalue in one of the following ways (refer to Add information to a payment):-
Option 1: A JSON object converted to a Base64-encoded string. For example:
JSON object
Encode the Operation JSON object to Base64. Converted to a Base64-encoded string
-
Option 2: Form-encoded key-value pairs (using & as a separator). For example:
Form-encoded key-value pairs
-
-
Make a pre-authorization payment request, including:
-
The PaymentRequest object with:
This amount must be equal to the
TotalAmountin the card acquisition request. | |PaymentData.CardAcquisitionReference|
| An object referring to the card acquisition:- TimeStamp: The time stamp returned in thePOIData.POITransactionIDof the card acquisition response.TransactionID: the transaction ID returned in thePOIData.POITransactionIDof the card acquisition response. | |SaleData.SaleToAcquirerData|
| The Base64-encoded string or form-encoded key-value pairs you prepared. |
The customer presents their card to the payment terminal. If the pre-authorization is successful, the terminals show the transaction is approved. -
The PaymentRequest object with:
-
From the response, save the following details:
For easier shopper recognition and recovering failed payments, from the
Response.AdditionalResponsesave the following details:The following example shows the response to a EUR 10.00 pre-authorization request. Pre-authorization responseNote that thePaymentTokenobject contains the card alias. You cannot use this for making payments. It is intended only for recognizing the card.
4. Adjust the pre-authorized amount
If the purchase amount for items that shopper has taken differs from the pre-authorized amount, you need to send an authorization adjustment request. This is not a Terminal API request to the terminal itself or the Cloud endpoint for the terminal.Depending on your infrastructure and implementation, you may want to use the asynchronous or synchronous authorization adjustment. When building or testing the flow, make sure there is at least a 5 second delay between the pre-authorization and the authorization adjustment.