我想使用条纹卡反复收费,每30天与数额,示范性。
从文档中我得到,如果卡需要3DS的可能性,我们应该使用源,所以我切换到源;)
从stripe.js检索的源对象中,我查看three_d_secure param,以决定是创建一个需要3DS的源对象还是普通的卡充电。
流动:
使用JS,我获得了将three_d_secure设置为可选或必需的源对象。在我检索具有:source = Stripe::Source.retrieve(source_id)的源之后,当它设置为可选时,如下所示:
"status": "chargeable",
"type": "card",
"usage": "reusable",
"card":{"exp_month":12,"exp_year":2032,"brand":"Visa",...我把它附在一位顾客身上并收取费用。我想usage: reusable意味着我以后可以再给卡充电.
当three_d_secure=='required'创建一个新的source时,调用如下:
source = Stripe::Source.create({
amount: amount,
currency: currency,
type: 'three_d_secure',
three_d_secure: {
card: source_id, #src_xcvxcvxcvc
},
redirect: {
return_url: return_url
},
})我将用户重定向到user提供的,用户输入他的3 Stripe并返回到我的return_url。当Stripe将用户重定向回我的return_url时,我再次检索源并得到如下内容:
"status": "chargeable", "type": "three_d_secure", "usage": "single_use", "three_d_secure": {"card":"src_1B1JzQHopXUl9h9Iwk05JV1z","authenticated":true,"customer":null}
我希望在传递3DS之后,源将变得可重用,并且可以充电,直到到期日期:
我的问题是:
1为什么3DS源single_use?这是像这样,只有在砂箱环境或与卡,我正在使用的测试?
2一张3DS保护卡能再次充电吗?
什么是正确的方法来附加到客户来源(3DS或正常),可以一次又一次收费?
谢谢!
发布于 2017-09-12 22:25:39
source payment token,而不是source card token。它在到期日或消费时间到期。您可以使用reusable令牌创建single_use令牌。reusable one表示card source tokenoptional或not_supported,如果是required,则不是。如果是required,那么每个付款都需要实现一个3ds。- Create an `src_card_token` for a card or use saved one (`reusable`)
- Create an `customer object` with an src from `src_card_token`
- Create an `src_payment_token` for a customer using one of his saved cards (as token)
- fullfil a 3ds redirect process if required.
- create a charge
https://stackoverflow.com/questions/46184254
复制相似问题