#Marc

1 messages · Page 1 of 1 (latest)

frail mirageBOT
median lava
#

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?

still wind
#

I am using Checkout

median lava
#

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

#

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)

still wind
#

checkout.session.completed is above the ones I screenshotted. So it will not trigger before payment succeeded ? That is great

median lava
#

The order of events may change, so I wouldn't build anything that relies on the ordering, as that would likely create race conditions

still wind
#

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 ?

median lava
#

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?

still wind
#

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.

median lava
#

Ah! Okay, then yes invoice.paid is the event you'd want to listen for for all subsequent payments