#aksay-23298_code

1 messages ¡ Page 1 of 1 (latest)

orchid cloakBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1280747322061492270

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

foggy wedge
#

Yeah it's a common ask and we can't guarantee the orders of events incoming at almost same time. Even if we try to, the internet can totally mess up the order

#

You would want to build your system in an async way that doesn't depend on the order

#

ie you try to do everything once receiving the customer id on checkout.session.completed

#

The issue here is you are expecting a sync sequence operate based on an async set of events

gusty grotto
#

how can i switch this to an async set of events, since im only getting the user id in the checkout.session.completed?

#

is there any way i can set that as metadata through the payment link?

foggy wedge
#

It's an async set of events, means there isn't guarantee of order

#

So when you receive the user id on checkout.session.completed you do both 1) Save to your database 2) Do the logic you want as if you are processing invoice.paid

gusty grotto
#

wouldnt that assume that the payment has been processed? or should i update the invoice.paid to switch to active only if the webhook has received a response for that particular subscription id?

gusty grotto
foggy wedge
#

With checkout.session.completed you can assume the transaction has been completed

#

Sorry not really following the other question

gusty grotto
# foggy wedge Sorry not really following the other question

is there a way i can set metadata with payment links when we redirect the user to the checkout page? As in when they visit the https://buy.stripe.com/ can i store the url parameters as metadata for that specific customer?

Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes. Accept payments, send payouts, and automate financial processes with a suite of APIs and no-code tools.

foggy wedge
#

But from Dashboard there is only the client_reference_id as you observed