Get Apple Pay Session
Get an opaque Apple Pay session object that can be used to call the Apple Pay Javascript SDK's completeMerchantValidation method
In order to display the Apple Pay payment sheet when integrating Apple Pay on the Web, you will need to retrieve an opaque Apple Pay session object. The following Fat Zebra API endpoint can be used to retrieve the opaque Apple Pay session object.
Request Details
Property | Description |
---|---|
Method | GET |
URL | Sandbox: https://paynow.pmnts-sandbox.io/v2/apple_pay/payment_session Production: https://paynow.pmnts.io/v2/apple_pay/payment_session |
Authentication | Refer to Authentication |
Request Parameters
Parameter | Type | Description |
---|---|---|
url | String | The Validation URL provided by the Apple Pay JS SDK's onvalidatemerchant event handler The Validation URL provided must come from one of the whitelist Apple Pay domains or a 400 Bad Request response will be returned |
domain_name | String | The fully qualified domain name of your website that initiated the Apple Pay payment sheet via an Apple Pay button |
display_name | String, maximum 64 UTF-8 characters | The display name for the merchant in the Apple Pay Session. This will be displayed in the Touch Bar, and in the Payment Sheet when displayed to the customer |
Example Request
curl https://paynow.pmnts-sandbox.io/v2/apple_pay/payment_session\?url\=https://apple-pay-gateway-cert.apple.com/paymentservices/startSession\&domain_name\=fatzebra.com -u TEST:TEST
Example Response
{
"epochTimestamp": 1597042910373,
"expiresAt": 1597046510373,
"merchantSessionIdentifier": "<identifier>",
"nonce": "<nonce>",
"merchantIdentifier": "<merchant-identifier>",
"domainName": "fatzebra.com",
"displayName": "Fat Zebra",
"signature": "<signature>"
}
Updated about 2 years ago