Skip to main content
For a direct integration, use Apple Pay JS or PassKit to obtain the Apple Pay token and send it to Waffo from your server. You manage:
  • 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.
Before you begin, contact Waffo technical support to confirm the Merchant and payment method configuration.

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 a paymentTokenData 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.
Follow Apple’s Payment token format reference for the complete cryptographic procedure and field definitions. See Setting up Apple Pay for certificate setup.
Decrypted data contains the device account number and payment cryptogram. Do not decrypt it in the browser or log the complete token, device account number, private key, or payment cryptogram.

Decrypted payload structure

Decrypting token.paymentData produces the payment token payload defined by Apple:
MPAN scenarios for Subscription payments also include Merchant Token information such as 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:
When Waffo detects 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.