Card test mode
Your sk_test_ key, the same routes, no real cards and no real money.
curl https://api.paymonetra.com/v1/cards/crd_8a31f0c2d9b4e7/simulate \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{ "amount": 12500, "channel": "pos", "outcome": "approve" }'const url = 'https://api.paymonetra.com/v1/cards/crd_8a31f0c2d9b4e7/simulate'
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Bearer ' + process.env.PAYMONETRA_SECRET_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 12500,
channel: 'pos',
outcome: 'approve',
}),
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)$ch = curl_init('https://api.paymonetra.com/v1/cards/crd_8a31f0c2d9b4e7/simulate');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('PAYMONETRA_SECRET_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'amount' => 12500,
'channel' => 'pos',
'outcome' => 'approve',
]),
]);
$result = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($result['error']['message']);
}#The three outcomes
POST /cards/{card_ref}/simulate with amount, and optionally merchant, channel (web, pos, atm) and outcome:
approve(default): runs the real approval and sends the webhooks;decline_after_approval: approved, then reversed with the money back (naira cards);refund: approved, then refunded by the shop.
#Test money
POST /sandbox/card_funding with currency and amount. NGN arrives at your test funding account and USD at your test USDT address, like real deposits.
#Identity numbers
| Number | Type | Result |
|---|---|---|
22222222222 | BVN | Passes with any name |
11111111111 | NIN | Passes with any name |
22222222200 / 11111111100 | BVN / NIN | Name doesn't match |
22222222404 / 11111111404 | BVN / NIN | Not found |
22222222503 / 11111111503 | BVN / NIN | Check unavailable (nothing charged) |
#Forcing a pending or failed card
- Card creation: a
referencestartingtest_pendinganswers202and the card turns active a minute later. One startingtest_failanswers502.
Card details links show a test card marked TEST.
What a test key separates on the rest of the API: test mode.