applepayapplepay-web

Apple Pay onmerchantvalidation doesn't complete


I'm implementing Apple Pay using the Payment Request API. I'm having a problem similar to this SO question except the opposite: the Payment Sheet doesn't get cancelled, it just times out after 30 seconds. I've tried the suggestions in that question (certificate, verified domain, exact syntax in Json) with no success.

Here is the problem:

I've gone over the example code on the ApplePayDemo site half a dozen times and I don't see anything I'm missing. Anyone have any ideas?


Solution

  • So it turns out that there were two events I need to subscribe to then then just say there was nothing that needed to be updated:

      request.onpaymentmethodchange = event => {
        event.updateWith({});
      };
    
          // @ts-ignore
      request.onshippingaddresschange = event => {
        event.updateWith({});
      };