#mikemod-webhooks

1 messages ยท Page 1 of 1 (latest)

frail lindenBOT
delicate lance
#

HI ๐Ÿ‘‹

#

What's your question?

steep silo
#

Hello Mikemod, how are you

#

Man, do you have some implementation of webhooks envolving the checkout/subscription flow?

#

I'm listening the events, but there are lot events simultaneously

delicate lance
steep silo
#

Oh ok, i will study that

#

Thank you

delicate lance
#

We emit a lot of related events because different business models care about different things. Ultimately it's up to you to determine which changes you care about and then listen to the events for those changes.

steep silo
#

The biggest problem i have is there are concurrently updates to my entity

#

Because those events come from different places

delicate lance
#

For instance, a single payment of an Invoice will fire invoice.payment_succeeded, payment_intent.payment_succeeded and charge.succeeded.

In that situation it depends what information you want to get from the webhook event. The first one will have an Invoice object, the second a Payment Intent, etc.

#

Okay so you would need to understand what updates you care about and only take action on those

steep silo
#

sometimes, my entity its not correctly updated because these events dont respect any order

#

that is why i ask about some implementation

#

to understand how i can create a correct flow with unorder events

#

but ok, i have new material to study

#

perhaps i resolve my problem

delicate lance
#

Our objects are pretty much all state machines that have specific transitions. Understanding how they transition can help you determine if your stored data entities should be updated.

steep silo
#

My subscription entity is created with certain fields, perhaps it's better if I make all fields optional and let the webhooks take care of it, however, I lose consistency because errors can occur... do you understand? Can you tell me if it would be an appropriate implementation? A subscription created in my database with an optional status, or another field.

delicate lance
#

Unfortunately I cannot give advice on how you should structure your database. That is something you'll need to work out based on your requirements.

steep silo
#

Perfect

#

So thank you a lot my man

#

Appreaciate your time

delicate lance
#

I hope the docs shared help you out

steep silo
#

I will study the links

#

For sure

delicate lance
steep silo
steep silo
#

So, bye!

#

and thank you again

delicate lance
#

๐Ÿ‘‹