- Upon arrival, you identify the driver and record their time of arrival based on a card acquisition. Then you cancel the card acquisition.
- When the driver leaves, you do another card acquisition to recognize the driver.
- Then you calculate the amount due based on the arrival and departure times, and make a payment.
Requirements
Before you begin, take into account the following requirements and preparations.Card alias
To be able to identify customers and recognize them later, you need to save the following identifier from your card acquisition and payment responses:- Card alias (
alias): A value that uniquely represents the shopper’s card number (PAN), for exampleA37317672402294. With this, you can recognize the card that a shopper is using. You cannot use the card alias for making payments. You receive the card alias in theAdditionalResponse.
- Other transaction details. For example, transaction date and time.
Identify the customer
When the customer arrives:-
Make a card acquisition request without an amount.
First card acquisition
-
When you receive the CardAcquisitionResponse, save the following details:
From the
AdditionalResponse:alias: The card alias, to identify the customer based on their card.
Depending on the format you used in the request, theAdditionalResponseis either a string of form-encoded key-value pairs or a Base64 string that you need to decode to get a JSON object.
SaleData.SaleTransactionID.TimeStamp: The date and time when the customer presented their card.MessageHeader.POIID: The payment terminal that processed the request. This information is useful if you need to know where the customer presented their card.
Note that if you specified aTokenRequestedTypeof Customer in the request, the card alias is also provided inPaymentInstrumentData.CardData.PaymentToken.TokenValue. - Create a record in your back-end system to store the data obtained from the card acquisition.
-
Cancel the card acquisition flow by sending an enable service request to the same terminal that you sent the card acquisition request to.
The following example will show Welcome!, an animated green check mark
, and We logged your arrival time.
Cancellation using a custom message
In the example above, the EnableServiceRequest contains aDisplayOutputobject to show a message to the customer that their arrival time is logged. Otherwise, if you omit theDisplayOutput, the terminal will show Canceled, a red cross
, and Transaction canceled. That can be confusing for the customer.
Recognize the customer
When the customer leaves:-
Make a card acquisition request without an amount.
Second card acquisition
-
When you receive the CardAcquisitionResponse, save the following details.
POIData.POITransactionID.TimeStampandPOIData.POITransactionID.TransactionID: You need these details later in your payment request.
AdditionalResponse:alias: The card alias, to recognize the customer based on their card.
Depending on the format you used in the request, theAdditionalResponseis either a string of form-encoded key-value pairs or a Base64 string that you need to decode to get a JSON object.
SaleData.SaleTransactionID.TimeStamp: The date and time when the customer presented their card.MessageHeader.POIID: The payment terminal that processed the request. This information is useful if you need to know where the customer presented their card.
- In your back-end system, use the card alias from this second card acquisition to find the record you created for the customer after the first card acquisition.
- Add the details obtained with this second card acquisition.
Make a payment
When you have recognized the shopper:- Calculate the amount due based on the details from the first card acquisition (when the customer arrived) and the second card acquisition (when the customer is ready to leave).
-
Continue with a payment to complete the card acquisition flow, specifying:
Payment after second card acquisition