#AdamTheDeveloper-expand-refund
1 messages ยท Page 1 of 1 (latest)
'data.source.charge',
'data.source.source_transfer_reversal',
'data.source.charge.source_transfer',
'data.source.source_transfer_reversal.transfer',
'data.source.source_transfer_reversal.destination_payment_refund',
One example response from these would be:
The charge that you're looking for is actually right here
"id": "pyr_1LcSlMR6j2cSwD70gTV9swZP",
"object": "refund",
"amount": 2298,
"balance_transaction": "txn_1LcSlMR6j2cSwD707jQha3pQ",
"charge": {
"id": "py_1Lb5bLR6j2cSwD70CFegJdis",```
"charge": {
"id": "py_1Lb5bLR6j2cSwD70CFegJdis"
seems like the payment method was a non-card payment method
It was a card payment oddly, but it doesn't bring back the transaction's description which is odd
We only use card payments
(other methods are disabled)
huh interesting
We are using Connect on a custom account and NOT using the on_behalf_of
Original payment pi_3Lb5aiJAXBXnoJdl0gwOBjmo
In the response, I couldn't see this reference ID anywhere.
The balancetransaction is pulling in a connected account's data
On a BalanceTransaction type of "payment" I can get the info I need, but not on "payment_refund"
Ah okay, just saw it.
So one way to do this is to go from
Balance Transaction -> "reversals" -> "source_refund" (re_3Lb5aiJAXBXnoJdl0tpgZM1s) -> retrieve the charge to see the PaymentIntent ID
Ok, I'll try that and come back to you
data.source.source_transfer_reversal.source_refund.payment_intent = You cannot expand more than 4 levels of a property
yeah, you probably want to do this in two steps :/
Any ideas on what to do to get it in one? Or not possible?
checking something..
can you try expanding 'data.source.refunds ?
and share what you're seeing?
That's with:
'data.source',
'data.source.destination',
'data.source.payment_intent',
'data.source.source_transfer',
'data.source.charge',
'data.source.refunds',
]```
Hey hanzo had to step away but I am looking in to this. Having a bit of trouble finding the right path as well but am consulting my colleagues
Taking a step back for a second, is this basically about showing the user the relevant original payment when listing what changed their balance and you aren't sure how to do that for refunds specifically?
Yes. We have a nice friendly description on the original transaction when the CheckoutSession completes and payment is made with our internal order number. I want to show this to the end user when they view their balance transactions.
I had thought about updating the py_ reference for the connected account, but that's another problem I can't find the destination transaction py reference from the CheckoutSession or paymentintent
Gotcha, that should be possible to do get or set this either way but I am still struggling to find this. Apologies for the delay, have not given this enough time. I will try to pull in a colleague who can look in to this deeper than I can at the moment