#Andora
1 messages · Page 1 of 1 (latest)
hello! Such situations can occur and you would probably want to retrieve the object then write to your DB in such a situation. See https://stripe.com/docs/webhooks/best-practices#event-ordering
I'm already trying to retrieve from my database when receiving event.update but its cannot find it since the event is called right away after invoice.created
So even though it has been inserted when receiving invoice.created its not yet inserted
to clarify, when i say retrieve the object - i meant make a request to Stripe to retrieve the object
you would want to queue up your events to be processed
I think I didn't explain my issue well.
My issue is retrieving the instance of invoice from my database because it was inserted during the invoice.created event but isn't yet inserted when receiving the invoice.updated event. My issue is more about my own instances from my database and link them with stripe instances properly
I do receive invoice.paid after invoice.created
But it does not help because when I'm trying to find the invoice in my own database when receiving invoice.paid to update the status it hasn't been yet inserted
one option which I can think of is that you should process your events in a queue i.e. only after one is done, then process another one.