#mink4501_webhooks

1 messages · Page 1 of 1 (latest)

lilac minnowBOT
#

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

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

bitter thistleBOT
jovial phoenix
#

hello. When performing a refund while canceling a subscription in the Stripe Dashboard, the deprecated charge.refunded event is sent to the webhook.

How can I ensure that the refund.created event is sent to the webhook?

jade prawn
#

where did you see that charge.refunded is deprecated?

jovial phoenix
#

Is it only Create Charge that has been deprecated?

jade prawn
#

that's the Charges API, it's different. In short, you should not use the Charges API to create payments

#

refund.created is sent when a refund from a customer’s cash balance is created. Stripe only sends this in rare cases. For most use cases, listen for charge.refunded to know when a refund is complete.

jovial phoenix
#

Thank you, then I'd like to repeat my question.

Q1. How can I find out when the refund actually happened in Stripe when the charge.refunded event was sent to the webhook?

#

The created field inside charge doesn't seem to be the correct answer.

jade prawn
#

The charge.refunded event reflects a Charge object. it's pretty unfortunate, but from v2022-11-15 (https://stripe.com/docs/upgrades#2022-11-15), the Charge object no longer auto expands the refunds, so you would probably have to make another request to list all refunds for a particular Charge (https://stripe.com/docs/api/refunds/list#list_refunds-charge) to find the details of a specific refund

Keep track of changes and upgrades to the Stripe API.

jovial phoenix
#

Or, as an alternative, why not use the time the webhook was sent?

jade prawn
#

hrm, that's a pretty good idea too

jovial phoenix
#

I ask this because I'm wondering if the time when the refund is processed in Stripe and the time when the Stripe event is generated is asynchronous, because if it is, there could be quite a time difference in the event of a failure in the Stripe system.