#development
1 messages · Page 1 of 1 (latest)
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.
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.
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
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
What error do you see in frontend?
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"}
Ok. I think I know the problem. Mostly likely you are still using a test mode publishable key in your client app
Okay so the issue must be from the frontend and not the backend end?
Can you check your client code and see if you are using a test mode publishable key?
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
pk_test means it's a test mode publishable key. A live mode publishable key starts with pk_live
Yes correct,
now I am checking with pk_live
one quick question,
Can we create new publishable key?
Yes you can just roll it to create a new publishable key
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?
No it won't expire as long as you don't roll it
but if I set expired in 7 days I will not be able to use key after 7 days right?
That's the expiration for the old key. It means you can still use the old key for 7 days
Okay okay
got it.
than I can set it as now only
Done.
Thank you so much mate.
it is now working perfect
Sounds great! happy to help!