Apple Pay
In order to use the apple_pay
payment method with our Payments API, it is assumed that you, as a merchant, have completed your own integration with Apple Pay.
We do not have the ability to decrypt the blob received from Apple Pay as it should be encrypted for you, so we expect that you are decrypting the encrypted blob to obtain the payment token.
You then need to parse the payment token and provide the relevant payment details and cryptogram to complete the payment.
Attribute Translation
Our Attributes | Apple Payment Token's Attributes |
---|---|
cardholder | cardholderName from the data dictionary, if present |
number | applicationPrimaryAccountNumber from the data dictionary |
expiry_year | parse the applicationExpirationDate from the data dictionary to extract the year, then format as 4-digits |
expiry_month | parse the applicationExpirationDate from the data dictionary, to extract the month as 2 digits |
transaction_id | transactionId attribute from the header dictionary |
cryptogram | onlinePaymentCryptogram from the data dictionary |
Note: if the Apple Payment Token's data
dictionary contains an eciIndicator
value, you MUST supply that using the ecommerce_flag
attribute. The payment will not be approved if this value is omitted.
Examples
These values should not be taken to be representative of real-world values. These examples are merely to indicate the expected payload structure.
POST /payments
{
"amount": 100,
"terminal": {"gateway_id": "YOUR_GW_ID"},
"payment_method": {
"apple_pay": {
"cardholder": "Apple Pay",
"number": "4111111111111111",
"expiry_month": "05",
"expiry_year": "2024",
"transaction_id": "ABVD93934239",
"cryptogram": "kiwewruhflkjsdfblaseufh"
}
}
}
POST /payments
{
"amount": 100,
"terminal": {"gateway_id": "YOUR_GW_ID"},
"payment_method": {
"apple_pay": {
"cardholder": "Apple Pay",
"number": "4111111111111111",
"expiry_month": "05",
"expiry_year": "2024",
"transaction_id": "ABVD93934239",
"cryptogram": "kiwewruhflkjsdfblaseufh"
}
},
"options": {
"ecommerce_flag": "07"
}
}
Updated about 3 years ago