#s-mert-ztrk_best-practices
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/1273923093739475047
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
post-transaction record and my webhook record
I strongly recommend you to perform business logic based exclusively on webhook notifications.
Otherwise the customer might close the browser window before you finish recording the information and you risk loosing it.
I record the transaction on both sides to prevent loss.
If I only perform my operations via webhook, I will not be able to display instant information.
For example, when a customer returns from payment, I record the return so that I can show the "your payment was successful" screen.
However, since information is also sent to the webhook during this time, double-recording problems sometimes occur.
display instant information
You can use the PaymentIntent/Checkout Session ID to fetch the results of the payment on-session. However, you should not perform any business logic there.
It's not designed to be used in such a way, which is why you're running into conflicts.
You have to design your post-payment page in such a way that acknowledges that the payment outcome arrives asynchronously via webhook. This is the best practice.