使用信用卡详细信息创建令牌
token_response = stripe.Token.create(
card={
"number": card_number,
"exp_month": card_expiry_month,
"exp_year": card_expiry_year,
"cvc": security_code,
# adding optional data
"address_line1": billing_address_1,
"address_line2": billing_address_2,
"address_city": billing_city,
"address_state": billing_state,
"address_zip": billing_zip_code,
"name": card_holder_name
},
)
创建客户并将其与上述令牌关联
stripe.Customer.create(
name=card_holder_name, description=" description",
email=email, source=token_response['id']
)
使用设置模式进行会话结帐
setup_intent_for_customer = stripe.checkout.Session.create(
payment_method_types=['card'],
mode='setup',
customer=strip_customer_obj['id'],
confirm=True
)
问题是上面只是验证卡号和它的cvc代码,而不是卡持有人姓名、卡到期日期和账单地址,没有从卡中扣除金额。如何在不扣除付款的情况下验证完整的信用卡详细信息?