#Dejan - Coach
1 messages ยท Page 1 of 1 (latest)
Hey, can you share a session ID (cs_xxx)?
yes of course
cs_test_a1tTSyz1s1FU2N0i9rSvUSI3CN1IMujwaqJX1GBV2tgAbdpom0xrv7hrPT
const session = await stripe.checkout.sessions.create({
line_items: [
{
price: price_id,
quantity: 1,
},
],
automatic_tax: {
enabled: true,
},
customer_update: {
address: "never",
},
metadata:{
auth0_id:auth0_session.user.sub,
spotify_id:spotify_id,
service_name:service_name
},
mode: "subscription",
customer: stripe_id,
success_url: `${getURL()}/payment/ok`,
cancel_url: `${getURL()}/payment/cancel`,
});
we cannot receive spotify id and service name
Hmm, I only see the auto0_id metadata key in the API request for creation of that session: https://dashboard.stripe.com/test/logs/req_Nbz7YHm8XiNaSH
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
That is generally indicative that the other values (spotify_id, service_name) are null/undefined (stripe-node will remove them from the API request)
I'd recommend logging those values before your API request and check they are indeed set as you expect
We console.logged them a lot of times and we have those object just before sending them through the API
Now we are trying to log also the object session
the weird thing is that sometimes it worked
I guess in those instances the values were set
cs_test_a1hnbHvmSYuZHbMltvl1VYwnDLEUuZ8UnOpr0PrfuLJff5x2rKnafkKHXp
that worked, same procedure ๐
That was yesterday too, could something have changed in your code?
As stated, stripe-node will omit parameters/keys were the value is null/undefined
That's 99% the cause here โ we don't just remove parameters from API requests
yesterday, at that time, we made some tries and some worked but some didn't. I know that it's very weird, but we are struggling
We are going to log every step of checkout
Like, in this request where the keys are there, you literally send an undefined string: https://dashboard.stripe.com/test/logs/req_ATmFNx7DxJLbvp
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
oh! it's weird because service name is there instead
We are trying to debug right now and I'll let you know
thanks
Any luck?
My colleague found the bug... The problem is that basically he is a {Insert your favourite insult} ๐
it worked for monthly payments and not for annual payment because the parameter was always setted as "monthly payment"
thanks for your patience and sorry
np!