Testing

PayMongo provides a test environment that mirrors live mode as closely as possible — so you can build, break, and verify your integration without touching real money or real customer data. This page covers how the test environment works and the principles that apply across every product section. For test cases specific to a product, follow the links at the end of this page.

General testing principles

Test the full payment lifecycle, not just the happy path. A payment that succeeds is only one scenario. Test declines, authentication failures, refunds, disputes, and webhook delivery for each event type your integration handles. Untested edge cases are the most common source of production incidents.

Mirror your production configuration in test mode. Register test webhook endpoints that match your production handler logic. Use the same event subscriptions, the same error handling paths, and the same background job setup. The closer your test environment is to production, the more reliable your results.

Verify webhook delivery end-to-end. Use test mode to confirm your handler receives events, verifies signatures, deduplicates correctly, and processes events in the right order. Don't wait until you're live to find out your handler has a race condition.

Use the Dashboard event log during development. The Dashboard shows a delivery log for every webhook event — including the payload sent, the response received, and whether the delivery succeeded or was retried. Use this as your first debugging tool before checking server logs.

Graduate to live mode deliberately. Before switching to live keys, run through a complete checklist: signature verification is enabled, error handling covers every code your integration might encounter, duplicate delivery is handled, and your team knows how to rotate keys if needed. A gradual rollout — live keys in staging before production — gives you a final catch before real money is involved.