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

如何用Stripe CLI为特定测试客户触发订阅续费失败Webhook事件?

解决Stripe CLI触发invoice.payment_failed事件时的403错误

你遇到的403错误是因为误用了--stripe-account参数——这个参数仅针对Stripe Connect平台场景(用于指定平台下的子账户ID),而你没有使用Connect,完全不需要添加这个参数。

正确的触发方式:

  1. 无需指定特定客户:直接运行基础命令,Stripe CLI会自动生成测试用的客户、订阅及支付失败场景:

    stripe trigger invoice.payment_failed
    
  2. 针对特定测试客户触发:如果要基于你已有的cus_abcdefg客户生成事件,需要用--override参数来覆盖默认值,而非--stripe-account:

    stripe trigger invoice.payment_failed --override customer=cus_abcdefg
    

额外注意:

  • 确保已通过stripe login完成Stripe测试账户的CLI授权配置。
  • 如果你需要更精准的场景(比如指定特定订阅),可以继续添加多个--override参数,例如:
    stripe trigger invoice.payment_failed --override customer=cus_abcdefg --override subscription=sub_xyz123
    

内容的提问来源于stack exchange,提问作者Patrick Kenny

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.20 05:05:46