Lovable·Fixpaymentsbeginner

Lovable Stripe Checkout Fails or Cards Are Declined

Quick Answer

How do I fix Lovable Stripe Checkout Fails or Cards Are Declined?

Using live Stripe keys instead of test keys, or missing STRIPE_WEBHOOK_SECRET in Vercel environment variables. Start with "Verify test mode" before making broader code changes.

Fix signals

What this answers
Why lovable stripe checkout fails or cards are declined happens and what to change first.
Fastest move
Verify test mode
Use this page if
Payment form shows but card is declined

If this keeps happening

Open the next decision, not just the patch

Use these when the current fix is helpful, but the real answer is a better tool choice, a cleaner workflow layer, or a more trustworthy launch path.

Quick Fix Summary

Most likely causeUsing live Stripe keys instead of test keys, or missing STRIPE_WEBHOOK_SECRET in Vercel environment variables.
Fastest fixVerify test mode
Use this page ifPayment form shows but card is declined

Exact errors people search for

If one of these matches what you are seeing, you are likely on the right fix page.

Payment form shows but the card is declined
Stripe checkout redirects to an error page
Stripe dashboard shows no test payments after checkout

You're in the right place if...

  • !Payment form shows but card is declined
  • !Checkout redirects to error page
  • !Stripe dashboard shows no test payments

Why this happens

Using live Stripe keys instead of test keys, or missing STRIPE_WEBHOOK_SECRET in Vercel environment variables.

Fix

1

Verify test mode

Stripe Dashboard → toggle 'Test mode' on (top right) → Developers → API keys. Keys should start with pk_test_ and sk_test_. If they start with pk_live_, you're in live mode.

2

Add all Stripe vars to Vercel

Go to Vercel → Settings → Environment Variables and add:

NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
3

Test with Stripe's test card

Use this card number for testing:

Card: 4242 4242 4242 4242
Expiry: any future date (e.g. 12/34)
CVC: any 3 digits (e.g. 123)

Prevent this next time

Always start with test keys (pk_test_, sk_test_). Only switch to live keys after everything works perfectly in test mode.

Frequently Asked Questions

Test keys start with pk_test_ and sk_test_. Live keys start with pk_live_ and sk_live_. Check in Stripe Dashboard → Developers.

Stripe Dashboard → Developers → Webhooks → your endpoint → Signing secret. Starts with whsec_.

Related fixes