#metalman247 - api key

1 messages ยท Page 1 of 1 (latest)

nocturne gyro
#

What operation are you trying to do?

#

What endpoint?

#

Any request id you have too will help me look into it

eager steppe
#

Sorry, yes I'm trying to get my react app to go to the payment section in stripe once the user hits buy

nocturne gyro
#

Ok. It's hard to tell from that error message but it looks like your api key might have '${' hardcoded in the string. Can you do a console.log of it right before it's used to see what's printed out? Don't share the full API key in here though

eager steppe
#

Here is my code. I have the api key in a .env file. I have tried to put it in a string in loadstripe but that also gave me the same error

glad rose
#

Hello ๐Ÿ‘‹
Stepping in here
Seems like you're using the wrong quotes with $ sign

eager steppe
#

What should I change it to?

glad rose
#

you need to be using backtick "`"

#

the one (mostly) under escape key

eager steppe
#

I am still getting the same erro

#

error*

glad rose
#

hmm weird now it is undefined

#

can you try restarting the server for good luck? ๐Ÿ˜„

eager steppe
#

Yes

#

I still get the same error

glad rose
#

can you move your console.log above loadStripe function and see its really printing out a key?

eager steppe
#

same erro

glad rose
#

your console.log is still using the old quotes

eager steppe
#

I know

#

I just tried it with the `

#

and it still says the same

#

here is my code

glad rose
#

can you share a screenshot of your browser console that shows the complete errors?

eager steppe
glad rose
#

can you try printing the variable without the quote and $ sign?
That's so weird.

eager steppe
#

It still has the same issue

glad rose
#

can you share the screenshot please?

#

also hold on, looks like you're using React correct?

eager steppe
#

Yes it is react

#

I tried the console log outside the fuction as well

glad rose
#

I wonder if its related to how your component implements loadStripe ๐Ÿค”

#

can you move it to your index.js and load it just once?

eager steppe
#

Still the error

#

I moved it to my index and my app.tsx where I route to the different pages

glad rose
#

Can you share your sample code so that I can take a deeper look? ie. you can use glitch.me or something similar to share the repro

eager steppe
#

The glitch me file is taking a while to load. Do you want me to send you a zip? I understand that might be a secuity issue so we can wait for glitch to load otherwise.

#

OK the glitch just keeps loading

#

I can screenshot and sent you all the important files if that is ok with you?

glad rose
#

Ah I see. Umm can you actually write in to our support (support@stripe.com) with relevant details and mention that you spoke with hanzo on discord. I'll grab the ticket and let you know what I find over email if that's okay.

eager steppe
#

I have sent the email