#codyellow-connect-destination
1 messages ยท Page 1 of 1 (latest)
@arctic spindle can you give me a bit more than pictures?
How do you integrate? Like is this Destination Charges? Something else?
This is with stripe connect express, yeah they should be destination charges
codyellow-connect-destination
Gotcha so I recommend watching https://www.youtube.com/watch?v=l3z_3jDiPTI
Basically what you want to do is update the description of the py_123 Charge on the connected account using https://stripe.com/docs/api/charges/update + Stripe-Account header
https://stripe.com/docs/connect/customize-express-dashboard#set-custom-descriptions explains this too (but the video should make it a lot simpler to grasp)
does a refund create a separate charge item? I'm not quite sure how to find the ID of it
(watching the video right now though)
the video explains how the objects are linked for a payment, and refunds do the same
So you have a re_123 in the platform and a pyr_123 on the connected account and you can update its description too
@arctic spindle are you unblocked?
I'm still not quite sure how to fully connect the pieces.. could you help point me a bit more?
I'm able to find the charge for the payment originally moving into the connected account:
Stripe::Charge.retrieve('py_1NiNalRfYCk8Ir9W5bqDb1Nv', {stripe_account: 'acct_1LpQhTRfYCk8Ir9W'})
So from this charge... I can find the associated transfer (via source_transfer) tr_3NiNajDcTzxmQ4Za32EYSkFu
Then find the Charge on my platform (via source_transaction)..ch_3NiNajDcTzxmQ4Za3Zg9qUM7
From there I can find the refund from refunds[data][0][id] Stripe::Refund.retrieve('re_3NiNajDcTzxmQ4Za30FJARrW')
"id": "re_3NiNajDcTzxmQ4Za30FJARrW",
"object": "refund",
"amount": 50000,
"balance_transaction": "txn_3NiNajDcTzxmQ4Za3xCVRD2x",
"charge": "ch_3NiNajDcTzxmQ4Za3Zg9qUM7",
"created": 1692822252,
"currency": "usd",
"metadata": {"hub_file_id":"1213231192852901905","monetized_resource_id":"30","refund_reason":"doesnt_meet_needs","resource_creator_id":"1159346314592196611","take_rate":"0.15","user_id":"1270848706202148881"},
"payment_intent": "pi_3NiNajDcTzxmQ4Za3RZUsAB6",
"reason": null,
"receipt_number": null,
"source_transfer_reversal": null,
"status": "succeeded",
"transfer_reversal": "trr_1NiNb7DcTzxmQ4ZaVwaorREf"
}
From the refund object on my platform, how do I find the charge on the account?
I mean technically you created the Refund, you have it, none of the steps before matter right?
ah yeah this was mostly me debugging out loud sorry ๐
you see how you go from ch_123 -> transfer -> tr_123 -> destination_payment -> py_123
or back py_123 -> source_transfer -> tr_123 -> source_trasnsaction -> ch_123
you can do the same on Refund. The names are different but close, it's right there on your raw JSON
(I'm kinda teaching you to fish I hope it's okay)
hahah yeah all good
I was guessing to go from refund -> balance transaction.. but there's not much else there
I mean Charge -> transfer
Refund -> transfer_XXXX
it's right there, last property in your JSON
why would it be a Charge object?
A Charge creates a Transfer that creates another Charge
oh
A Refund pulls money so it creates a TransferReversal that creates another Refund
The person on my team who did this video I'm asking them to do the same thing for Refunds ๐
hahaha
I have explained this for many many years, those videos are A DREAM
is it of class Transfer
ahh okok
id: 're_3NiNajDcTzxmQ4Za30FJARrW',
expand: ['transfer_reversal.destination_payment_refund'],
})```
try that, you should see all the objects you want at once the Refund re_123 on your account, the trr_123 on your account and the pyr_123 on the connected account
it's the mirror of the money movement for the Charge
ahhh ok i forgot about the expand... I was trying Stripe::TransferReversal.retrieve('trr_1NiNb7DcTzxmQ4ZaVwaorREf') where it was saying TransferReversal wasn't defined in the ruby sdk I guess?
ohh
hmm so from this pyr_ refund... does this create a charge on the account as well?
Stripe::Refund.retrieve('pyr_1NiNb7RfYCk8Ir9WYgmXdlZJ', {stripe_account: 'acct_1LpQhTRfYCk8Ir9W'})
=> #<Stripe::Refund:0x1538bc id=pyr_1NiNb7RfYCk8Ir9WYgmXdlZJ> JSON: {
"id": "pyr_1NiNb7RfYCk8Ir9WYgmXdlZJ",
"object": "refund",
"amount": 42500,
"balance_transaction": "txn_1NiNb7RfYCk8Ir9WHADM5dfw",
"charge": "py_1NiNalRfYCk8Ir9W5bqDb1Nv",
"created": 1692822253,
"currency": "usd",
"metadata": {},
"payment_intent": null,
"reason": null,
"receipt_number": null,
"source_transfer_reversal": "trr_1NiNb7DcTzxmQ4ZaVwaorREf",
"status": "succeeded",
"transfer_reversal": "trr_1NiNb7DcTzxmQ4ZaVwaorREf"
}
the charge field points to the original charge for the initial transaction (and not the refund portion right?)
you seem to be misunderstanding most of the basic vocabulary of our API ๐
i think so... hahahha
A Charge represents a payment attempt to move money into your Stripe balance
oh
a Refund represents an attempt to send money back to a Customer (who paid before)
so I really just need to update the description of the refund then?
possibly
that really depends what you are trying to change, earlier you just gave me 2 pictures
https://stripe.com/docs/api/refunds/update this seems to indicate i can only update the metadata?
I'm trying to set/update the description
ie. I set the description for the original charge to hi?, and I'd like to be able to set the description on some object (the refund(?)) such that I can change the description away from Refund on CodyExpress to something custom
huh that's my bad, I didn't even look
I had no memory we didn't allow updating the description of the Refund
oh wow
we don't let you even set it on creation
so yeah so sorry, turns out you have no control over any of this and that'd be a feature request for our team: https://support.stripe.com/contact
ahhh ok