Hola I would like to Add payment details in SetupIntent.create Method.
I would do that with API Using something like this :
import requests
url = "https://api.stripe.com/v1/setup_intents"
params = {
"key": "sk_live_xxxxx",
"payment_method_data[type]": "card",
"confirm": True,
"customer": "cu_xxxx",
"payment_method_data[card][number]": "cc number",
"payment_method_data[card][exp_month]": "exp_mnth",
"payment_method_data[card][exp_year]": "exp_year",
"payment_method_data[card][cvc]": "xxx"
}
response = requests.post(url, params=params).text
print(response)
But How do this with Python Stripe Lib?
I tried this Code :
import stripe
stripe.api_key = "sk_live_xxxxx"
r = stripe.PaymentIntent.create(
payment_method_types=["card"],
customer="cu_xxx",
confirm=True
)
print(r)
But, How will I add payment details in it?
I checked the the docs & it's examples but it only has examples adding payment method types, not payment details like cc number, cvc, expiry month & year.
I want to add customer & attach payment method & charge him. Can anyone help me?
Thank you!