首页 > 解决方案 > 在 Chrome Web Store 扩展上使用 Google Pay api

问题描述

我知道 Chrome 网上应用店有自己的内置支付系统,以及有关使用该支付系统的所有指南。

但是 Google Pay API 也支持网络“ Google Pay API 可以在您的网站上实现快速、简单的结帐。 ”。Extension 实际上是一个 JavaScript 网页。那么我可以在扩展程序上使用 Google Pay API 吗?它会违反网上商店政策吗?

标签: google-chrome-extensiongoogle-pay

解决方案


这目前不起作用。Google Paypay.js在控制台中显示以下错误:

Only localhost, file://, and cryptographic scheme origins allowed.
No UI will be shown. CanMakePayment and hasEnrolledInstrument will always return false. Show will be rejected with NotSupportedError.

看起来问题是,扩展协议是chrome-extension://且仅https://由 Google Pay 允许。


推荐阅读