#lou_alcala - Charge billing info
1 messages · Page 1 of 1 (latest)
sure, I want to pass: city, country, address and postal code to the charge
I'm using stripe.Charge.create
Okay do you have a request ID for a failed request?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
not really, I'm just trying to send that data
Okay but when you attempt to send the data it creates a request in your account logs. You should be able to find that log
I'm using the SDK with Python BTW
The logging is universal. Any API request will be logged in your account.
actually, I did not try to send that data yet, bc there is not example about it
and I'm not sure how to pass the billing info to the charge
I'm also trying to pass the card holder name, but I'm not sure if I can pass this to the charge or should I pass it to the customer
The available parameters are documented here: https://stripe.com/docs/api/charges/create
yeah I saw that, but in the charge object the billing_details is present
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Billing details live on the Payment Method object :https://stripe.com/docs/api/payment_methods/create
If you have Customer object with linked Payment Methods associated with your charge, you can get all of that data by expanding the Customer and the Sources from the Charge
Okk, it looks like I have to change my current logic, I was creating a stripe.createToken via JS and then passing that token to the backend to create the customer and create the charge
but it looks like I have to create a paymentMethod first
Yeah, Tokens is a VERY old API. Payment Methods are much more flexible.
cool, thanks
Try walking through this integration: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements