Apple Pay JS - How to check if payment is already authorized

148 Views Asked by At

I'm implementing Apple Pay on my web app using Apple Pay JS API.

Before creating a new ApplePaySession, how can I check that Payment is already authorized and there is no need to create a new apple pay session for current transaction?

appreciate any thoughts.

1

There are 1 best solutions below

0
On

Create a global variables and set it to false, onPaymentAuthorization event set it to true and use it for your check where it's required. let say -

Let isAppleAuthorized = false;

Apple session.onpaymentauthorized = function (event){
    isAppleAuthorized = false;
}