#Hamza-Metadata

1 messages · Page 1 of 1 (latest)

sudden totem
#

Hamza-Metadata

pastel vector
#

req_iLagtvTiYElFxy

#

req_2m21fDWZ9gwgwa (checkout request)

sudden totem
#

Thanks for the ID. I can see that you have successfully attached metadata to both the checkout session object and the paymentIntent object.

pastel vector
#

the problem i'm having is that, metadata isn't showing up in transfer object or the connected account payment object

sudden totem
#

The transfer is a different object, and that's why the metadata is not there.

#

You need to explicitly set the metadata on this Transfer object.

pastel vector
#

okay can you guide me about that?

sudden totem
pastel vector
#

isn't there a way to directly attach metadata at the time of creating the transfer?

sudden totem
#

You mean at the time when you create the destination charge?

pastel vector
#

yes you can see the code in the initial picture.

sudden totem
#

Not possible, CheckoutSession API doesn't have a param for you to propagate the metadata to a transfer object.

pastel vector
#

okay but what about the connected account payment object?

#

is it possible to attach metadata to that?

sudden totem
#

Sure you can do that

#

Once you've retrieved that transfer and you’d see the destination_payment property corresponding to the payment on the connected account (py_XXX).

You can get all of this in one API call by using the expand feature and passing transfer to get the transfer property expanded in the response. This gives you access to the payment id (py_XXX) directly in that API call.

Then, once you get this, you’d call the Update Charge API using the Stripe-Account header so that you can set the description or metadata you want on that payment.

pastel vector
#

I retrieved the payment id of the connected account but i'm still unsure as to how i can update the metadata to this payment.

#

?

sudden totem
#

You call the Update Charge API using the Stripe-Account header so that you can set the description or metadata you want on that payment.

pastel vector
#

is this possible with php? the documentation you provided don't have php example

sudden totem
#

Yes, it's available in all language, you can select the PHP example code in the same page

pastel vector
#

Thank you for your help. Issue has been resolved.

sudden totem
#

No problem!

pastel vector
#

one more thing is there a way to directly access transfer id from payment intent id?

#

or will i have to access the charge data to get the transfer id?

sudden totem
#

you need to access charge first and get the transfer ID from the charge object

pastel vector
#

okay thanks.