Skip to content
Every tutorial here is 100% free — and always will be
LSLovableStudent

How do I test payments?

Last checked 31 Aug 2026

Short answer

Run a real Stripe test-mode transaction end to end — checkout, webhook, database update and confirmation email — before switching to live keys.

Why this needs a full end-to-end test

A payment "succeeding" on screen isn't enough — you need to confirm the money, the order record, and any downstream effect (access granted, email sent) all actually happen together.

Steps to test

  1. Use Stripe test mode first, with Stripe's published test card numbers, to run through checkout without real money.
  2. Confirm the webhook fires and updates your database — e.g. an order marked paid, or a subscription flag set — not just that Stripe shows "succeeded".
  3. Check the confirmation email (if you send one) actually arrives.
  4. Test a failed/declined card using Stripe's test decline numbers, and confirm your app shows a clear error rather than silently failing.
  5. Test a refund in test mode if refunds are part of your flow.
  6. Switch to live keys only once test mode is fully confirmed, and store the live secret key server-side (never in front-end code).
  7. Run one real, small live transaction yourself post-launch to confirm production actually works end to end.

A prompt to check the webhook logic

Walk me through what happens when the Stripe webhook receives a successful payment event — confirm it verifies the Stripe signature and updates the correct database row.

What usually goes wrong

  • Webhook signature verification skipped, so anyone could fake a "payment succeeded" event by calling your endpoint directly.
  • Forgetting to switch the webhook endpoint URL and secret from test mode to live mode.
  • Granting access purely from the client-side redirect after checkout instead of waiting for the server-confirmed webhook — a closed browser tab can leave a paid user without access.
  • Not testing what happens on a declined card or an abandoned checkout.

For non-trivial payment logic, get it reviewed — PromptSites.com can check a Stripe integration before you go live.

Sources

Was this answer helpful?

Related questions

Website made, maintained and hosted by PromptSites.com

PromptSites logo