#ael

1 messages · Page 1 of 1 (latest)

green tinselBOT
hearty chasm
gaunt parcel
#

I tried, but I got a response of "No such charge"

hearty chasm
#

Ahhh, okay. Just a sec

#

You said you can't update it with the Transfers Update API?

gaunt parcel
#

I don't see a way to update the payment only the transfer.

#

const transfer = await stripe.transfers.create({
amount: Number((parseFloat(invoiceAmount) * 100).toFixed(2)),
currency: 'usd',
destination: accountId,
metadata: {
shoot_id: compact(shootId).join(", "),
shoot_company_date: compact(shootName).join(", "),
representative: compact(repName).join(", "),
solo_invoice: compact(invoiceId).join(", ")
},
});

#

That creates the transfer with the metadata.

hearty chasm
#

Right, but can you supply the py_ to the Transfers Update API? I thought you could, but your initial question led me to believe you tried that already

gaunt parcel
#

Oh.... I did not try that.

hearty chasm
#

Okay, let's try that first. I think that's the actual intended path for those objects, as they represent inbound transfers

gaunt parcel
#

"No such transfer" 😦

#

I'm using the destination_payment prop from the create Transfer response.

hearty chasm
#

Okay, let me see. Just a minute

#

I think you have to get the source_transfer from the py_ in this case and use the metadata you set from that Transfer instead. I don't think there's a way to update this on the py_ itself.

If that doesn't work, can we back up a little bit and talk about what you're actually wanting to do with metadata on the py_? Is there a reason the metadata from the Transfer cannot be used?

gaunt parcel
#

When our customer receives a payout they need to see the metadata from the transfer on the payment.

#

Otherwise they don't know what it is for.

#

I do want to use the exact same metadata form the Transfer

#

Here is a transfer with Metadata. I want to have that same metadata end up on py_1MRh0TCiTgaUmHZK1Hg1x8Lc

old beacon
#

Hello! I'm taking over and catching up...

gaunt parcel
#

Okay... Is the destination prop on the Transfer response the correct account ID to use.

old beacon
#

Yes.

gaunt parcel
#

Thank you for your help.

old beacon
#

Did that work? Were you able to update the py_ object's metadata?

gaunt parcel
#

Trying to get the syntax right -- I'll report back.

#

Sorry, I'm not quite understanding the doc. Do you have an example of what I need to do?

brittle wagon
#

Hi there. What exactly don't you understand? You will need to pass the Stripe account header to make the request on your connect account, so you'll need:
{stripeAccount: '{{CONNECTED_ACCOUNT_ID}}'}
But a py_123 id is, for all intents, the same as a ch_123 id, so you can use this api call: https://stripe.com/docs/api/charges/update?lang=node#update_charge-metadata

#

If you look to the right at the above link, you can see an example call. You just need to make sure you're passing both metadata and the stripe account header

gaunt parcel
#

const charge = await stripe.charges.update(
'ch_1IsGLLEBp2JLhp8ECyfY5xhg',
{metadata: {order_id: '6735'}},
{stripeAccount: '{{CONNECTED_ACCOUNT_ID}}'
);

#

like that but with the py_ instead?

brittle wagon
#

correct

gaunt parcel
#

Thank you - that worked.