#surgical

1 messages · Page 1 of 1 (latest)

dense gardenBOT
stoic kite
#

Hello! Can you give me an example Event ID or Charge ID so I can take a look?

sleek shell
#

sure!

#

evt_3NuIhoIHkg9cPLLo01LJTjZi

stoic kite
sleek shell
#

this makes sense. but how can a charge.refunded have a status of success if the associated intent was canceled?

stoic kite
#

Not sure I follow, what do you mean exactly?

#

Are you talking about the status on the Charge or the status on the Refund?

sleek shell
#

If I created a payment intent, and then canceled the intent, how can there be a refund on something I never paid?

#

i see this as the charge refunded, but how can there be a successful refund in the first place, if the payment intent was canceled?

stoic kite
#

The Payment Intent was canceled after the capture (and thus the Charge) succeeded.

#

And then you canceled it.

#

The confirmation succeeded though.

sleek shell
#

hmm. maybe my logic is out of order? Currently we send an email thanking them for email, upon a payment.intent_succeeded. We also send a refund email when charge.refunded has succeeded. So we're sending a refund email, when the original intent didn't succeed. Is my approach incorrect?

#

I only see this happen a couple times out of 100 charges, so I'm unsure what causes this

stoic kite
#

I think there's a misunderstanding, yeah. You're doing separate authorization and capture, meaning you're placing a hold on funds. You successfully placed the hold, but that doesn't mean the entire Payment Intent succeeded. It won't succeed until you capture the funds (which you didn't do), but the Charge succeeded (because you placed the hold successfully).

sleek shell
#

Got it. During a refund.succeeded webhook, is there a way to determine if that refund is using captured funds and not just held?

#

the intent (no pun intended) is to send an email to the customer saying they are getting their money back

stoic kite
#

Yeah, the charge.refunded object contains the Charge, and it will have an amount_captured property saying how much was captured, and also a captured boolean. You can use those to determine if the funds were captured or not.

sleek shell
#

I'll take look. Thank you so much!

stoic kite
#

Happy to help!