#surgical_api

1 messages ¡ Page 1 of 1 (latest)

hushed lichenBOT
#

👋 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/1222555135838912565

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

grave pantherBOT
slate pilot
#

Hello, yes you can but you need to set it with the payment_intent_data.metadata parameter. The standard metadata parameter only sets the metadata on the checkout session

ember glen
#

oh awesome. and then when a charge succeeds, the data I set in payment_intent_data.metadata will copy to the charge?

slate pilot
#

Yes, in general our API does not copy metadata between objects but payment intent -> charge is one of the few exceptions

ember glen
#

tyty

slate pilot
#

Also keep in mind that this is a one time copy when the charge is created. If you change the PI's metadata that will affect future charges if there are any, but existing charges keep the same metadata

ember glen
#

got it

ember glen
#

sorry one more question - it doesn't seem to be working, is there could it be because i'm on really old stripe version (2018)?

#

stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: createdOrder.reserveObject.line_items,
metadata: {
orderId: createdOrder.id,
organizationId: createdOrder.OrganizationId,
total: createdOrder.reserveObject.totals.total,
},
payment_intent_data: {
metadata: {
confirmation_code: createdOrder.confirmation_code,
OrganizationId: createdOrder.OrganizationId,
Reservation: true,
OrderReservationId: reservation.id,
OrderId: createdOrder.id,
email: createdOrder.email,
}
},
mode: 'payment',```

slate pilot
#

Can you send me the ID of the payment intent that you did not see this metadata copied on to?

ember glen
#

req_5t15A7tglb2h53

#

oh wait

#

so sorry, i never restarted server

#

it works!

slate pilot
#

Great to hear!

#

That happens to me at least once a week