Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Apple Pay

Wallet payment using a tokenized card from the customer's Apple Wallet. The encrypted payment data is obtained from the Apple Pay JS API (or native SDK) on the client side — it is never constructed manually.

Before you send this request: Complete the Apple Pay payment sheet on the client. The PKPaymentToken object contains paymentData (base64-encoded encrypted blob), paymentMethod (display name, network, type), and transactionIdentifier. Pass these directly into the fields below.

const paymentClient = new PaymentClient(config);

// applePayToken: PKPaymentToken from the Apple Pay JS / native callback
const response = await paymentClient.authorize({
    merchantTransactionId: "txn_001",
    amount: { minorAmount: 1000, currency: Currency.USD },
    paymentMethod: {
        applePay: {
            paymentData: {
                encryptedData: applePayToken.paymentData,  // base64 string
            },
            paymentMethod: {
                displayName: applePayToken.paymentMethod.displayName,
                network: applePayToken.paymentMethod.network,
                type: applePayToken.paymentMethod.type,
            },
            transactionIdentifier: applePayToken.transactionIdentifier,
        },
    },
    captureMethod: CaptureMethod.AUTOMATIC,
    address: { billingAddress: {} },
    authType: AuthenticationType.NO_THREE_DS,
    returnUrl: "https://example.com/return",
});

Token decryption paths

The PKPaymentToken blob has to be decrypted by whoever holds the Apple Pay payment processing certificate. Which of the two paths runs is decided by the merchant connector account, and it decides whether the processor receives the sealed blob or the network token inside it.

PSP decrypts

check_apple_pay_metadata → SkipDecryption. The blob is sealed to the processor's certificate and passes through untouched; the processor decrypts it at authorization.

Apple Pay, encrypted token — the PSP decrypts

Hyperswitch decrypts

check_apple_pay_metadata → DecryptAtApplication. The blob is sealed to Hyperswitch's own certificate and decrypted before authorization, so the processor is sent the DPAN, expiry and online payment cryptogram rather than the blob.

Apple Pay, decrypted token — Hyperswitch decrypts

Last updated

Was this helpful?