Overview#
Apple Pay JS API Version 6 will be used for Apple Pay in the checkout page (as the minimal supported version). Creating an Apple Pay Session#
An ApplePaySession will be initiated by Zid on the client side using the following params / ApplePayPaymentRequest object;{
currencyCode: {Merchant Currency based on country},
countryCode: {Merchant Country},
total: {
label: {Store Name},
amount: **
},
supportedNetworks: ['masterCard', 'visa', 'mada'],
merchantCapabilities: ['supports3DS', 'supportsCredit', 'supportsDebit']
};
Validating the merchant and obtaining merchant session#
The next step is handling the onvalidatemerchant event in the payment sheet. Here we call an API provided by the partner / provider to validate the merchant with Apple, and obtain a merchant session to be passed to completeMerchantValidation callback function defined by Apple.
Here's a detailed description of this step: Providing Merchant ValidationNote: The domain where the Apple Pay button is displayed must be registered with Apple as a prerequisite. We will do this through an API endpoint exposed by the provider.
See Register Domain for more details On Payment Authorized #
During the onpaymentauthorized event after the customer authenticates the transaction through FaceID or TouchID or whatever, an Apple payemnt token will be obtained on the client side. After obtaining the token, the payment sheet will be closed using the completePayment function. Then, a request will be sent to Zid Payments backend with the encrypted payment payload / token. From there, an execute payment API request will be sent to the payment provider passing the token.Once the payment is authorized and an execute payment request is sent to the provider, the customer should be charged immediately.
Modified at 2025-08-10 18:55:59