#cavani-pi-charge-events
1 messages · Page 1 of 1 (latest)
When using Payment Intents you can likely expect both charge.succeeded & payment_intent.succeeded events for successful payments
They're 2 different objects, although very closely related in the Stripe system. For example, a Payment Intent can have many Charge objects: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-charges
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Think of the Payment Intent of a state machine that facilitates the actual payment (the Charge)
So payment intent can have many charge objects but only one successful charge right?
And so when the payment intent gets the successful charge the charge.succeeded event also gets fired?
Basically my app currently used payment intents however for the webhook it listens for charge.succeeded to process the order application side. I’m just thinking whether charge.succeeded is as reliable as payment_intent.succeeded in deciding whether to fulfil the order application side.
Exactly, yes. There may be a Charge attempt that failed due to insufficient funds for example. You can re-attempt the payment on the Payment Intent, and get a successful Charge
Awesome. Thanks for clearing that up. I understand now. Love to see such a greatly designed API by stripe.
My general recommendation would be to use payment_intent.succeeded and that's echoed throughout our documentation
For example, here: https://stripe.com/docs/payments/handling-payment-events
Yes I saw this in the documentation yesterday which is what brought up this question.
Thanks for your help, appreciate it!
charge.succeeded is likely more useful for legacy implementation who aren't yet using Payment Intents
I see, well I think that’s why I’m using charge.succeeded. The webhook has been the same from before, just the payment intent support was added into the apps
Let me know if I can help with anything else 🙂