Article

Providing Merchant Validation

Validate your merchant identity and receive a session object for each payment request.

Overview

As soon as the payment sheet is displayed, 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 ApplePayValidateMerchantEvent object that contains the validation URL.

In your onvalidatemerchant function:

  1. You call your server, passing it the URL from the event’s validationURL property.

  2. Your server uses the validation URL to request a session from the Apple Pay server, as described in Requesting an Apple Pay Payment Session.

  3. In response, your server receives an opaque merchant session object, MerchantSession.

  4. You pass the merchant session object to your Apple Pay session’s completeMerchantValidation method.

See Also

Apple Pay Session

Creating an Apple Pay Session

Provide a payment request and create the session.

Requesting an Apple Pay Payment Session

Request a valid session from the Apple Pay server.

ApplePaySession

A session object for managing the payment process on the web.