- endpoints
- 77
- payments through virtual accounts
- outcomes
- 5
- every failure path is reachable
- capabilities
- 12
- enforced per organization
- test cards
- 16
- numbers are never stored
- currencies
- 159
- real ISO 4217 exponents
Quickstart
Make a payment in one call
Amounts are integers in minor units, so 250000 NGN is
2,500.00. Send scenario to decide the outcome, or let the
card number or your reference decide it for you.
curl -X POST http://feignpaygate.craftsmanjohn.com/api/v1/payments \
-H "X-Feign-Key: fpn_sk_test_wfx22fvpev5aolaeu23sz5kr" \
-H "X-Feign-Signature: t=$(date +%s),v1=$(...)" \
-H "Content-Type: application/json" \
-d '{"amount":250000,"currency":"NGN","scenario":"success"}'
{
"object": "payment",
"id": "pay_8f2c1a94de7b0356",
"status": "succeeded",
"amount": 250000,
"amount_captured": 250000,
"amount_refunded": 0,
"currency": "NGN",
"fee": 3750,
"net": 246250,
"instrument": "card",
"capture_method": "automatic",
"reference": "order-1001",
"webhook_url_source": "request",
"decline_code": null,
"livemode": false,
"created_at": 1799155200
}
curl http://feignpaygate.craftsmanjohn.com/api/v1/project \ -H "X-Feign-Key: fpn_sk_test_wfx22fvpev5aolaeu23sz5kr"
A public key reads. A secret or restricted key needs an HMAC of
<timestamp>.<body> within 15 minutes.
node scripts/sign.mjs prints ready to paste headers.
The seeded project is proj_mefety1o22ug6f44.
The surface
What it simulates
Every group below is a real set of endpoints, not a description of one. Follow any of them into the reference for the parameters and the error codes.
-
2
endpoints
Project and keys
What the sandbox knows about itself, and which credentials exist.
-
6
endpoints
Payments
Create and inspect payments. The outcome of a payment is decided by the scenario engine, not by the amount or the card.
-
2
endpoints
Hosted checkout
A checkout session turns a payment into a hosted page the payer can be redirected to. This is the path an integration should test against, since it exercises the same redirect handling a real provider has.
-
4
endpoints
Refunds
Full and partial refunds, in flight or settled.
-
8
endpoints
Payouts and beneficiaries
Money out. Payouts settle through the scheduler unless cancelled in time.
-
7
endpoints
Disputes
A cardholder disputes a payment. Both resolution branches are reachable without waiting for a review window.
-
4
endpoints
Transfers
Move money between objects inside the sandbox. Settles through the scheduler and is reversible.
-
6
endpoints
Customers
The payer record. Everything else hangs off a customer.
-
5
endpoints
Payment methods
Saved instruments, reusable on a charge. Only a token is stored, never a card number.
-
11
endpoints
Plans and subscriptions
Recurring billing with a dunning schedule, so the unpaid path is reachable without waiting.
-
8
endpoints
Wallets
Stored value. A debit that would overdraw is refused, never allowed to go negative.
-
5
endpoints
Virtual accounts
A unique account number per customer. Funding it credits the linked wallet.
-
5
endpoints
Webhooks
Events are delivered over real HTTP with an HMAC signature and retried on a backoff. These endpoints let you inspect and replay what was sent.
Failure paths
Reach the failures on purpose
The scenario engine decides what a simulated request does, in this order: the
scenario you sent, then a magic reference prefix, then a
magic card number, then your database rules, then the project default. First match wins.
-
successCaptures immediately and emits payment.succeeded.
-
failureDeclines with a failure code, synchronously.
-
3dsStops at requires_action and hands back a hosted checkout URL.
-
pendingStays processing until the scheduler settles it.
-
3ds_then_failureChallenges, passes the code, then declines anyway.
Trigger one without sending a parameter
| Reference starts with | What happens | Outcome |
|---|---|---|
| ref_3ds_ | Forces a 3DS challenge | 3ds |
| ref_fail_ | Forces a decline | failure |
| ref_pending_ | Forces an async settlement | pending |
| ref_3ds_fail_ | Passes the challenge, then declines | 3ds_then_failure |
| ref_slow_ | Forces an async settlement | pending |
GET /api/v1/scenarios returns all of this as JSON, and it
needs no credentials, so you can read it before you have a key.
Test data
Test cards
Card numbers are never stored. Only the brand, last four, BIN, and expiry are kept.
| Card number | Behaviour |
|---|---|
| These force an outcome | |
| 4000 0000 0000 0002 | Your card was declined. |
| 4000 0000 0000 3220 | 3ds |
| 4000 0000 0000 3063 | 3ds |
| 4000 0000 0000 3055 | Your card has insufficient funds. |
| 4000 0000 0000 0119 | Your card has expired. |
| 4000 0000 0000 0259 | Your card is incorrect. |
| These just succeed | |
| 4242 4242 4242 4242 | visa, expires 12/30, CVC 123 |
| 5555 5555 5555 4444 | mastercard, expires 12/30, CVC 123 |
| 3782 8224 6310 005 | amex, expires 12/30, CVC 1234 |
| 6212 3456 7890 1232 | verve, expires 12/30, CVC 123 |
Hosted checkout
A checkout you can redirect a payer to
Create a checkout session and you get a URL. It renders card, bank transfer, and mobile money forms, a 3DS challenge with a known code, and result pages that redirect back to you. This is the path worth testing against, because it exercises the same redirect handling a real provider has.
- The 3DS code is
123456. Anything else tests your failure path. - Device enrolment is opt in, for integrations that handle a second challenge.
- Expiry, cancellation, and already-completed sessions all have a defined answer.
- 1Create a session, get a URL
- 2Payer enters a card or picks a rail
- 33DS challenge, if the card asks
- 4Redirect to your
redirect_url - 5Signed webhook arrives at your endpoint
Webhooks you can actually debug
Delivery is real HTTP with an HMAC signature on every attempt. Failures retry on a 1m, 5m, 30m, 2h, 12h backoff and then dead letter. Every attempt is logged with the status code your receiver returned, and any event can be replayed.
Money arithmetic that does not drift
Amounts are integers in minor units and the exponent comes from the ISO 4217 code rather than being assumed, so JPY is 0 decimals and KWD is 3. Refunds reserve against the payment, and a wallet refuses to overdraw.
Multi tenant
Organizations with enforced capabilities
An organization owns projects, and its capability set and currency allow-list apply to all of them. The guard runs at the request boundary, so a disabled capability is refused before the request reaches a handler rather than behaving oddly.
-
paymentsCreating and inspecting payments -
checkoutHosted checkout sessions and the payer facing pages -
refundsRefunding a payment -
payoutsSending money out to beneficiaries -
transfersMoving money between objects -
disputesOpening and resolving disputes -
customersManaging the payer records -
payment_methodsSaving and reusing instruments -
subscriptionsPlans and recurring billing -
walletsStored value balances -
virtual_accountsUnique account numbers that credit a wallet -
webhooksEvent delivery, including replay
Configure them at /console/organizations. The seeded
organization predates the feature, so nothing is restricted until you save.
Before you rely on it
What this is not
- It moves no money. There is no network, no processor, no settlement.
- It is not secure. No rate limiting, no audit trail, no encryption at rest, and plain text credentials.
- The console login is not hardened. There is no rate limiting or lockout, and it prints your keys, so keep it off the open internet.
- It is a test harness. Run it somewhere isolated, never as your production gateway.