Stripe·Fixpaymentsbeginner

Accidentally Charged Real Money in Stripe

Quick Answer

How do I fix Accidentally Charged Real Money in Stripe?

Live API keys (pk_live_, sk_live_) were used instead of test keys (pk_test_, sk_test_). Start with "Refund immediately" before making broader code changes.

Fix signals

What this answers
Why accidentally charged real money in stripe happens and what to change first.
Fastest move
Refund immediately
Use this page if
Real charges appearing in Stripe

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 causeLive API keys (pk_live_, sk_live_) were used instead of test keys (pk_test_, sk_test_).
Fastest fixRefund immediately
Use this page ifReal charges appearing in Stripe

You're in the right place if...

  • !Real charges appearing in Stripe
  • !Customers complaining about unexpected charges
  • !Live transactions in what should be test mode

Why this happens

Live API keys (pk_live_, sk_live_) were used instead of test keys (pk_test_, sk_test_).

Fix

1

Refund immediately

Stripe Dashboard → Payments → find the charge → click Refund. Refunds process within 5-10 business days.

2

Switch to test keys

Replace your env vars with test keys immediately:

# Switch ALL env vars to test keys:
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...

# Test keys start with pk_test_ and sk_test_
# Live keys start with pk_live_ and sk_live_

Prevent this next time

ALWAYS verify you're using test keys before running payment flows. Test keys start with pk_test_ and sk_test_.

Frequently Asked Questions

Stripe Dashboard → Payments → find the charge → Refund. Full or partial refunds are available.

Use separate environment variable files for dev (.env.local) and production (Vercel). Never put live keys in .env.local.

Related fixes