#marcin_best-practices

1 messages ¡ Page 1 of 1 (latest)

final quailBOT
#

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

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

humble rampart
robust vale
#

I need to use sdk v79 which does not have refund.failed. Will change from pending->failed trigger refund.updated webhook?

humble rampart
robust vale
#

a refund can appear to succeed and later fail, or can appear as pending at first and later succeed
^ quote from doc you've sent.
pending -> failed/succeed seems obvious, but what's the best practice to handle succeed->failed?

I need to maintain an internal state of a payment and notify other services if there is a successful/failed refund.

Then, should I ignore the refund status that API returns on refund create, treat refund as pending and always listen for either refund.updated or charge.refunded webhook?

humble rampart
#

Yeah I'd listen for refund webhook events and update the internal state accordingly rather than polling refunds API for the status

#

Since the failure is async, you'd want to rely on webhook events as source of truth

robust vale
#

Thanks a lot