自动订阅收费时,如果没有足够的资金会出错
When subscribing charge automatically and get error if there are not enough funds
为了解决订阅自动收费的问题,我在创建订阅时使用了这两个属性:
**collection_method**: 'charge_automatically',
**billing_cycle_anchor**: 'now'.
现在的问题是,我想在没有足够的资金收取时立即收到错误消息,但我遇到错误消息的唯一方法是使用 webhook 获取 invoice.payment_failed。但这并不能解决我的问题。
有什么方法可以在订阅或创建付款方式后得到错误吗?
听起来您可能想要 set payment_behavior
to error_if_incomplete
when creating the Subscription。
Use error_if_incomplete
if you want Stripe to return an HTTP 402 status code if a subscription’s first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the changelog to learn more.
注意有关 3D Secure 和 SCA 的警告!
为了解决订阅自动收费的问题,我在创建订阅时使用了这两个属性:
**collection_method**: 'charge_automatically',
**billing_cycle_anchor**: 'now'.
现在的问题是,我想在没有足够的资金收取时立即收到错误消息,但我遇到错误消息的唯一方法是使用 webhook 获取 invoice.payment_failed。但这并不能解决我的问题。
有什么方法可以在订阅或创建付款方式后得到错误吗?
听起来您可能想要 set payment_behavior
to error_if_incomplete
when creating the Subscription。
Use
error_if_incomplete
if you want Stripe to return an HTTP 402 status code if a subscription’s first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the changelog to learn more.
注意有关 3D Secure 和 SCA 的警告!