You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

启用Stripe自动税后,Safari中Apple Pay按钮不显示问题排查

Stripe Payment Request Button(Apple/Google Pay)不显示问题排查与解决

问题背景

集成Stripe Payment Request Button实现Apple Pay和Google Pay时,Safari中Apple Pay按钮始终不显示,所有基础配置均已完成,但paymentRequest.canMakePayment()返回null,导致按钮被Stripe自动隐藏。

已完成的基础配置:

  • Stripe控制台已启用Apple Pay
  • 域名完成验证
  • 网站通过HTTPS部署
  • Safari已绑定有效Apple Wallet卡片
  • Stripe Elements及常规卡片支付功能正常
  • 浏览器控制台无报错

核心诱因排查

当后端创建PaymentIntent或Subscription时启用Stripe自动税(automatic_tax.enabled = true),会触发以下问题:

  • Apple Pay、Google Pay按钮均不显示
  • paymentRequest.canMakePayment()返回null

解决方案

即使售卖数字产品无需实际配送,仍需在Payment Request配置中添加requestShipping和shippingOptions字段,示例代码如下:

paymentRequest = stripe.paymentRequest({
  country: "US",
  currency: "usd",
  total: {
    label: `Lempa - ${plan.plan}`,
    amount: finalAmount,
  },
  requestPayerName: true,
  requestPayerEmail: true,
  // 新增配送相关配置
  requestShipping: true,
  shippingOptions: [
    { id: "none", label: "Digital Delivery (No Shipping Required)", amount: 0 },
  ]
});

添加配置后,paymentRequest.canMakePayment()会返回有效对象,Apple Pay按钮即可正常显示。

原因分析

启用Stripe自动税后,系统会强制要求提供配送相关配置(即使是数字产品场景),否则Payment Request无法通过校验,最终返回null并隐藏支付按钮。


内容的提问来源于stack exchange,提问作者Ronik JemsSoft

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.11 21:42:10