#whisky_webhooks

1 messages ¡ Page 1 of 1 (latest)

sick torrentBOT
#

👋 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/1319632464938795089

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

tame jewel
#

hi there!

#

both work, but we recommend using payment_intent.succeed

granite flume
#

The thing is, on payment_intent.succeed, i let my app to create an order, but its async so charge.succeed could fire even before the order has been created, so if I try to attach the receipt_url to my order record in the db, the order can sometimes still in the process of creation and I can't attach the receipt. I've thought about doing a crone job, but idk.

Why do you recommend using payment_intent.succeed?

tame jewel
#

when you receive payment_intent.succeed, it means the payment is successful. so you shouble be able to retrieve the receipt_url directly.

#

just make an extra API call in your webhook endpoint to retrieve the Charge object associated with the PaymentIntent

granite flume
#

can you point me to which endpoint I need to call to retrieve the charge object?

tame jewel
sick torrentBOT
granite flume
#

Alright, thanks. I will try it now and get back with my result.