#osama_10014

1 messages · Page 1 of 1 (latest)

lucid swallowBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

dusk willow
#

I don't understand your question. What keys are you referring to?

mortal gull
#

I was using createToken function while using publishable key it was working nice on react

#

but now i am using confirmCardSetup function and applies stripe key of same publishable key that was using for create token but this time it is giving error of mismatching api with server side

#

I am talking publishable key for loadStripe function for both functions

#

@dusk willow ?

dusk willow
#

Are you following a doc for integration? confirmCardSetup and createToken are wildly different methods, so comparing them is likely not helpful for you

mortal gull
#

yes i know and i am using them in different features as well

#

but my question is when i was applying the publishable key for loadstripe for create token function it was working fine

#

but when i try to apply same publishable key for loadstripe function to confirmCardSetup it is giving mismatch api error

#

can you guide me regarding this

dusk willow
#

What's the exact error that you're getting?

mortal gull
#

StripeInvalidRequestError: No such setupintent: ${client secret key}

dusk willow
#

That likely has nothing to do with the API key. When you log the secret key, does it show anything? If so, what does the console log output?

lucid swallowBOT
mortal gull
#

just give me 2 mints i cna give you output res

#

dont close this thread please

#

i am trying to reproduce and giving you in a while

hollow cargo
#

My teammate needs to step away so I'll continue to assist!

mortal gull
#

{
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such setupintent: 'seti_1OMdoqKqvjOx1xht7p7eRGku'",
"param": "intent",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_4pZndaFWl35SxU?t=1702417736",
"type": "invalid_request_error"
}
}

Learn more about error codes and how to resolve them.

#

Here is the error response

#

@hollow cargo have you understood my problem or need any further explanation?

hollow cargo
#

Taking a look!

mortal gull
#

okay

hollow cargo
#

Ah, it looks like you're mixing up your keys.

#

The SetupIntent you're trying to confirm was created with the test mode secret key of a different account, let's call this Account A

#

Your client side call to confirmCardSetup is using a publishable key of a different account, Account B

mortal gull
#

Yes, I know the error is due to this reason but my question is can i use the same publishable key for loadstripe for createToken and confirmCardSetup functions or i need two different publishable keys to loadStripe for each function?

hollow cargo
#

can i use the same publishable key for loadstripe for createToken and confirmCardSetup functions
You should use the same publishable key

mortal gull
#

So, in short you are saying it is correct to use same publishable key for loadStripe function to createToken and cardConfirmSetup

hollow cargo
#

Yes, and that publishable key should correspond to the account where you intend to create the token and the account where the SetupIntent was created server side/using your secret key

#

The reason you're getting the above error is because SetupIntent seti_1OMdoqKqvjOx1xht7p7eRGku was created on Account A but you're using Account B's publishable key when trying to confirm it.

mortal gull
#

One more thing i wanna added here, I am working on subscription on .net backend where i am using secret key. So, it might be possible it was different. Can we can go with successful if i use same previously secret key? If yes then it will work fine with that publishable key

#

I am trying to connect with subscriber account so on backend i am using with subscriber account secret key

hollow cargo
#

I can't say for sure. If you have an example request ID or subscription ID, I can let you know if the account used for that request corresponds to the publishable key you used for the failed request you shared above

mortal gull
#

on client side how can we get that subscriber account publishable key

hollow cargo
#

That question doesn't really make sense

#

Can you rephrase what you're still having an issue with and what your goal is?