Blog ·

Stripe checkout works in test mode but not live? Here is what to check

You built your app with Lovable, Bolt, Cursor or Replit, added Stripe, and paid with the test card. Everything worked. Then you switched to real payments and checkout started failing: an error when someone clicks Buy, a payment page that never loads, or people who pay but never get access. Most customers won't tell you. They just leave.

The short answer

Stripe keeps test and live completely separate. According to Stripe's docs, each mode has its own set of API keys, and objects in one mode aren't accessible in the other. Webhook endpoints and their signing secrets are set up per endpoint too. So switching only the secret key is rarely enough. A checkout that works in test and fails live almost always still has one test value left somewhere: a key, a price ID, or a webhook secret.

Check them in this order: keys, prices, webhooks, then whether your live site is actually running the new settings.

1. Check both keys are live keys

Stripe's key prefixes tell you which mode a key belongs to:

  • Test keys start with pk_test_, sk_test_ or rk_test_
  • Live keys start with pk_live_, sk_live_ or rk_live_

Your app usually uses two keys, and both have to be live:

  • The publishable key (pk_live_...) is used in the browser. Stripe says it is safe to include in front-end code.
  • The secret or restricted key (sk_live_... or rk_live_...) is used on your server. Stripe says not to put it in your source code. Keep it in your host's secrets vault or environment variables.

Look at the values your live site actually uses, in your host's settings, not the .env file on your computer. If you find a secret key written into your code, move it out before going live, as Stripe's docs advise.

2. Swap test price IDs for live ones

Products and prices you created in test mode don't exist in live mode. Stripe's go-live checklist says objects created in a sandbox, such as products and plans, aren't usable in live mode. A price ID copied while testing (price_...) will fail with a live key. The error people report starts with "No such price", often followed by a note that a similar object exists in the other mode.

Create the products and prices in live mode, then put the live price IDs into your app. If your AI tool wrote a price ID straight into the code, search the code for price_ and replace it.

3. Set up a live webhook and use its signing secret

If your app unlocks paid features, sends receipts or saves orders when Stripe tells it a payment succeeded, it relies on webhooks. Stripe's docs say your account can have both test and live webhook endpoints, so a test endpoint does nothing for live payments. Without a live one, customers pay and get nothing.

  1. In live mode, open Workbench in your Stripe Dashboard, go to the Webhooks tab and click Add destination.
  2. Choose the same events your test endpoint receives, pick Webhook endpoint as the destination type, and enter your production URL. Stripe requires HTTPS for live webhook endpoints.
  3. Copy the new endpoint's secret (it starts with whsec_) into your production settings. Stripe's docs say signing secrets belong to each endpoint, are separate from your API keys, and need to be copied again when you switch to live.

If your logs show "No signatures found matching the expected signature for payload", Stripe says the most common cause is the wrong endpoint secret. The next most common is code that changes the request body before checking the signature: Stripe needs the raw body exactly as it was sent.

To see what is happening, open the live endpoint in Workbench in your Stripe Dashboard and check its Event deliveries tab. It shows each event as Delivered, Pending or Failed, with the status code your app returned.

4. Make sure your live site is using the new values

On Vercel, changing an environment variable does not change the site that is already running. Vercel's docs say changes only apply to new deployments, and a Production variable is applied to your next production deployment. So after you swap in live keys, prices or the webhook secret, redeploy to production, then test again.

Built with Lovable?

Lovable has two ways to take payments, and the fix depends on which one you used.

Your own Stripe account (you pasted in a Stripe key). Lovable's docs say the key you submit decides the mode, and the project uses one key at a time. To go live:

  1. Ask Lovable to update your Stripe key and submit a live key in the Update Stripe secret key form. Never paste the key into the chat itself.
  2. Confirm your products and prices exist in live mode in Stripe. Price IDs differ between test and live, so ask Lovable to switch your app to the live price IDs.
  3. Run a real purchase on your published app.

This setup doesn't use webhooks unless you asked for them. If you did, you create the live endpoint and copy its signing secret yourself, as in step 3 above. If checkout fails with an error, Lovable's docs say to read the checkout function's logs (More, then Settings, then Logs on the built-in backend, or Edge Functions logs in Supabase if you use your own Supabase project) and the failed request in your Stripe Dashboard logs, then paste the error into the chat and ask Lovable to fix it.

Lovable's built-in payments. Lovable manages the keys, webhooks and the test and live environments for you. Its docs say live checkout will not work until every step of the go-live checklist in the Payments tab is complete, including claiming and finishing onboarding for the Stripe account and passing the readiness check (privacy policy, terms of service and refund policy on your site). Lovable also says not to delete or disable the webhook endpoints it registered: if your app's endpoint goes, purchases still succeed but features never unlock.

Test the real path once

Test cards only prove test mode. Stripe's go-live checklist asks you to confirm your live webhook endpoint works exactly the same as your test one, and Lovable's docs end their go-live steps with a real purchase on the published app. Do one real purchase yourself at your lowest price, then check that the payment shows in Stripe, the webhook delivery succeeded, and your account in the app unlocked.

Catch silent breaks before your users do

A checkout that fails quietly looks fine from the outside. FlowCanary's scheduled monitoring is launching by 30 November 2026. Once it is live, it will test the flows a new visitor can do in your app, such as sign-up and checkout, in a real browser on a schedule, with logged-in flows on Pro, and send you a plain-English alert plus a fix prompt for Lovable, Bolt, Cursor or Replit when something breaks. Until then, you can run a free check today: it loads your page in a real browser and reports JavaScript errors and failed requests. It does not submit payments.

Sources (checked 22 October 2026)

Run the free checker