0

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.

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Ahsan Shah
  • 3,931
  • 1
  • 34
  • 48

1 Answers1

0

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;
}
Daniel Smith
  • 1,626
  • 3
  • 29
  • 59