Lovable api

Stripe Test vs Live Mode Confusion

Test payments work but production payments fail. Using test keys in production or live keys in development. Webhooks not firing in right environment. Keys mixed up causing transaction failures.

Stripe has separate test and live environments with different keys. Mixing keys between environments breaks payment flow.

Error Messages You Might See

Invalid API Key provided Authentication required Key error: test key used in production
Invalid API Key providedAuthentication requiredKey error: test key used in production

Common Causes

  1. Using test keys in production API calls
  2. Using live keys in development (risky!)
  3. Environment variables not switched between dev/prod
  4. Test webhook secret used with live key
  5. Not checking API in right mode in Stripe dashboard

How to Fix It

Use environment-specific keys:

// .env.development
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_...

// .env.production
VITE_STRIPE_PUBLISHABLE_KEY=pk_live_...

Always verify mode in Stripe dashboard toggle. Use test cards for development: 4242 4242 4242 4242.

Real developers can help you.

Jaime Orts-Caroff Jaime Orts-Caroff I'm a Senior Android developer, open to work in various fields zipking zipking I am a technologist and product builder dedicated to creating high-impact solutions at the intersection of AI and specialized markets. Currently, I am focused on PropScan (EstateGuard), an AI-driven SaaS platform tailored for the Japanese real estate industry, and exploring the potential of Archify. As an INFJ-T, I approach development with a "systems-thinking" mindset—balancing technical precision with a deep understanding of user needs. I particularly enjoy the challenge of architecting Vertical AI SaaS and optimizing Small Language Models (SLMs) to solve specific, real-world business problems. Whether I'm in a CTO-level leadership role or hands-on with the code, I thrive on building tools that turn complex data into actionable value. Bastien Labelle Bastien Labelle Full stack dev w/ 20+ years of experience Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. Daniel Vázquez Daniel Vázquez Software Engineer with over 10 years of experience on Startups, Government, big tech industry & consulting. Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. Dor Yaloz Dor Yaloz SW engineer with 6+ years of experience, I worked with React/Node/Python did projects with React+Capacitor.js for ios Supabase expert Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Matthew Jordan Matthew Jordan I've been working at a large software company named Kainos for 2 years, and mainly specialise in Platform Engineering. I regularly enjoy working on software products outside of work, and I'm a huge fan of game development using Unity. I personally enjoy Python & C# in my spare time, but I also specialise in multiple different platform-related technologies from my day job. legrab legrab I'll fill this later

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

What are Stripe test cards?

Use 4242 4242 4242 4242 for success, specific numbers for failures. See Stripe docs for test card list.

How do I switch to live mode?

In Stripe dashboard, toggle 'Test mode' off. Use live keys in production environment only.

Related Lovable Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help