#nacho_446

1 messages · Page 1 of 1 (latest)

pliant hollyBOT
granite wind
#

Hello

#

Yeah you are going to need logic in your Webhook handler to ingest this data correctly.

#

You will want to know whether it is the initial Invoice or a renewal Invoice

stoic spindle
#

I have a question does the webhook send the data to each event one by one or at once

granite wind
#

I'm not sure what you mean by that exactly. A Webhook contains an Event as the data. A Webhook endpoint will receive a Webhook for every Event of the types that it is listening for.

stoic spindle
#

I listen for the checkout.session.completed and invoice.paid

My problem is if the checkout.session.completed runs first before the invoice.paid

#

Or should I put the invoice.paid first so when it checks if the payment is not successful if goes to the next event type

granite wind
#

So you will always want to be resilient.

#

What you want to determine is which Event you are going to use to ingest the data into your database

#

Then you write code to filter the other Event so that you don't ingest it when you don't want it