#Atef

1 messages · Page 1 of 1 (latest)

solid mesaBOT
tall spire
#

Can you share your code that invoked that error? I guess you're missing required parameters

rustic viper
#

the same code worked/and is still working well when i use the api keys of my old stripe account but when i switch to the new account it throws this error

tall spire
#

Can you share the code?

rustic viper
#

sure. one sec

tall spire
#

That's not the code that invoked the error. You have a redirectToCheckout function in your front-end somewhere, that is what is erroring

rustic viper
#

Ah, ok

tall spire
#

My guess is that that API call to create the Checkout Session is failing (you're not catching the error) and the id value you're returning there, and subsequently passing to redirectToCheckout, is undefined

rustic viper
#

hold on will share with you the code of the checkout redirect

tall spire
#

I don't think the root cause of the error is there, but ok

#

I suspect that your new account is on this version (or newer), and the API call is failing because you're passing that parameter

#

Where as your other account is probably on an older API version where those parameters are still supported

rustic viper
#

ok. so what do you think i should do to fix thisd

#

this ?

#

upgrade to stripe api?

tall spire
#

Well, let's make sure this is the actual issue first

rustic viper
#

sure. one sec

#

req_l42tFZ8ozW1PVO

tall spire
#

Yeah, so as I suspected. You can see the error clearly there

#

I'd recommend wrapping your API call in a try/catch block to actually catch these errors in your code

#

So, acct_1MFKseJepgMTkzPP must be a pretty new account as its on the latest API version: 2022-11-15

rustic viper
rustic viper
rustic viper
#

i think it's already wrapped in try/catch

#

or you mean the redirect to checkout function in the front end?

#

are you still here?

tall spire
#

If you have 2 accounts on different API versions, you have 2 options:

  • Upgrade your integration to not use these parameters (recommended).
  • Downgrade this account to use the same API version as your other account, and you won't need to change your integration.
rustic viper
#

i think i would go for the first option

#

how should i do the upgrade?

tall spire
rustic viper
#

ok, thanks

#

will check it out

tall spire
#

let us know if you have any specific Qs

rustic viper
#

Will do. thanks so much