#gabriel_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
๐ 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/1212044516773863556
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
โฒ๏ธ 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. Thank you for your patience!
Hi there ๐ I'm not sure I understand what you're trying to ask, would you mind rephrasing your question? You are correct that line_items is a required parameter for creating a Checkout Session, unless you're using mode: setup.
I'm receveing a message saying that line_items parameter is required to create a checkout-session. and it's correct.. no problem with it, but when i hit the button to create checkout session i'm receiving a message that line_items is required, but when i log the req.body to see if there is products inside the body the products is there, but i dont know why i'm receving this message, because all the itens is inside the body
Can you share the ID of a request where you saw that error being returned?
Can you copy/paste the req_ value from the request_log_url line from your third screenshot here?
let me try to find and take a screenshot, just a sec
Not a screenshot, I want the request ID from the third screenshot you provided above.
request_log_url: 'https://dashboard.stripe.com/test/logs/req_FGewc3k8hWSvxv?t=1709040529',
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Thank you, taking a closer look at that.
Hm, so looking at that log, it does look like line_items is missing. There are two thoughts that come to mind.
Did you add line_items to your code recently and need to redeploy to see those changes kick in?
Or, is it possible that items is ending up as null in your code? Our library might drop the parameter if it's empty.
I see, but i didnt deploy the cart system yet.. i already tried to restar the reactjs, restar server and everything else..
And i dont know if items is ending up as null, because i added a console.log con req.body to see if body is retuning as null or not.. and i can see on the log that is coming up with quantity and price (stripe tag)
In these cases, what can i do to add the line_items? because i already tried a bunch of stuff here and no one of them fixed my issue
You have line_items in your code, so right now it's figuring out why that isn't being included in the requests you're making that needs to be focused on. I'd recommend starting by logging the contents of items to make sure it's being populated correctly.
i did that to see if items has products inside, and it does, but i dont know what happens when fetch to server, because req.body is receveing the same data into items (handlestripe function) but when starts the session the line_items this error messages show up.. and i also changed to line_items: req.body but nothing changed
If you hard code a valid value for line_items, does the request to create a Checkout Session succeed? (I know you want to pass values from your frontend, but it sounds like the request to create a Checkout Session is what is failing right now, so I recommend starting by getting to function as expected and then shift your focus to trying to pass the right values in the right structure to it)
i'm gonna try to log step by step to figure out what is going on, because i have no ideia why i'm receveing that message... but anyway, thank you for you support and your time
Any time, I should be around for a while if your investigation leads you to more questions.