#glenb.
1 messages · Page 1 of 1 (latest)
hello! can you share the event id where you're expecting to see the metadata?
evt_3O0IRKJAdtV4PHZl0tV50HCb
if i look at the request that you made : https://dashboard.stripe.com/test/logs/req_2MLDdGj0QkC9xz you aren't passing in metadata in payment_intent_data
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
But I am passing it (in the code)?
i suggest debugging or stepping through your code. It could be that you're updating a section of code that is not actually used
I stepped through it and it's correct. Is there any chance it is an issue with your beta version of ui_mode: 'embedded' ?
hmmm, gimme a second to test it out
I have the output of the session object and it doesn't include the payment_intent_data. Happy to paste it into this if you need it. Will wait to hear how your test goes - thanks.
Any luck?
we just tested it and it works perfectly fine for us
Really, that's odd. I stepped through the code I pasted and the session object doesn't include the payment_intent_data? Did you use ui_mode: 'embedded' in your test?
yep, we did that
how about you try creating an entirely separate and new example from scratch instead and see if you're still having the same issue?
You can see the code I'm using to create the session - what's wrong with it?
it looks correct to me too. But when we copied your exact code, and assigned a value to the variable, it worked as expected for us
it'll be easier if you can create a simple sample that replicates the issue using glitch or codesandbox for us to take a look at. Without an example that replicates the issue which we can look at, it's difficult for us to troubleshoot further
Alex, I'm not familiar with glitch or codesandbox? Would it help if I made a sample using values instead of the variables?
i would say reach out to us at https://support.stripe.com/contact/email and share your sample that we can just download and run as it is. You could possible upload your code to github gists as well and share a link to that. If you do share code please be sure to remove any API Keys or other sensitive information.
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Not helpful Alex. I don't have time to send an email to support and wait for a response. Same code, new delivery...? Can you share the code you used to replicate my session creation so I might see what's different, or is there someone else who might be able to work out what's wrong? My code follows all your requirements?
Basically, I just need to be able to capture that the payment was successful and the metadata to tell me what it was for....
const tokenName = 'test'
const tokenID = 'test2'
const preTaxAmountToPay = 1000
const stripeCustomerID = 'cus_OkBZiJJJ2a6QLI'
const returnURLBase = 'https://www.example.com'
const checkoutSession = await stripe.checkout.sessions.create({
line_items: [
{
price_data: {
currency: 'aud',
product_data: {
name: `Reactivate token: ${tokenName} (${tokenID})`
},
unit_amount: preTaxAmountToPay,
tax_behavior: 'exclusive'
},
quantity: 1
}
],
payment_method_types: ['card'],
mode: 'payment',
ui_mode: 'embedded',
customer: stripeCustomerID,
automatic_tax: {
enabled: true
},
billing_address_collection: 'required',
customer_update: {
address: 'auto',
name: 'auto'
},
payment_intent_data: {
metadata: {
updateReason: 'reactivate',
[tokenID]: 'add'
}
},
return_url: `${returnURLBase}/tms/checkoutCompleted?session_id={CHECKOUT_SESSION_ID}`
});
console.log(checkoutSession)
}```
Hi @high ruin This is the code I run based on the code you provided earlier.
Ok, thanks. Give me a sec to run it?
Sure thing
I ran it and have the same issue. The output of the checkoutSession in your code also doesn't include the payment_intent_data?
Can you share with me the request ID?
Ok, is this it: cs_test_a1kRsLZ6OwbF4juFq3MGquxUeApWchJnVXfRkK0Y33ywmKwvQRhvD1QAG3
i can see that the payment_intent_data.metadata is being passed in now https://dashboard.stripe.com/test/logs/req_T8DW8DLNhr6q6t
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
the response for the Checkout Session creation doesn't have a PaymentIntent. A PaymentIntent is only created when you attempt to pay
so if you try to make payment, and then examine the corresponding PaymentIntent, you would probably be able to see the metadata on the created PaymentIntent now
Ok, I'll give it a try...
Hey, I'm trying mine again - I'll give you the id - can you check the response on that please?
sure
cs_test_a1MZohezD2OiXLYF0yQjhgE8meaSXRnmKv0rMPoLnPHxuM0Fq0k9dv6zTk
yep, payment_intent_data.metadata is also being passed in for cs_test_a1MZohezD2OiXLYF0yQjhgE8meaSXRnmKv0rMPoLnPHxuM0Fq0k9dv6zTk