#victoryprogramming
1 messages · Page 1 of 1 (latest)
Hi, you're passing the metadata on https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata when creating the Checkout Session, right?
Can you share the Checkout Session id with me where you're not the metadata?
Right
Give me a minute to run new session
Waiting for server to start sory for waiting
No problem!
So while we wait can you tell me is this the right way to set up checkout session
str.checkout.sessions.create({
payment_method_types: ['card'],
customer_email:email,
mode: 'payment',
line_items:
[{
price_data: {
currency: 'usd',
product_data: {
name: Your order is program with: ${sizeData[0].size}$ on your account! ${chosenAddons.length!=0?'Your order includes:'+JSON.stringify(chosenAddons):''},
},
unit_amount_decimal: Math.round(finalPrice * 100),
},
quantity: 1,
}]
,
success_url: `...`,
cancel_url: `...`,
payment_intent_data:{metadata:{user_id:transactionId.toString(),},} ,
})
Here is Checkout id
cs_test_a1auUzqs11Q40fCI4R5U4qo8wjHXOeS1bWprjuOvJQHWMbr5gZkZdkA2tG
And here is the payment intent id from payment_intent.succeded event pi_3O5eVhDZ6LCnB5y51sAxra1B
I can see the metadata on the PaymentIntent object
content {"id":"pi_3O5eVhDZ6LCnB5y51sAxra1B","object":"payment_intent","amount":187500,"amount_capturable":0,"amount_details":{"tip":{}},"amount_received":187500,"application":null,"application_fee_amount":null,"automatic_payment_methods":null,"canceled_at":null,"cancellation_reason":null,"capture_method":"automatic","client_secret":"pi_3O5eVhDZ6LCnB5y51sAxra1B_secret_3Ya4MlOHioUoq9atXMjhdsZQM","confirmation_method":"automatic","created":1698368809,"currency":"usd","customer":null,"description":null,"invoice":null,"last_payment_error":null,"latest_charge":"ch_3O5eVhDZ6LCnB5y51XHRTJIt","livemode":true,"metadata":{},"next_action":null,"on_behalf_of":null,"payment_method":"pm_1O5eVgDZ6LCnB5y5SYiqZ6aZ","payment_method_configuration_details":null,"payment_method_options":{"card":{"installments":null,"mandate_options":null,"network":null,"request_three_d_secure":"automatic"}},"payment_method_types":["card"],"processing":null,"receipt_email":null,"review":null,"setup_future_usage":null,"shipping":null,"source":null,"statement_descriptor":null,"statement_descriptor_suffix":null
this is whole object
metadata is just empty {}
From looking at the event, https://dashboard.stripe.com/test/events/evt_3O5y5aDZ6LCnB5y52Gosh357 I can confirm that we sent the metadata
hm
Do you have any idea why are we not catching it at out side maybe?
event.data.object.metadata.user_id
This is how we are trying to read metadata
Can you confirm that when you look at this event in the Dashboard, you can see the metadata on the Payment Intent correct?
I'm unsure why you are not seeing that when trying to attain this data. As a next step I would recommend that you start logging these nested objects to see what you're getting