#Shoes_Mcgee
1 messages ยท Page 1 of 1 (latest)
So looks like you're passing an undefined variable to the retrieve checkout session endpoint. That expects a checkout session id as a string
I recommend adding console log statements to trace why that variable is undefined
Would this be the checkout session endpoint?
Yup that first await call
So that means req.query.session_id is undefined
When that success page loads after completing the checkout session, what does the query string in the url look like?
Wait I think i'm understanding, after success, I get the query parameter in my address :
but I have to send that (being the parameter) to the back end in my request for the customer info right?
Yep you got it
So looks like session_id is there
So you need to figure out why req.query.session_id isn't grabbing that session id
First, log that with a console log statement
Do you get undefined?
I didnt put anything in the body of the request because i thought ....magic lol
Yes i got undefined
Interesting. And you see session_id in the query string?
This could also be due to the fact that im just refreshing the page, I could try going throughout the whole checkout flow again
Hello ๐
Stepping in as codename_duchess needs to step away
Yeah I'd recommend trying that, as well as console logging req.query and see the printed value
Could I just use useParams from react router to grab the parameter from the address, and then send it in the body of my request to my backend?
You can yes! as long as the value is part of the query params, you can do anything with it ๐