#aksay-23298_code
1 messages ¡ Page 1 of 1 (latest)
đ 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.
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
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?
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
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?
and is there any way to do this as it would allow us to process everyhting asynchronously
With checkout.session.completed you can assume the transaction has been completed
Sorry not really following the other question
oh okay that makes sense
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?
https://docs.stripe.com/api/payment-link/create#create_payment_link-metadata for creating with API
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But from Dashboard there is only the client_reference_id as you observed