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

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:

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.