保存卡以备将来付款时是否可以使用 3D Secure?
我使用PaymentIntents
的是创建客户然后付款:
customer = stripe.Customer.create(
payment = stripe.PaymentIntent.create(customer=customer_id, ....
付款时,您有卡类型payment['charges']['data'][0]['payment_method_details']['card']['brand']
和卡的最后 4 位数字payment['charges']['data'][0]['payment_method_details']['card']['last4']
您可以在本地存储customer_id
、卡类型和最后 4 位数字,以便下次向该客户展示。要进行另一笔付款,您只需使用stripe.PaymentIntent.create()
您customer.id
第一次保存的。如果客户想使用另一张卡就行
customer = stripe.Customer.modify(
customer_id,
source=token_id
)
token_id
来自你前端的 stripe.js