0

I am using Apple Pay JS. I created Apple Pay feature for my website and it has been working great in Safari browser in iOS devices but stopped working after updating the iOS to the latest version, iOS13.

The issue is that the Apple Pay sheet no longer appears on iOS13. I do not see any errors in the logs. It starts the Apple Pay session but does not call the onvalidatemerchant and anything post that.

On button click of Apple Pay I have the following method

function makePayment()
{
    var applePayRequest = sampleRequest;
    var applePaySession = new ApplePaySession(1, applePayRequest)

    applePaySession.onvalidatemerchant = function(event) {
      log('validate merchant called');

       // api service call with event.validationUrl to get the session data
    };

    applePaySession.onPaymentAuthorized = function(event) {
      log('on payment authorized called');

       // get payment token and call api service with details for
      // payment processing 
    };

    log('begin Apple Pay session');
    applePaySession.begin();

    log('Apple Pay session called');

 }

The following logs get printed 'begin Apple Pay session' 'Apple Pay session called'

Which means the onvalidatemerchant is not even called. On an iOS 12 device, I would additionally get a log for 'validate merchant called' as well.

Any suggestions?

Sohanit
  • 1
  • 1

1 Answers1

0

I have the same problem. As you see on documentation the latest version is 6.

https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778014-supportsversion enter image description here

But I checked version window.ApplePaySession.supportsVersion(8) and it available.

After replace version in

var applePaySession = new ApplePaySession(1, applePayRequest)

to

var applePaySession = new ApplePaySession(8, applePayRequest)

it's work!

  • I did try changing the versions but it did not have any affect. Surprisingly, it started working fine with the same code after about 2 weeks. Not sure if there was an issue with Apple's non prod systems. Around the same time some of the Apple's listed credit card numbers for non prod tests were also not working. I raised this with Apple and found out that MasterCard was having issues. – Sohanit Dec 27 '19 at 15:26