请求协助:Stripe Google Pay集成挂载Express Checkout Element报错
Stripe Google Pay集成报错:无法下载支付清单"https://www.google.com/pay"
我正在使用Express Checkout Element进行Stripe Google Pay集成,挂载元素时出现错误:unable to download payment manifest "https://www.google.com/pay"。我已遵循Stripe官方文档编写代码,代码如下:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Google Pay Integration</title> <script src="https://js.stripe.com/v3/"></script> </head> <div id="express-checkout-element"> <!-- Express Checkout Element will be inserted here --> </div> <div id="error-message"> <!-- Display error message to your customers here --> </div> <script> const stripe = Stripe('pk_test_.....................'); const options = { mode: 'payment', amount: 1099, currency: 'usd', appearance: {/*...*/}, }; const elements = stripe.elements(options); const expressCheckoutElement = elements.create('expressCheckout'); expressCheckoutElement.mount('#express-checkout-element'); </script> </body> </html>
排查与解决建议
- 网络访问验证:该错误核心是无法获取Google Pay的清单文件,先确认你的开发/生产环境能正常访问
https://www.google.com/pay,国内环境可能需要调整网络配置。 - Stripe账号配置检查:登录Stripe Dashboard,确认已启用Google Pay支付方式,且商家信息、支持货币等配置符合要求。
- HTTPS环境要求:Google Pay强制要求生产环境使用HTTPS,本地localhost开发环境可豁免,若为生产站点需确保已配置有效SSL证书。
- 更新Stripe.js:尝试替换为最新版本的Stripe.js脚本,避免旧版本的兼容性问题。
- 生产环境商家ID配置:如果是正式生产环境,需在Stripe Dashboard中绑定Google Pay商家ID,并确保该ID与你的域名关联匹配。
内容的提问来源于stack exchange,提问作者Sainita Mukherjee
相关产品推荐
相关产品推荐

