我想用被拒绝的卡更新客户,以便进行测试。
但如果我这么做了:
Stripe.customers.update(stripeCustomer.id, { source: 'tok_chargeDeclined', // Token provided by stripe of a declined card });
我有个例外:
拒绝。
https://stripe.com/docs/saving-cards#saving-credit-card-details-for-later .
当你附加 tok_chargeDeclined ,此费用将被拒绝,并且卡不会添加到客户。要测试一张卡可以成功地添加到客户中,但后来被拒绝(即,如果该卡稍后过期或没有资金),可以使用 tok_chargeCustomerFail https://stripe.com/docs/testing#cards-responses
tok_chargeDeclined
tok_chargeCustomerFail