#9527xiaobei_webhooks

1 messages · Page 1 of 1 (latest)

smoky trenchBOT
#

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

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

jaunty herald
#

hi ?

#

anyone there ?

coarse topazBOT
rich grotto
#

hi there!

#

why did you expect to receive a charge.refund.updated exactly?

#

you mean the status of the charge changed, but you didn't get the event?

jaunty herald
#

Because successful or failed refunds can be processed through the charge.refund.updated event

#

There is no information about refund in charge.refunded, which is very confusing.

rich grotto
#

they can, yes. but many refunds will never be updated, and in this case we won't send the charge.refund.updated event.

jaunty herald
#

Yes, I have a refund I didn’t receive charge.refund.updated

rich grotto
#

like the refund you shared had status: succeeded when you created it. and it's still succeeded. so nothing was updated, which means no charge.refund.updated event was sent (as expected)

jaunty herald
#

re_3OyxwPH6KGNmuPs61iWY9pfT Why was this refund sent?
charge.refund.updated

#

This refund was first sent charge.refunded event and then
charge.refund.updated event

rich grotto
#

not sure, having a look

jaunty herald
#

This refund is full, and the previous price difference refund is partial.

#

I'm not sure if it's because of this

#

But when I am in test mode, partial refund will also send charge.refund.updated

#

In test mode, the refund ID is: re_3Oz8c3H6KGNmuPs60yDH5NUs. This refund is sent with charge.refund.updated event.

rich grotto
#

there you can see in the previous_attributes what exactly changed that triggered that event

#

for re_3Oyv9TH6KGNmuPs600y3nWew, nothing changed, so there's no charge.refund.updated. to me that looks expected.

jaunty herald
#

Refund ID: re_3OyxwPH6KGNmuPs61iWY9pfT

coarse topazBOT
jaunty herald
#

@rain caveHi

rain cave
#

Hi there

#

Looking

jaunty herald
#

OK

rain cave
#

Okie so evt_3OyxwPH6KGNmuPs61KiKStQj is the only event for re_3OyxwPH6KGNmuPs61iWY9pfT, it was fired after the refund was created

#

That's what I see

jaunty herald
#

No, there is a charge.refunded event for this refund: "evt_3OyxwPH6KGNmuPs61w7rYaI5"

#

There is another question, why is there no refund ID in the charge.refunded event? How should I handle my refund based on this incident?

rain cave
#

why is there no refund ID in the charge.refunded event
Because that's a Charge object. In contrast to charge.refund.updated which is a Refund object

#

And yes there were 2 events, sorry. Each of them returns different objects here

jaunty herald
#

OK, so if some refunds do not send the charge.refund.updated event, how should I handle the refund? How to find out which refund is due

#

I received the charge.refunded event before. At that time, there was a refund object in the object. I don’t know if the Stripe version has been updated.

#

Or do you need to add something extra?

rain cave
#

Hmm I am a bit confused. On the example above we have both charge.refunded and charge.refund.updated. Are you referring to some other scenario where you didn't receive charge.refund.updated?

jaunty herald
#

Yes, I have a refund that I didn't receive in the charge.refund.updated event

#

Refund ID: re_3Oyv9TH6KGNmuPs600y3nWew

rain cave
#

Hmm that's like no events at all?

jaunty herald
#

No, the charge.refunded event is sent, but there is no refund ID in this event, and my system cannot process the refund.

rain cave
jaunty herald
#

I think this is not a best practice. The refund ID should be returned in the refund event.

rain cave
#

yeah I agree there should be a charge.refund.updated but not sure why it wasn't fired. Just as a backup, can you try the API above?

jaunty herald
#

By the way, this is a partial refund

#

Is it because of a partial refund that charge.refund.updated will not be sent?

rain cave
#

Hmm

#

Do you notice the same pattern for every partial refund?

jaunty herald
#

You can see this screenshot, there is only charge.refunded event, no charge.refund.updated

jaunty herald
rain cave
#

Do you mean you receive and not receiving charge.refund.updated differently on Test mode vs Live mode, for partial refund?

#

Let's take a step back and list down what we know

jaunty herald
#

Yes, in test mode, partial refunds are also received charge.refund.updated

#

Look this

#

Stripe background shows that 2 events were sent, which is a partial refund.

hearty berry
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

jaunty herald
#

OK

hearty berry
#

Could you briefly summarise the latest question for me please?

jaunty herald
#

OK

#

I did not receive the charge.refund.updated event for a refund. The refund ID was: re_3Oyv9TH6KGNmuPs600y3nWew. Only the charge.refunded event was sent. All other refunds received charge.refund.updated.

#

This is the one in the screenshot. You can see that Stripe only sent the charge.refunded event.

#

Is there some exception in Stripe that caused it not to be sent?

hearty berry
#

We are not aware of one, let me check...

jaunty herald
#

OK

#

I just made another partial refund, but I didn’t receive charge.refund.updated. It seems that charge.refund.updated will not be sent for partial refunds?

hearty berry
#

Could you please paste the PaymentIntent ID here?

jaunty herald
#

pi_3OzErqH6KGNmuPs60g8a4ktK

coarse topazBOT
stiff knoll
#

To clarify, a charge.refund.updated is not always sent

jaunty herald
#

Why

#

There is no refund object in the charge.refunded event. How to handle the refund callback?

stiff knoll
#

Sent when the refund is updated. Updates include adding metadata, refunds failing, and providing details like the ARN as a reference number to trace refunds.
I'd guess in the example you shared where you receive a charge.refund.updated event the status field transitions pending -> succeeded

jaunty herald
#

So because the partial refund succeeds immediately, the updated event will not be sent, right? If it is a full refund, the updated event will be sent

stiff knoll
#

As I said this is likely just a quick in the test mode behaviour

jaunty herald
#

But I refunded it in real mode

#

I do not really get it

stiff knoll
#

Can you share a evt_xxx ID for a charge.refund.updated?

jaunty herald
#

"evt_3OzFYuH6KGNmuPs611diQRtt"

stiff knoll
#

OK, the critical difference is that re_3OzFYuH6KGNmuPs61puoXHW1 was updated to include tracing details so we sent a charge.refund.updated event as per the docs:

Sent when the refund is updated. Updates include adding metadata, refunds failing, and providing details like the ARN as a reference number to trace refunds.

Learn how to cancel or refund a payment.

#

I guess the partial refund wasn't updated to include those tracing details as they weren't provided by the bank/issuer, so we didn't update the refund (and no event)

jaunty herald
#

If so, which event should I listen for to handle the refund?

#

There is no refund ID in the charge.refunded event, so it is troublesome to handle the refund callback.

stiff knoll
stiff knoll