#Thnks_CJ - event data
1 messages · Page 1 of 1 (latest)
I'm trying to get the email and name from the payment
What Stripe product are you currently using to charge your users? Checkout? Your own page with Stripe Elements?
So you are listening to the checkout.session.completed event?
Yes
The Checkout Session will have a customer property, if you retrieve the customer with that ID, that should have the email that your user put in to the Checkout form https://stripe.com/docs/api/customers/object#customer_object-email
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
how do i properly access the data thoughon the docs it tells you the strings but not how to get them
What strings are you having trouble finding?
i have the event but what i dont udnerstand is how after this i get the strings
At this point in your code, you have an event object of some sort, correct?
Like that switch statement is on something like event.type?
If you check event.data.object there should be a Checkout Session object. So you initially have access to all of this data https://stripe.com/docs/api/checkout/sessions/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So the customer ID that I mentioned (cus_123) will be at event.data.object.customer
so for the email i would use event.data.object.email?
I don't think so, that email is set when creating the Checkout Session. I don't think it will be filled out with whatever the customer specifies in our form
I found it event.data.object.customer_details.email Thank you for your help
Even better, nice find!
1 last thing is there PayPal support?
For Checkout? I don't think so at the moment.