ChargeForms
Payments & Integrations

Stripe Test Mode

Build and test payment forms safely with Stripe test keys and test card numbers, before ever touching real money.

Ask AI about this:

Stripe test mode lets you build, test, and demo a complete payment flow — including real charge/decline/refund behavior — without moving any actual money. Every ChargeForms payment form should be built and tested this way first.

Getting your test keys

In the Stripe Dashboard, make sure the Test mode toggle (top right) is on, then go to Developers → API keys. You'll see a test Publishable key (starts with pk_test_) and a test Secret key (starts with sk_test_) — copy both.

In WordPress, go to ChargeForms → Global Settings → Payment Settings and paste them into the Stripe fields, with the mode set to Test. This is independent of your live keys — you can have both saved and switch between them by toggling the mode, without losing either set of credentials.

Test card numbers

Stripe provides dedicated card numbers that simulate specific outcomes, documented in full at Stripe's testing docs. The ones you'll use most:

NumberSimulates
4242 4242 4242 4242A successful payment
4000 0000 0000 0002A card that's declined
4000 0025 0000 3155A card requiring 3D Secure authentication

Use any future expiry date and any 3-digit CVC (any 4-digit for Amex-format test numbers) — these fields aren't validated against real data in test mode.

What to actually test

Beyond "does a successful payment work," it's worth deliberately testing the failure paths too, since these are the cases real users will eventually hit:

  • A declined card (4000 0000 0000 0002) — confirm the form shows a clear error and doesn't create a submission that looks like it succeeded.
  • A duplicate/repeated submission — submit the same form twice quickly and confirm you don't get double-charged or double-counted entries.
  • The confirmation flow — whatever happens after a successful payment (a thank-you message, a redirect, an email) should be tested with a real test-mode success, not assumed to work because the payment itself succeeded.

Switching to live mode

Once testing is done, go back to Payment Settings, add your live publishable and secret keys (from the Stripe Dashboard with Test mode toggled off), and switch the mode from Test to Live. The form itself doesn't need any changes — only the credentials and mode setting change, so there's no risk of accidentally rebuilding the form incorrectly during the switch.

Verify with one small real transaction after switching (refundable, or to yourself) before considering the form fully launched — test mode and live mode occasionally surface different edge cases (like currency formatting or region-specific payment methods) that are worth catching before real customers do.