stripe setup help

I hate stripe. this is my first time putting a payment portal on a website, and im sure its way better than other things, but god it is so annyoing. I would happily pay someone $100 to just get stripe setup. with that out of the way, I am getting this error:
[ Server ] POST /operations/generate-checkout-session 400 620.376 ms - 597
[ Server!] Error: No such price: 'price_1...
[ Server ] POST /operations/generate-checkout-session 400 620.376 ms - 597
[ Server!] Error: No such price: 'price_1...
the price does indeed exist, but for some reason its not being found. I have no idea where to look to fix this
2 Replies
kapa.ai
kapa.ai5d ago
Hi @profmark. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I understand that setting up Stripe can be a bit challenging, especially if it's your first time. The error message you're seeing suggests that the price ID you're using in your code doesn't match any price ID in your Stripe account. Here are a few steps you can take to troubleshoot this issue: 1. Check your Stripe Dashboard: Make sure the price ID you're using in your code matches exactly with the price ID in your Stripe Dashboard. Price IDs usually start with 'price' followed by a series of alphanumeric characters. 2. Check your .env file: Ensure that the price ID in your .env file matches the one in your Stripe Dashboard. In the knowledge sources provided, the .env file contains price IDs like so:
HOBBY_SUBSCRIPTION_PRICE_ID=price_1OXkv5AHms7vVycMvx4PzB0N
PRO_SUBSCRIPTION_PRICE_ID=price_1OXkv5AHms7vVycM4IAAGRcT
HOBBY_SUBSCRIPTION_PRICE_ID=price_1OXkv5AHms7vVycMvx4PzB0N
PRO_SUBSCRIPTION_PRICE_ID=price_1OXkv5AHms7vVycM4IAAGRcT
3. Check your code: In your server-side code, make sure you're referencing the correct environment variable for the price ID. For example, in the knowledge sources, the price ID is used in the stripe.checkout.sessions.create method like so:
const session: Stripe.Checkout.Session = await stripe.checkout.sessions.create({
line_items: [
{
price: process.env.SUBSCRIPTION_PRICE_ID!,
quantity: 1,
},
],
// rest of the code
});
const session: Stripe.Checkout.Session = await stripe.checkout.sessions.create({
line_items: [
{
price: process.env.SUBSCRIPTION_PRICE_ID!,
quantity: 1,
},
],
// rest of the code
});
4. Check your Stripe CLI: Make sure you have the Stripe CLI installed and running. This tool helps you test your Stripe integration by forwarding webhook events to your local development environment. You can find more information about this in the Stripe Testing Guide (https://docs.opensaas.sh/guides/stripe-testing/). If you've checked all these and you're still having issues, it might be helpful to post your question on the Wasp Discord server (https://discord.com/channels/686873244791210014/1195406663633608754) or OpenSaaS GitHub repository (https://github.com/wasp-lang/open-saas/issues) for more specific help. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @prof_mark, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
prof_mark
prof_mark5d ago
ok i figured it out, i had used the public api key instead of the secret one...
Want results from more Discord servers?
Add your server