#dantheman

1 messages ยท Page 1 of 1 (latest)

lavish craneBOT
winged stirrup
#

that event only fires for the first payment on a subscription. For each subsequent payment you should listen for the invoice.paid event

inland orchid
#

ok and is invoice.paid on all invoices

#

including subscriptions?

winged stirrup
#

Yes. Each Subscription will have an Invoice which must be paid for the subscription to remain active

inland orchid
winged stirrup
#

invoice.payment_succeeded could fire for partial payments and also wouldn't capture any out-of-band payments. invoice.paid will fire if the invoice is paid in full

inland orchid
#

oh is there a subscription in the object?

winged stirrup
inland orchid
winged stirrup
winged stirrup
#

Of course!

inland orchid
#

cause i saw somewhere that its never guarenteed

winged stirrup
#

The ordering is never guaranteed, that's correct

inland orchid
winged stirrup
#

You could always build in a sleep statement to the checkout.session.completed webhook handler in order to guarantee that your system actions invoice.paid first. That's one idea for simplifying, but obvs it may not work for your use-case

inland orchid
winged stirrup
#

Yeah, it's not ideal as a the long-term solution. Anyway, best of luck! Let us know if we can help some more