canmakepaymentswithactivecard() in production not working for all devices

Hi,


I see more issues with the thecanMakePaymentsWithActiveCard(..) method but all of them describe beta and test environment. I have Apple Pay running on a live site and it is working for some devices but not for all. The problem is that the button is not shown if I use the thecanMakePaymentsWithActiveCard("..") method. For some devices this returns "false" but they have an active card in there wallet. If I remove the check the apple pay payment went well so there is an active card. Any idea if this is a known bug of the apple pay javascript framework ?


Not working in all cases:

if(window.ApplePaySession) {

var promise = ApplePaySession.canMakePaymentsWithActiveCard("MY IDENTIFIER");

promise.then(function (canMakePayments) {

if (canMakePayments) {

// show apple pay button

.......


// solution:

if(window.ApplePaySession) {

// show apple pay button

......


Regards,

Replies

It looks like IOS 10.2 is causing this issue. on 10.1 it is working on 10.2 it is not.

Can you file a radar and include the number here? Is your merchant identifier in good standing?

Hi,


Bugnumber is 29839010.

Yes merchantIdentifier is correct using the same in the transaction and the transaction goes well.


Regards,

Running into the same issue.. Please let me know if you were able to get this resolved..



Just started off with ApplePay button implementation from iPhone Safari Browser(not an app). Using the following function to decide whether the ApplePay button should be displayed or not.


The iPhone that I am using has cards setup in ApplePay. However, the canMakePaymentsWithActiveCard does not return true.


isApplePayEnabled: function() {

if(window.ApplePaySession) {

console.log("isApplePayEnabled inside window.ApplePaySession");

const _APPLE_MERCHANT_IDENTIFIER = "xxxx";

var promise = ApplePaySession.canMakePaymentsWithActiveCard(_APPLE_MERCHANT_IDENTIFIER );

Promise.then(function(canMakePayments) {

if(canMakePayments) {

return true;

}

});

}

return false;

}



Steps done



1) Setup server as described here.

https://developer.apple.com/documentation/apple_pay_on_the_web/setting_up_your_server



2) Setup the merchant Id



3) Verified that the window.ApplePaySession portions works as expected. The issue is only with the following call ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier)