3

I want to see if there is a way to quickly check on the mobile web on chrome whether or not a user has Google Pay enabled. On IOS, I can call window.ApplePaySession.can make payments() method on safari dev tools to instantly know if the user has apple pay enabled.

Is there an equivalent code snippet I can call on Chrome dev tools to figure out if the user has Google pay enabled? I don't need to be able to make a transaction or anything complicated, I just need to know if a user has that functionality enabled.

As far as my research, I found that window.PaymentRequest(methodData).canMakePayments() should do the trick, but the problem with that route is that methodData needs information such as the merchant ID and merchant name, which I don't have. On apple's side, I do need that info to make a transaction, but I don't need it to simply check if apple pay is possible. Is there a way (maybe similar to the previous code snippet I shared) to ask the browser if Google pay is enabled without providing extra info such as merchant ID?

A.B.
  • 81
  • 6

1 Answers1

0

Google Pay has a similar functionality to determine the readiness of the payment method to Apple Pay. Though it is not simple as finding out in Apple Pay, you had to set some data to determine the readiness as given in the link - https://developers.google.com/pay/api/web/guides/tutorial#isreadytopay

However, you do not require any explicit requirement of Merchant ID here to fulfil this isReadyToPay API.

DDarkNi8
  • 9
  • 1