#codyellow-connect-destination

1 messages ยท Page 1 of 1 (latest)

prime valeBOT
terse crane
#

@arctic spindle can you give me a bit more than pictures?

#

How do you integrate? Like is this Destination Charges? Something else?

arctic spindle
#

This is with stripe connect express, yeah they should be destination charges

terse crane
#

codyellow-connect-destination

arctic spindle
#

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)

terse crane
#

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

terse crane
#

@arctic spindle are you unblocked?

arctic spindle
#

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?

terse crane
#

I mean technically you created the Refund, you have it, none of the steps before matter right?

arctic spindle
#

ah yeah this was mostly me debugging out loud sorry ๐Ÿ˜„

terse crane
#

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)

arctic spindle
#

hahah yeah all good

#

I was guessing to go from refund -> balance transaction.. but there's not much else there

terse crane
#

I mean Charge -> transfer

#

Refund -> transfer_XXXX

#

it's right there, last property in your JSON

arctic spindle
#

ah "transfer_reversal": "trr_1NiNb7DcTzxmQ4ZaVwaorREf"?

#

is this a Charge objet?

terse crane
#

why would it be a Charge object?

#

A Charge creates a Transfer that creates another Charge

arctic spindle
#

oh

terse crane
#

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 ๐Ÿ˜‚

arctic spindle
#

hahaha

terse crane
#

I have explained this for many many years, those videos are A DREAM

arctic spindle
#

is it of class Transfer

terse crane
#

well no

#

it'd be TransferReversal

arctic spindle
#

ahh okok

terse crane
#
  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

arctic spindle
#

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?

terse crane
#

it is under the Transfer class

arctic spindle
#

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?)

terse crane
#

you seem to be misunderstanding most of the basic vocabulary of our API ๐Ÿ˜…

arctic spindle
#

i think so... hahahha

terse crane
#

A Charge represents a payment attempt to move money into your Stripe balance

arctic spindle
#

oh

terse crane
#

a Refund represents an attempt to send money back to a Customer (who paid before)

arctic spindle
#

so I really just need to update the description of the refund then?

terse crane
#

possibly

#

that really depends what you are trying to change, earlier you just gave me 2 pictures

arctic spindle
#

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

terse crane
#

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

arctic spindle
#

ahhh ok