#kristineannmon

1 messages · Page 1 of 1 (latest)

jaunty sierraBOT
maiden wave
rocky cairn
#

I'll be listening to charge.refunded webhook event and the Balance Transaction ID from that payload will be used for matching transactions under a Payout record. But the problem is that it is not the actual Balance Transaction ID of the refund record.

#

So I was thinking that maybe I'll use "List all refunds" API just to get the actual Balance Transaction ID of the refund record.

maiden wave
#

Ah, I see, so you want to get the balance transaction that associated with the refund, not the charge

rocky cairn
#

So based on the API documentation, I'll either provide a Payment Intent ID or Charge ID. But the problem is that there is a possibility that a Payment Intent/Charge will have multiple refund linked to it so how can I identify the Balance Transaction ID?

maiden wave
rocky cairn
maiden wave
#

Yes

rocky cairn
#

Is there a reason why "refunds" list is not included in the response?

#

By the way, this is the whole timeline of the payment.

maiden wave
rocky cairn
#

But I still have a problem.

#

In my scenario, we will be only creating a record when the charge.refunded webhook event is triggered. So based on that payload, I got the necessary details to execute the "Retrieve a charge" API but the problem is it might have multiple linked refund records. So is it safe to use "created" to match refund record from the charge.refunded webhook event payload to the retrieved refund records from the response of the API callout?

maiden wave
#

Can you tell me why multiple refunds is a problem here?

rocky cairn
#

Because I want to track down the exact refund record based on the refund record from the charge.refunded webhook event payload. I mean how can I know which is which. So I was thinking I'll be using "created".

maiden wave
#

A charge object may have multiple refunds because you can create partial refunds for one charge. I'd suggest you to update your data strcture to accommodate this.

rocky cairn
#

Okay Jack, thank you so much for your help. Your help gives me a clearer picture on how I will approach this one. Again, thank you.