#Jerry Jose
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
https://stripe.com/docs/api/events/types#event_types-checkout.session.completed
Occurs when a Checkout Session has been successfully completed.
https://stripe.com/docs/api/events/types#event_types-checkout.session.async_payment_failed
Occurs when a payment intent using a delayed payment method fails. (e.g. bank transfers etc.)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thank you, can you please let me know which events are suitable for payment success and failure ?
are you using Checkout Sessions?
yes
then you can use checkout.session.completed for the Checkout Sessions that have been successfully completed
if you wish to find out if a payment attempt failed you can listen to https://stripe.com/docs/api/events/types#event_types-payment_intent.payment_failed
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok then can we get session id in payment_intent.payment_failed event?
not directly but you can list the Checkout Sessions with that PaymentIntent Id https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-payment_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you will get 0 or 1 results in the data array
Nice, Thank you