#gpratte
1 messages · Page 1 of 1 (latest)
The charge should have a payment_intent property, you can look up the checkout session by that payment intent
But I do have a suggestion of another way to do this
You can set the metadata on the payment intent from the checkout session (note that you have to set it in a different place than the session's metadata) https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
And then you could listen to the payment_intent.payment_failed event, which would have the metadata right in it https://stripe.com/docs/api/events/types#event_types-payment_intent.payment_failed
Oh, great!
Not sure if that makes as much sense for you as the charge event but that could be a viable alternative here