简体   繁体   English

什么是 Apple Pay canMakePayments() 方法的谷歌支付等价物?

[英]What is the google pay equivalent of Apple Pay canMakePayments() method?

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.我想看看是否有一种方法可以快速检查 chrome 上的手机 web 用户是否启用了 Google Pay。 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.在 IOS 上,我可以调用window.ApplePaySession.can make payments()方法来立即知道用户是否启用了 apple pay。

Is there an equivalent code snippet I can call on Chrome dev tools to figure out if the user has Google pay enabled?是否有等效的代码片段我可以调用 Chrome 开发工具来确定用户是否启用了 Google 支付? 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.就我的研究而言,我发现window.PaymentRequest(methodData).canMakePayments()应该可以解决问题,但该路由的问题是 methodData 需要商家 ID 和商家名称等信息,而我没有这些信息. 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?有没有办法(可能类似于我之前共享的代码片段)询问浏览器是否启用了 Google Pay 而无需提供额外信息(例如商家 ID)?

Google Pay has a similar functionality to determine the readiness of the payment method to Apple Pay. Google Pay 具有与 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虽然它不像在 Apple Pay 中找到那么简单,但您必须设置一些数据以确定链接中给出的准备情况 - 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.但是,您不需要在此处明确要求 Merchant ID 来实现此isReadyToPay API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM