#pdugar_error

1 messages ¡ Page 1 of 1 (latest)

amber merlinBOT
#

👋 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/1311447222986215424

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

fallen lynx
#

Hello, what exactly are you clicking on in the dashboard where you see this error?

mortal mesa
#

I have a payment button to add funds to my user's accounts which are stored on google Firebase. When this button is clicked in test mode it opens up a payment card which works fine. But when i just switch off test mode and replace the test keys with my live publishable/secret keys, I get a 400 error on my GET request

#

req_QGJaPqVVLqizTS

#

^One of many request_IDs from these failed GET requests

fallen lynx
#

Do you have the ID of the intent from that request? If not can you try again with a new intent and send me that ID?

#

Typically these errors are from mixed up API keys of some kind

mortal mesa
#

Could it come from the fact that i'm trying to test it locally with live keys as well?

#

Also, where do I find the intent ID for this specific request

fallen lynx
#

Testing locally with live should be fine. We don't throw that error because of mode or locality, it should only be thrown when the object is genuinely not on the same account as the public key that you are initiating elements with

#

It looks like we redact it in logs, I think the best way would be to trigger this again and send me the ID of the intent you created for it

mortal mesa
#

Do i find the intent ID using stripe CLI? can't find it anywhere on the developers site

fallen lynx
#

The two easiest ways that I can think of would be to log the ID when it is created on your server or you could use your browser's developer tools to see the client secret that your server is sending

mortal mesa
#

Having trouble logging it - what is the name of the ID attribute

fallen lynx
#

Is it possible to add a console.log to your page before whatever line uses the client secret? The payment intent's ID will be the first part of the client secret so I could use that to look up the intent

#

Oh or do you have a public test page where I can see this error for myself?

mortal mesa
#

Found the client secret/payment id inside of it

#

pi_3QPtH0Rrmq4NmIsx0eEGL9iy

#

^ID

fallen lynx
#

Thank you!

#

Hmm that is the same account as the public key from the other call. I am trying to think of what this may be

mortal mesa
#

Yeah the keys can't be on a different account - I've checked that already

#

Could there be something wrong with my public keys?

#

Theoretically if I don't switch anything other than my test keys to my public keys, I shouldn't have an issue right?

fallen lynx
#

You can try rolling them, though I am not particulalry confident that that would fix this. Can you try logging the client secret right before your page uses it just to double check that it is the value that you are expecting? Sometimes I have seen issues like this where a client secret for a test mode payment intent was hard coded at some point

mortal mesa
#

Ok

#

The client secret is showing up as undefined even when I try setting it using setClientSecret

fallen lynx
#

Interesting. What does result.data look like if you print out the whole thing?

mortal mesa
#

It contains the client secret

#

I think I found the issue here, setClientSecret isn't actually updating the client secrete

fallen lynx
#

React state behavior is so weird sometimes

#

If you put a similar print statement before the place where you initialize the <Elements> component do you see the same thing?

mortal mesa
#

I'm also getting this error in my logs

#

Is there a different way to update the client secret?

fallen lynx
#

Ah gotcha, where are you setting options.clientSecret now?

#

It isn't updatable as far as I am aware. It is supposed to be passed along with the initial elements options and then not changed. We do have a flow where you initiate elements without creating a payment intent, but that is a different flow from what you are doing

#

Also unfortunately I have to step out and fully close the server soon. If you can make a public test page where this error shows up and send it to our support team along with your code for setting up elements on the page, my colleagues should be able to take a better look. I am not sure why this behavior would have changed between live and test mode but it sounds like there may be some other issues on this page as well https://support.stripe.com/?contact=true

mortal mesa
#

Only updating it in the return statement for the component at the end of my file if there are no errors