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",
});

Last updated

Was this helpful?