Validate your merchant identity and receive a session object for each payment request.
- Apple Pay JS
- Payment Request API
As soon as the system displays the payment sheet, the Apple Pay JS API calls your session object’s
onvalidatemerchant event handler to verify that the request is coming from a valid merchant. It passes the function an
Apple object that contains the validation URL.
You call your server, passing it the URL from the event’s
Your server uses the validation URL to request a session from the Apple Pay server, as described in Requesting an Apple Pay Payment Session. Never send the request for a merchant session from the client.
In response, your server receives an opaque merchant session object.
You pass the merchant session object to your Apple Pay session’s
completemethod. You can use the merchant session object a single time. It expires five minutes after it is created.