#Ox IronReturn-webhook-events

1 messages ยท Page 1 of 1 (latest)

runic swift
#

Hi there ๐Ÿ‘‹ apologies for the delay, which webhook event(s) are you listening to?

fierce wyvern
#

Hey ! checkout.session.async_payment_succeeded

#

or payment_intent.succeeded

runic swift
#

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.

#

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

fierce wyvern
#

Do you know GoLang ?

runic swift
#

Sorry, I'm not familiar with Go.

fierce wyvern
#

Ok, no problem, thx for help !