#surgical_api
1 messages ¡ Page 1 of 1 (latest)
đ 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.
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
oh awesome. and then when a charge succeeds, the data I set in payment_intent_data.metadata will copy to the charge?
Yes, in general our API does not copy metadata between objects but payment intent -> charge is one of the few exceptions
tyty
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
got it
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',```
Can you send me the ID of the payment intent that you did not see this metadata copied on to?