#4_leaf_clover_
1 messages · Page 1 of 1 (latest)
What do you mean? Can you be more specific about what you're trying to do?
Of course. I was testing in "Test mode" before, and now I want to transition to live mode. In my dashboard, I can see this panel that implies that live integration is not complete. It says I should use the live secret key (I am already using this) and the publishable key (I am not using this).
I am concerned because I am getting this 401 error:
You might think it's because my products (and hence the price ID I am using in the request) are in test mode, but no, they are in live mode. The price ID you see in that request is from a product that is in live mode.
I think the UI you're looking at is just implying that you haven't made a live mode payment yet. Was this working in test mode before?
Yes everything was working in test mode
It says "step 3/4", do you know what the 4th step is? Maybe I have to do that.
You should just be able to copy/paste your API keys into your code where you were using them before and they should just work
Can you search your codebase for the key's prefix sk_test and pk_test?
I already replaced the secret key. I'm not using a publishable key.
Do I need to use a publishable key?
If so, where should it go? I was not using it in test mode and everything was working.
I mean, there's no way for me to know that. Only you would know that. Usually you do need a publishable key if you have a full payment setup, but I have no idea what your integration looks like. What API calls are you making? When you search them in the API reference (s://stripe.com/docs/api), does the code snippet example show a publishable or a secret key?
I am only using CreateCheckoutSession. I don't see a publishable or secret key here:
Okay, so the issue is likely internal for you. That error in your screenshot is not a Stripe error
👋 @celest rampart
Your code is taking a Price id which is price_1NZwjAGqz37O9TXyOGmCx5rf in your picture, and then using it to create a Checkout Session via the API https://stripe.com/docs/api/checkout/sessions/create
right now you are getting a real API error from Stripe but your code is not handling that error at all so you're only showing a vague 400 without much details
You need to carefully read https://stripe.com/docs/error-handling which walks you through how our API errors work, how to properly catch and log them, etc.
Additionally, you're the developer and you can see all API requests you make to Stripe straight in your Logs under the Developers view in the Dashboard. If you load https://dashboard.stripe.com/test/logs you will see the most recent request failed with a clear error right now
You seem to be using a Price id that exists in Live mode but your server-side code uses the Test mode Secret API key sk_test_123.
You likely mixed up your ids somewhere
Also, since your code doesn't do any error handling, it's likely not ready for production. If you just cloned one of our sample apps and are trying it in Live mode, you're going to hit a lot of problem and this is something we do not support and really shouldn't happen
@celest rampart does that make sense?