#victoryprogramming

1 messages · Page 1 of 1 (latest)

keen doveBOT
steady vale
#

Can you share the Checkout Session id with me where you're not the metadata?

smoky river
#

Right

#

Give me a minute to run new session

#

Waiting for server to start sory for waiting

steady vale
#

No problem!

smoky river
#

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

steady vale
#

I can see the metadata on the PaymentIntent object

smoky river
#

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 {}

steady vale
smoky river
#

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

steady vale
#

Can you confirm that when you look at this event in the Dashboard, you can see the metadata on the Payment Intent correct?

smoky river
#

I can confirm that

#

It is correct

steady vale
#

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