#Ox IronReturn-webhook-events
1 messages ยท Page 1 of 1 (latest)
Gotcha, so inside of each event object that we send, there will be a field named data which contains another object. For the checkout.session.async_payment_succeeded event this object will be a checkout session, and for payment_intent.succeeded events it will be a payment intent.
https://stripe.com/docs/api/events/object#event_object-data
You can look at the structure of those objects to determine how to get the desired information from them.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Customer is pretty simple to retrieve from either of those objects, but product is a bit trickier.
You'll need to get product from the checkout session, and to that you'll have to retrieve the checkout session object with expansion to get to that information as it resides inside of the line_items array.
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price-product
https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Do you know GoLang ?
Bcs I receive data on https://stripe.com/docs/api/events/object#event_object-data when I buy stuff but I receive any data on my /webhook route in golang
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Sorry, I'm not familiar with Go.
Ok, no problem, thx for help !