#yaikia_error

1 messages ยท Page 1 of 1 (latest)

meager acornBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ 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.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— 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/1390045420893372626

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

south dock
#

Hi there ๐Ÿ‘‹ is that an error you're getting from our API, and if so can you share the request ID for the request you made to our API, or is that an error that your API is returning to you?

midnight briar
south dock
#

Oh I see, your API is throwing an error and returning our API error in it.

And that request won't have a request ID, because if you provide an invalid API key the request doesn't get far enough into our stack to generate an ID.

midnight briar
#

Yep

south dock
#

You'll want to double check that the secret API key that you're using is correct and matches the secret key for the account you're intending to test with.

#

Probably the right one, but I suggest rolling that secret key as this is a public forum that it's been shared in.

midnight briar
#

Yep, i did log in through my console with stripe website

#

So its good for 100 percent

#

And then i'm using the copy button

#

So i dont fckin understand

south dock
#

Can you make a basic curl request using the key? (To help take your code and tech stack out of the equation and check just the key itself)

#

Creating a Customer is probably the easiest endpoint to test with, since you don't have to provide any data in the request

midnight briar
#

Yes one sec

south dock
#

Also, I don't think the keys you showed in your screenshot line up with the Account where the Price ID you shared (price_1RgUhKFZHu2biJbUHQCaE8YZ) resides. But that should lead to a different error if the API key you use is valid, so we can focus on the API key first and then see where that leads us.

midnight briar
south dock
#

Mk, doesn't look like a problem with the key itself then. So maybe how it's getting pasted or read in your code.

I'd suggest checking for leading/trailing white-space or quotes, or possibly invisible leading/trailing characters.

midnight briar
#

Thats what i'm doing since one hour

#

I only use the button to copy paste

#

The lenght should be 107 right ?

south dock
#

You shouldn't assume a specific length

#

How are you passing this to your code?

midnight briar
#

Ctrl V bro

south dock
#

Into an environment variable, a constant file, a local variable, just as a string?

midnight briar
#

Crazy bro

south dock
#

How are you using that variable? Are you using it with one of our libraries?

south dock
#

Have you logged out the contents of the variable holding that key during runtime, to make sure it's what you're expecting it to be when your endpoint is called?

south dock
#

You're storing your secret in STRIPE_SECRET_KEY, have you added any logging to output the contents of that, so you can triple check it's what you expect it to be?

midnight briar
south dock
#

Seems right. I'm not familiar enough with your code to keep guessing about possible problems here. We've confirmed that your key works when using it directly via cURL, so the problem seems to be with how you're using it in your code, but there isn't much context in this thread on how you're doing that so I don't have much information to go off of.

midnight briar
#

What else could cause Stripe to reject the key only when called inside my endpoint, even though it works perfectly via cURL?

south dock
#

Nothing that I can think of.

midnight briar
#

Iโ€™m fucked ๐Ÿ˜