PAY GATE DOCS
Quickstart
Go from zero to a successful sandbox payment in under 30 minutes. Test mode never moves real money.
1. Create a merchant
Open the dashboard and use /dashboard/dev (or Clerk signup) to create a merchant. Copy the test secret key once — it is shown only at creation.
2. Create a PaymentIntent
curl -X POST http://localhost:4000/v1/payment_intents \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order_1001" \
-d '{
"amount": 1999,
"currency": "zar",
"description": "Demo order"
}'Response includes client_secret and checkout_url.
3. Complete hosted checkout
Open checkout_url. Choose Card or Instant EFT. Sandbox card tokens: succeed, fail, 3ds.
4. Receive webhooks
Register an endpoint in the dashboard. Events are signed with HMAC-SHA256:
PayGate-Signature: t=<unix>,v1=<hex>
verified = HMAC_SHA256(secret, "{t}.{rawBody}")Events: payment_intent.succeeded, payment_intent.failed, payment_intent.canceled, charge.refunded.
Authentication
- Secret keys:
Authorization: Bearer sk_test_…orsk_live_… - Publishable keys: checkout / client contexts only
- Always send
Idempotency-Keyon POST create calls
Payment methods (Phase 1)
- card — sandbox / card partner adapter
- instant_eft — SA Instant EFT partner adapter
- crypto — feature-flagged; disabled in live until CASP partner
Refunds
curl -X POST http://localhost:4000/v1/refunds \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"charge":"ch_...","amount":500}'PCI & compliance note
Do not send raw PAN/CVV to Pay Gate. Use hosted checkout or partner tokenization. Phase 1 routes funds through authorised partners; we are not a licensed bank/PSP until SARB authorisation / sponsorship is live.