Test mode
Test mode lets you build and verify your full integration — payment creation, checkout redirect, and webhooks — without real money, a paired phone, or ever contacting a real payment provider.
How it works
- Create a Test key under API Keys in the merchant panel — it starts with
fk_test_. - Payments created with a test key have
"livemode": falseand show a TEST MODE banner on the checkout page. - On checkout, the customer (you) can enter any TrxID and sender number — the payment completes immediately, skipping SMS verification.
- For gateway-based methods (bKash PGW, Nagad, Upay, SSLCommerz, EPS), test mode never sends a request to the real provider — the payment completes locally without a gateway call.
- Webhooks fire exactly like production, so you can test your
payment.completedhandler end to end. - Test payments never count toward your plan's transaction limit and are excluded from dashboard revenue. Filter them with the Mode filter on the Payments page, or switch the Reports page to Test mode to see test-only summaries and breakdowns.
Mode isolation
A test key can only see and act on payments created in test mode, and a live key can only
see and act on live payments — this applies to listing (GET /payments),
looking up a single payment (GET /payments/{id}), refunding
(POST /payments/{id}/refund), and idempotent retries by
invoice_number. A test key can never read or refund a live payment (and a live
key can never touch a test one), even if it somehow has the payment's reference or reuses
the same invoice_number.
Typical workflow
# 1. Create a test payment
curl -X POST https://pay.codeappear.com/api/v1/payments \
-H "Authorization: Bearer fk_test_..." \
-H "Content-Type: application/json" \
-d '{"amount": 100, "invoice_number": "TEST-1", "metadata": {"order_id": "TEST-1"}}'
# 2. Open data.checkout_url in a browser, pick a provider,
# submit any TrxID (e.g. TEST123456) and number (e.g. 01512345678)
# 3. Watch your webhook receive payment.completed with "livemode": false
Test mode vs. gateway sandbox mode
These are two independent settings — don't confuse them:
- Test mode (this page) is set by which API key created the payment (
fk_test_vsfk_live_). It skips the gateway entirely — no network request is made to any provider. - Gateway mode is a per-payment-method setting (Sandbox or Live) you configure on your bKash/Nagad/Upay/SSLCommerz/EPS payment method in the merchant panel. It only applies to live (non-test) payments, and controls whether the real gateway call is sent to the provider's sandbox or production environment — useful for testing your gateway credentials before going fully live.
Going live
Swap the key for an fk_live_ one. Everything else — endpoints, payloads,
signatures — is identical. Live payments require an active subscription, an active MFS
account, and a paired phone to verify SMS.