#davidetan_webhooks

1 messages ยท Page 1 of 1 (latest)

foggy orioleBOT
#

๐Ÿ‘‹ 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/1292756954011406407

๐Ÿ“ 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.

cursive python
#

Hi there, your webhook endpoint that listens to charge.refunded event doesn't have an explicit api_version, and it will use your account's default API version (i.e., 2024-09-30.acacia) to render webhook events.

proud cipher
#

Yes, this is what I'm doing on my backend with

\Stripe\Charge::retrieve([
      'id' => $chargeId,
       'expand' => ['refunds'],
]);

And it worked on my first refund.
However, on the second even if I expanded it, there was no refunds field.

#

So, I was wondering if the refund is asynchronous and it might not be ready yet to be retrievend when I receive the charge.refunded webhook.

#

Indeed, if I now retrieve the charge with the CLI and expand it with -e refunds I get the refunds list.
And I'm almost sure I will have it in my webhook too, If I resend the event.

However, I'd like to know if it is guaranteed or not that the refunds field is there when I retrieved by using an API call, in my charge.refunded webhook.
Or I have to wait for another webhook. charge.refund.updated maybe?

robust pulsar
#

AFAIK it should be present and is not async

proud cipher
#

So, something odd happened ๐Ÿค”

I'll wait for another refund and see what happened. The very same code worked for the first refund, so there has to be something that'll lead to that field missing.

robust pulsar
#

if your actual code is like this :

\Stripe\Charge::retrieve($chargeId, [
       'expand' => ['refunds'],
]);

then the expand does not work, that's one possibility and a common quirk people run into.

#

other than that I don't know really, it's hard to debug since we have no way to see what was sent in response to a GET request, always possible there was some blip/issue but that would require a deeper investigation