#nollix_checkout-webhook-events
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/1442939054093111337
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- nollix_webhooks, 28 minutes ago, 12 messages
hello again! this specific question is answered in our docs here
When you have a webhook endpoint set up to listen for checkout.session.completed events and you set a success_url, Checkout waits up to 10 seconds for your server to respond to the webhook event delivery before redirecting your customer.
if you don't have a webhook listening for the checkout.session.completed event then the redirect happens independently of the event
I have a webhook listening for the checkout.session.completed so the system should wait up to 10 seconds in the host page of Stripe. SO I can assume after 10 seconds that the system will redirect me through the success_url but at this point I have to check by myself if the session or the payment is completed, right?
I'm focusing on these details because I have to update the database only if the payment is confirmed. I can't just rely on the webhook because it could delay or has problems and I can't just rely on the client side using the success_url because the connection could be interrupted (example). So I'm trying to understand deeply this mechanism because I need to update the database when the client pays and I want to have a "B plan" if the other method fails.
Hi there,
taking over for my colleague who had to step away.
Yes you are basically correct. The checkout.session.completed event gets triggered when the checkout session completes. That event is not related to the payment coming from the checkout session. You would learn about the success of the payment, when you listen to payment_intent.succeeded or checkout.session.async_payment_succeeded
So are you telling me that when the client is redirect through success_url I can NOT assume that the payment is successed? (if I don't consider the fact the checkout waits up to 10 secs if I have a webhook...)
I understood that I should listen payment_intent.succeeded or checkout.session.async_payment_succeeded but I don't want activate another webhook because I need another reliable methods in case of problems with webhooks. Is there another way to be sure that the payment is succeeded?
I don't even want to keep making requests through API because there are limits.
I just need a reliable way to be sure that the client paid when he/she clicked on button "Pay". In my opinion the webhooks aren't reliable because they could fail and after the payment I have update immediately the database.
when the client is redirect through success_url I can NOT assume that the payment is successed?
Correct. Especially for async payment methods, a checkout session can be completed, but the payment is still pending.
If you don't want to use webhook events, the only other way would technically be to poll the API, but that would mean a lot of traiffc and API calls and we discourage that where possible
Just some other doubts:
- Do the majority of your clients rely on webhooks? Also for critical operation
- From my experience I noticed that usually the chain of event is as follows: payment_intent.created (initial step) -> charge.succeeded -> payment_intent.succeeded -> checkout.session.completed (final step)
- Do the majority of your clients rely on webhooks? Also for critical operation
Yes, and we actively recommend this approach
- From my experience I noticed that usually the chain of event is as follows: payment_intent.created (initial step) -> charge.succeeded -> payment_intent.succeeded -> checkout.session.completed (final step)
Yes, in most cases this all happens in a matter of seconds, so everything (Payment Intent, Charge, Checkout Session) complete successfully while the customer gets re-directed. But there is no guarantee that the payment succeeded when the customer gets redirected. For make sure the payment is paid, we recommend also listening to the respective webhook events.
Also the order in which the events get emitted is not guaranteed or gives information about the order of the actual events. You can have the same flow where you receive the payment_intent.succeeded event before the charge.succeeded or the checkout.session.completed first. We do not guarantee the order.
nollix_checkout-webhook-events