#mordiantiable_refund-events

1 messages ¡ Page 1 of 1 (latest)

runic spruceBOT
#

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

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

dawn sparrow
#

Hello! charge.refunded is created when a Refund is created, and charge.refund.updated is created when an existing Refund is updated.

eternal vector
#

Do we always receive a charge.refund.updated event for a refund, or is it possible for a charge.refunded event to have a status === succeeded without ever triggering a charge.refund.updated event?

dawn sparrow
#

The latter. Most commonly you'll only get charge.refunded and never get a charge.refund.updated.

#

The exception to that would be if you added metadata to the Refund. That would also trigger a charge.refund.updated Event.

eternal vector
#

Oh, that make sense. Every time we update the refund, we would get the charge.refund.updated with success, I think (?)

#

This is so helpful @dawn sparrow ! Thank you so much.

dawn sparrow
#

Happy to help!

indigo fossil
#

curious about "The exception to that would be if you added metadata to the Refund. That would also trigger a charge.refund.updated Event." - This would cause charge.refund.updated to fire every time, even if the metadata is added on initial creation?

dawn sparrow
#

No, it would only fire if you add metadata after the Refund was created.

#

If you create a Refund and add metadata during the creation request you'll only get a charge.refunded Event.

#

Basically charge.refunded fires when a Refund is created, and charge.refund.updated fires when an existing Refund is updated. The former is common, the latter is usually rare.

indigo fossil
#

Thanks Rubeus!

dawn sparrow
#

Happy to help!

indigo fossil
#

One more question. Is there a chance that charge.refunded gets called with status: pending?

dawn sparrow
#

Yep.

indigo fossil
#

Can you give an example?

dawn sparrow
#

Usually it's because a Refund is created for an amount your available balance can't cover, so the Refunding is marked as pending until you have enough funds to cover it.

indigo fossil
#

Ok, that makes sense. So let me describe our entire situation to you to see if you agree on our logic:

#

We initiate a reverse payout whenever a refund is successful. It sounds like we want to listen to both charge.refunded and charge.refund.updated and check status:succeeded. Whenever the first one occurs, we kick off the reverse payout. If the other one happens after, we ignore because we already initiated the reverse payout.

dawn sparrow
#

I mean... if a succeeded Refund later fails, what do you want to do with those funds? It sounds like you're not accounting for the refunded amount returning back to your balance?

indigo fossil
#

We would deal with that manually for now. The reason being is because we don't receive an event from Stripe when the funds of the refund arrive to the parents.

dawn sparrow
#

Parents?

indigo fossil
#

We are under the impression that we would only receive a "failed" event if the refund failed on the way to the bank. But we don't receive a "refund didn't make it to the bank even though it was sent successfully" event. Is that correct?

#

Sorry, I meant to say

dawn sparrow
#

No, that's not correct. I recommend you read through the Refunds documentation I linked to above in detail.

indigo fossil
#

But we don't receive a "refund made it to the bank successfully" event. Is that correct?

dawn sparrow
#

I'm also not sure I understand what you mean when you say you don't get an Event from Stripe when the refund funds arrive to the "parents"? Who are the "parents"? Are you talking about when refunded funds come back after the Refund fails, or something else?

indigo fossil
#

Sorry, parents are who are refunding in our app.

#

So here's my question:

  • We start a refund
  • We get status:succeeded
  • 5-10 days later it arrives at the parents bank
  • do we get a Stripe event that notifies us that it made it into the parents bank account?
dawn sparrow
#

No.

indigo fossil
#

Ok, thats what we thought

#

But, we do receive a failed event in that 5-10 day process, for ex, if their bank account is closed

dawn sparrow
#

The failure can happen much more than just 10 days later.

#

But yes.

indigo fossil
#

Ok, good

#

So my next question would be - you said "Usually it's because a Refund is created for an amount your available balance can't cover, so the Refunding is marked as pending until you have enough funds to cover it."

Are there any other situations this could occur?

dawn sparrow
#

I don't think so.

runic spruceBOT