#development

1 messages · Page 1 of 1 (latest)

jolly nightBOT
humble junco
#

Hi there, as the error message explained. You are using a test mode key to make a request on a resource that was created in live mode.

#

I'd suggest you to check your secret key again.

hot iris
#

Hello Jack. thanks for reply back.

I am using the secret key only, what I did was I created new live secret key yesterday and set in the backend.

humble junco
hot iris
#

actually in log I am not getting any errors.

const { error } = await presentPaymentSheet()

I am getting error when I am calling this function.
and I am using react-native in the frontend

humble junco
#

What error do you see in frontend?

hot iris
#

Error: a similar object exists in live mode, but a test mode key was used to make this request

#

{"code": "Failed", "declineCode": null, "localizedMessage": "There was an unexpected error -- try again in a few seconds", "message": "No such payment_intent: 'pi_3MbMzfHc45h8j8XY1lKJ1M4R'; a similar object exists in live mode, but a test mode key was used to make this request.", "stripeErrorCode": "resource_missing", "type": "invalid_request_error"}

humble junco
#

Ok. I think I know the problem. Mostly likely you are still using a test mode publishable key in your client app

hot iris
#

Okay so the issue must be from the frontend and not the backend end?

humble junco
#

Can you check your client code and see if you are using a test mode publishable key?

hot iris
#

actually I just ran the code by changing the secret key to test mode and publishable key to pk_test and I am able to open the testing mode

#

let me once again change both keys and test it

humble junco
#

pk_test means it's a test mode publishable key. A live mode publishable key starts with pk_live

hot iris
#

Yes correct,
now I am checking with pk_live

#

one quick question,
Can we create new publishable key?

humble junco
#

Yes you can just roll it to create a new publishable key

hot iris
#

if the publishablekey is not used, will it get epxired?
and when I am trying to role it, it is showing me expires in 7 days
https://prnt.sc/GryCIoQL1Dc_

can't I keep like never expire or something like that?

Lightshot

Captured with Lightshot

humble junco
#

No it won't expire as long as you don't roll it

hot iris
#

but if I set expired in 7 days I will not be able to use key after 7 days right?

humble junco
#

That's the expiration for the old key. It means you can still use the old key for 7 days

hot iris
#

Okay okay
got it.
than I can set it as now only

#

Done.
Thank you so much mate.

#

it is now working perfect

humble junco
#

Sounds great! happy to help!