【问题标题】:Catching API response for insufficient funds from Stripe捕获来自 Stripe 的资金不足的 API 响应
【发布时间】:2016-05-03 04:55:07
【问题描述】:

如果我通过 Stripe API 创建了 Charge 对象,并且卡有效,但收费被拒绝,这会导致什么错误?在测试沙箱中模拟这个错误似乎是不可能的,我希望能够捕获它(并在测试中模拟它),但文档在这一点上并不清楚。

【问题讨论】:

    标签: python stripe-payments


    【解决方案1】:

    这将触发被拒绝的费用,即card_error,可以使用此卡号触发:4000000000000002: Charge will be declined with a card_declined code.

    【讨论】:

    • 谢谢。看起来我忽略了 stripe.com/docs/testing 的 Stripe 文档的测试部分,其中提到了所有特定的响应卡号,这有点令人沮丧,因为这看起来是一个非常有用的资源
    猜你喜欢
    • 2018-08-30
    • 2020-04-14
    • 2014-01-24
    • 1970-01-01
    • 1970-01-01
    • 2021-07-24
    • 1970-01-01
    • 2022-11-28
    • 1970-01-01
    相关资源
    最近更新 更多