#Marc
1 messages · Page 1 of 1 (latest)
Those 3 will always occur on a successful payment. How are you planning to accept payments? Are you going to use Checkout? Payment Element? Or a custom payment form?
I am using Checkout
Okay, so you aren't actually seeing the best event to listen to in this list of events. If you're using Checkout, the best even to listen for upon success is checkout.session.completed : https://stripe.com/docs/api/events/types?event_types-payment_intent.payment_failed#event_types-checkout.session.completed
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Since you're not taking any delayed payment methods, that event will only fire if funds reach your account (e.g. a payment is successful)
checkout.session.completed is above the ones I screenshotted. So it will not trigger before payment succeeded ? That is great
The order of events may change, so I wouldn't build anything that relies on the ordering, as that would likely create race conditions
If checkout.session.completed is only triggered after successful payment, that is all I need. Did I understand it correctly? That is the case ?
Also , if I am not mistaken: For a renewing subscription I will listen to Invoice.Paid correct ?
Yup! You understood correctly.
For a renewing subscription I will listen to Invoice.Paid correct ?
It depends on why you're listening. What info/action are you wanting to get out of a renewing subscription?
I just want to update the ValidDate on the Licenses in my database if the next period is paid for. If payment failed, I want to set the license to inactive.
Ah! Okay, then yes invoice.paid is the event you'd want to listen for for all subsequent payments