onvalidatemerchant
An event handler the system calls when it displays the payment sheet.
Declaration
attribute EventHandler onvalidatemerchant;Mentioned in
Discussion
Use this attribute to request and return a merchant session. You must set this attribute to the following function:
session.onvalidatemerchant = function(event) {}where event is an ApplePayValidateMerchantEvent object.
The process to complete the merchant validation is as follows:
Your onvalidatemerchant function calls your server, and passes it the static hostname
apple-pay-gateway.apple.comas the validation URL. In the China region, usecn-apple-pay-gateway.apple.com.Your server uses the validation URL to request a session from the Apple Pay server, as described in Requesting an Apple Pay payment session.
In response, your server receives an opaque merchant session object,
MerchantSession.You pass the merchant session object to the completion method, completeMerchantValidation.
The system enables the payment sheet.