I am currently in the middle of integrating Apple pay javascript on the web.
It is creating apple pay session and it does support v3 but it returns false on canMakePayment()
I am unable to find out the issue over here as i am following the exact code provided by braintree
I am also attaching the error i am facing right now.
------------------------- My Code --------------------------------------
if (!ApplePaySession.canMakePayments()) {
console.error('This device is not capable of making Apple Pay payments');
}
braintree.client.create({
authorization: '@BraintreeManager.Gateway.ClientToken.generate()'
}, function (clientErr, clientInstance) {
if (clientErr) {
console.error('Error creating client:', clientErr);
return;
}
braintree.applePay.create({
client: clientInstance
}, function (applePayErr, applePayInstance) {
if (applePayErr) {
console.error('Error creating applePayInstance:', applePayErr);
return;
}
// Alternatively, check if the device has an Apple Pay card available.
// You can do this if your checkout flow defaults to Apple Pay
// or if you are displaying Apple Pay buttons on a product detail page.
// Use your Apple Pay merchant identifier
// to check if payments can be made.
var promise = ApplePaySession.canMakePaymentsWithActiveCard(applePayInstance.merchantIdentifier);
promise.then(function (canMakePaymentsWithActiveCard) {
if (canMakePaymentsWithActiveCard) {
// Set up Apple Pay buttons
var createApplePay = document.getElementById("create-apple-pay");
createApplePay.innerHTML = '<div class="apple-pay-set-up-button apple-pay-setup-button-white-with-line">';
console.log("Inside set up apple pay button");
}
});
});
});
General information
Issue description
Hi,
I am currently in the middle of integrating Apple pay javascript on the web. It is creating apple pay session and it does support v3 but it returns false on canMakePayment()
I am unable to find out the issue over here as i am following the exact code provided by braintree
https://developers.braintreepayments.com/guides/apple-pay/client-side/javascript/v3
I am also attaching the error i am facing right now.
------------------------- My Code --------------------------------------