#Kalluste

1 messages · Page 1 of 1 (latest)

weak domeBOT
fierce wind
#

if you hit the 4 limit in expansion you just have to make a separate retrieve call to the ID that is 5 deep instead

bold plinth
#

My goal is this:

When a new payout is created and stripe sends me a webhook about this I'll save the payout to my DB and create relations so that the refunds and paymentIntents in my database will have a foreign key pointing to a specific payout.

Is there no possiblity to access refund metadata through balance transactions?

fierce wind
#

well it depends. The Refund object exists on the platform account, not the connected account(assuming you're using Destination charges as your question implies). It won't even create any BT on the connected account unless you use for example reverse_transfer when creating the refund

bold plinth
#

we are using reverse transfer for all refunds

fierce wind
#

if it does, the the chan is balance_transaction -> source -> source_refund

bold plinth
#

yep, with this data.source.transfer_reversal.source_refund I'm almost there

#

"source_refund": {
"id": "pyr_1N1SDZJu5s15laGC5JBOcVQ7",
"object": "refund",
"amount": 1000,
"balance_transaction": "txn_1N1SDaJu5s15laGCf6p0OuYG",
"charge": "py_3N15q4Ju5s15laGC0cDlrhmX",
"created": 1682591909,
"currency": "pln",
"metadata": {},
"payment_intent": "pi_3N15q4Ju5s15laGC0UumfLED",
"reason": null,
"receipt_number": null,
"source_transfer_reversal": null,
"status": "succeeded",
"transfer_reversal": "trr_1N1SDZJu5s15laGCd1oKWD4q"
},

fierce wind
#

ah I missed a step, since that's the refund of the incoming 'payment' that represents the transfer arriving.