#brent_connect-refund

1 messages ¡ Page 1 of 1 (latest)

clear kettleBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1420833768633139371

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

autumn glacier
#

@exotic sonnet I'm assuming you are using Destination Charges is that correct?

#

brent_connect-refund

exotic sonnet
#

yes

autumn glacier
#

Okay and I assume you are setting the metadata on Refund creation and doing nothing else is that correct?

#

Basically: when you use Destination Charges, there are many objects involved both on the platform (your account) and the connected account. Each of those objects have their own logic and metadata. When you set metadata on Refund creation it's only reflected on your own platform account's Refund and not on the object on the connected account
It's the same for the payment itself, the PaymentIntent and Charge in your platform has the metadata and the connected account's Charge as the result of the Transfer moving money in their Stripe account's balance doesn't

exotic sonnet
#

on a payment_intent.succeeded event i am updating the payment object with metadata (which shows on the export) and then on a refund.created event I am updating the refund object with the same metadata and this does not show on a payment_refund row in the export file.

#

what do i need to do to get that metadata to show up on the export file?

autumn glacier
#

Can you give me a concrete example object id to look at?

exotic sonnet
#

re_3SBHYVAmWM7mv4O61aNO7qhe is a refund object that I set metadata on. Here is a payment py_1SBIM1PNfIDqLgOkDtLSYmHh that I refunded and also set the metadata on the refund

autumn glacier
#

Okay so that's the Refund on the Platform right? Where did you update the Refund on the connected account? It would be pyr_12345

exotic sonnet
#

I didn't i just consumed the refund.created event and it gave me that refund id and then called the update refund api. How can I access the pyr object?

autumn glacier
#

Yeah sorry that's what I want explaining earlier about how there are many different objects involved. You replied saying you already update those but I don't think you do

#

Refunds work the same, the Refund on the platform (re_123) points to a TransferReversal (trr_123) on the platform that pulls funds from the connected account via the transfer_reversal property and that one points to the Refund on the connected account (py_123) via the destination_payment_refund property

#

Conceptually though doing the data export manually in the Dashboard is not the best approach/idea so I wonder if there's a better flow for you

exotic sonnet
#

I am setting metadata on the payment object (py_123) and the refund object (re_123).

How can I resolve get to the proper refund pyr_123 from the transferreversal. I have access to the trr_123 id on the refund.created event. Is there an api I can call to get this information

#

It's not me that is pulling the export it is the connect account

#

they have asked about providing that metadata in the export

#

as right now it's not showing for payment_refund rows only payment rows

autumn glacier
#

I mean it's not, the connected account doesn't have Dashboard access at all right? You are doing this by hand in the Dashboard which is not a normal flow

#

Sorry what part of what I said earlier is unclear? Are you the developer building this?

exotic sonnet
#

I am literally viewing the dashboard as the connected account and pulling the export

#

yes I am the developer

clear kettleBOT
autumn glacier
exotic sonnet
#

oh man. I am testing in test mode right now. I go to the connected account I click on view dashboard as <connected account name> I click on ttransactions export and the metadata for a payment_refund does not show in the export

autumn glacier
#

But really as the developer, when you create the Refund you should be passing metadata, not sure why you do this on the refund.created Event in the first place
and then you need to understand there are related objects (what I explained above) and go and update that.
So when you create that Refund, it has transfer_reversal: 'trr_123' and then you can use the Retrieve TransferReversal API to retrieve it and find the destination_payment_refund: 'pyr_123' and then call the Update Refund API with that connected account id in the Stripe-Account header and pass the metadata

exotic sonnet
#

the metatdata shows for payment rows though

#

I don't really appreciate you're condescending tone.

foggy crater
#

Hi there,
taking over for my colleague who had to step away. Give me just a second to catch up.

autumn glacier
#

Sorry, I wasn't trying to be condescending, I'm trying to focus on how the API layer part itself works to show you the different pieces involved

#

I looked at the Charge id you shared that has metadata and that one is the one on the connected account (the one on the right in the picture from our doc) and it looks like your code explicitly updated it to set metadata.

#

Does that align with what you see in your code?

exotic sonnet
#

I'm good, I'll figure it out on my own