Store an Apple Pay payment token
Decrypts the Apple Pay payment token and stores the card in the vault. Call it when Apple triggers the onpaymentauthorized event, with the contents of event.payment.token.paymentData and the setup_token of the transaction.
Apple describes the fields in its payment token format reference.
apiKeyAuthorizationBasic <token>Use your project's API key as the username and leave the password empty. Only use the API key from your server: it gives full access to your project.
application/json- body
setupToken*stringThe setup_token from the payment_method_details of the Apple Pay transaction.
uuiddata*stringEncrypted payment data from Apple, Base64-encoded.
signature*stringSignature of the payment and header data, Base64-encoded.
header*Additional information Apple uses to decrypt and verify the payment.
version*stringVersion of the payment token, such as EC_v1.
The payment details you need to execute the payment.
application/json- response
vaultToken?stringToken of the card in the vault.
uuidonlinePaymentCryptogram?stringThe cryptogram of the payment.
eciIndicator?stringThe Electronic Commerce Indicator (ECI).
curl -X POST 'https://api.dev.gingerpayments.com/v1/apple-pay/payment-tokens/persist/' \ -H 'Content-Type: application/json' \ -d '{ "setupToken": "c6d0a22b-df22-41a2-aac1-d647173ff219", "data": "C+YChH...dTlaSmc=", "signature": "MIAGCSqGSIb3DQ...==", "header": { "publicKeyHash": "yFMDm...s=", "ephemeralPublicKey": "MFkwEwYHKo...SoHnSg==", "transactionId": "878...4c52" }, "version": "EC_v1"}'{ "vaultToken": "d972dc43-6a3d-4dcf-b54e-6e9a0fe325e3", "onlinePaymentCryptogram": "AgAAAAAABk4DWZ4C28yUQAAAAAA=", "eciIndicator": "7"}