[英]Testing - set declined card to a customer
我想用拒绝的卡更新客户以进行测试。
但是如果我这样做:
Stripe.customers.update(stripeCustomer.id, {
source: 'tok_chargeDeclined', // Token provided by stripe of a declined card
});
我有一个例外:
调用方法'stripe.test'时发生异常{错误:您的卡被拒。
我缺少什么?
当您将卡连接到客户时(例如,通过该更新呼叫),Stripe会对卡临时收取$ 0的费用,以进行验证并确保以后可以成功向客户收费。 在https://stripe.com/docs/saving-cards#saving-credit-card-details-for-later中提到了这一点。
当您附加tok_chargeDeclined
,此费用将被拒绝,并且不会将卡添加到客户。 要测试卡可以成功添加到客户但又被拒绝的情况(即,如果它以后过期或没有资金),可以使用https://stripe.com/docs/testing#cards上的tok_chargeCustomerFail
卡-responses
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.