#Shoes_Mcgee

1 messages ยท Page 1 of 1 (latest)

lucid perchBOT
tame tendon
#

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

modern spade
#

Would this be the checkout session endpoint?

tame tendon
#

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?

modern spade
#

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?

tame tendon
#

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?

modern spade
#

I didnt put anything in the body of the request because i thought ....magic lol

#

Yes i got undefined

tame tendon
#

Interesting. And you see session_id in the query string?

modern spade
icy ledge
#

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

modern spade
#

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?

icy ledge
#

You can yes! as long as the value is part of the query params, you can do anything with it ๐Ÿ™‚