- an Apple Developer account and Merchant ID;
- a Payment Processing Certificate and its private key;
- domain verification for Apple Pay on the Web;
- the Apple Pay JS or PassKit frontend integration;
- token signature verification, decryption, replay protection, and sensitive-data compliance.
Currently supported: Send a decrypted token
You must currently decrypt the Apple Pay token on your server and send the decrypted result to Waffo in the format below.The request must contain
token.decryptedPaymentData. You may also keep token.paymentData, but you cannot submit it as the only pass-through result.Original encrypted token structure
Apple Pay JS or PassKit returns the following original payment token envelope. This object is currently the input for signature verification and decryption on the Merchant server. It is not apaymentTokenData value that you can submit directly to Waffo.
Decrypt and validate the token
In the token returned by Apple Pay JS or PassKit,token.paymentData contains the encrypted payment data. On your server:
1
Select the decryption key
Use the private key that matches the Payment Processing Certificate.
2
Validate the token
Verify the token signature and certificate chain according to Apple’s specification.
3
Decrypt the payment data
Decrypt
token.paymentData.data according to the token version, then parse the UTF-8 result as JSON.4
Validate the transaction
Confirm that
transactionId has not been processed, and compare the decrypted currency and amount with the order.5
Build the Waffo request
Put the decrypted JSON in
token.decryptedPaymentData, then submit it to Waffo.Decrypted payload structure
Decryptingtoken.paymentData produces the payment token payload defined by Apple:
merchantTokenIdentifier.
Pass-through format
The decrypted payload alone is insufficient. It does not contain the card network, and an Apple Pay DPAN BIN generally cannot be used to determine the network.billingContact is also outside the encrypted data and is the only source of the cardholder name and billing address. Preserve the outer structure returned by Apple Pay and add token.decryptedPaymentData inside token. You may also keep token.paymentData.
The following JSON is the content of the paymentTokenData field in /api/v1/order/create:
paymentTokenData is a String in the create-order API. Serialize the complete object as a JSON string before submitting the request:
token.decryptedPaymentData, it prioritizes the decrypted token and skips platform decryption.
Field requirements
Only Apple Pay accepts decrypted token pass-through. Google Pay tokens must be submitted in encrypted form.