如何允许客户在 Stripe 客户门户中的现有订阅上应用促销代码?

Dai*_*ius 1 stripe-payments stripe-customer-portal

在 Stripe 客户门户设置中,我设置了“允许客户应用促销代码”,但是当我打开客户门户时,我找不到可以添加促销代码的任何地方。我可以取消订阅、更新付款方式或在设置中配置的客户数据,但不能取消促销代码。有什么特别的事情需要做吗?在生产中,我们通过特殊的 BillingPortalSession(stripe api)打开它,但我也检查了 stripe 自身生成的链接。

计费门户配置功能如下所示:

"features": {
"customer_update": {
  "allowed_updates": [
    "email",
    "address",
    "phone"
  ],
  "enabled": true
},
"invoice_history": {
  "enabled": true
},
"payment_method_update": {
  "enabled": true
},
"subscription_cancel": {
  "cancellation_reason": {
    "enabled": true,
    "options": [
      "too_expensive",
      "missing_features",
      "switched_service",
      "unused",
      "other",
      "customer_service",
      "too_complex"
    ]
  },
  "enabled": true,
  "mode": "at_period_end",
  "proration_behavior": "none"
},
"subscription_pause": {
  "enabled": false
},
"subscription_update": {
  "default_allowed_updates": [
    "price",
    "promotion_code"
  ],
  "enabled": true,
  "proration_behavior": "create_prorations"
}
Run Code Online (Sandbox Code Playgroud)

小智 5

如果您在帐户上使用默认门户配置,请务必仔细检查仪表板设置中是否启用了“允许客户应用促销代码”设置[1]。

如果您使用 API 定义计费门户配置,请务必检查该配置promotion_code是否包含在您的门户features.subscription_update.default_allowed_updates列表中[2]。

如果这些似乎都不适合您,您可以通过访问 Stripe 的 Discord Server[3] 或写信给他们的支持团队[4]来获得帮助。如果您转到其中之一,请确保拥有您创建客户门户会话时的示例请求 ID[5],但没有看到您期望的行为。


[1] https://dashboard.stripe.com/test/settings/billing/portal

[2] https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-default_allowed_updates

[3] https://stripe.com/go/developer-chat

[4] https://support.stripe.com/?contact=true

[5] https://stripe.com/docs/api/request_ids