Apple pay payment not completed
Hi,
We have encountered an issue in completing the Apple pay integration to a website developed. We see that " Payment not completed" message is displayed when we try to complete the process with sandbox account. The code was debuged and identify that the apple pay session method is not executed. Pasting the code for your reference. Please go through it and any help is highly appreciated.
session.onpaymentauthorized = function (event) {
logit('starting session.onpaymentauthorized');
logit('NB: This is the first stage when you get the *full shipping address* of the customer, in the event.payment.shippingContact object');
logit(event);
var promise = sendPaymentToken(event.payment.token);
promise.then(function (success) {
var status;
if (success){
status = ApplePaySession.STATUS_SUCCESS;
document.getElementById("applePay").style.display = "none";
//document.getElementById("success").style.display = "block";
alert("Your Payment Is Successfully Completed");
} else {
status = ApplePaySession.STATUS_FAILURE;
alert("Your Payment Is Failed");
}
logit( "result of sendPaymentToken() function = " + success );
session.completePayment(status);
});
}