Test Payments
Build and test your whole integration with your test keys. No real money moves, and you can trigger every outcome on purpose.
Test mode
Every request made with a wg_sk_test_ or wg_pk_test_ key runs in test mode. Test mode works exactly like live mode: the same endpoints, responses, checkout and webhooks. The only difference is that no Mobile Money prompt reaches a real phone, and no real money moves.
Your test keys are on the API & Sandbox page of your dashboard as soon as you open Wire Pay. You do not need to activate your business to use them.
Test Mobile Money numbers
Use these numbers on the checkout, the popup or the Charge API to get each result:
| Number | Network | Charge status | What happens |
|---|---|---|---|
0551234987 | MTN | success | Approved at once. |
0551234988 | MTN | failed | Declined by customer. |
0551234989 | MTN | pay_offline | Stays waiting for approval, then fails when the transaction times out. Use it to test your timeout handling. |
0201234987 | Telecel | success | Approved at once. |
0201234988 | Telecel | failed | Insufficient funds. |
0261234987 | AirtelTigo | success | Approved at once. |
0261234989 | AirtelTigo | pay_offline | Approves about 20 seconds later. Use it to test webhooks and status checks. |
Any other valid Ghana Mobile Money number succeeds in test mode.
curl https://api.wiregh.com/charge \
-H "Authorization: Bearer YOUR_TEST_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "test@email.com",
"amount": 1000,
"mobile_money": {
"phone": "0261234989",
"provider": "airteltigo"
}
}' \
-X POSTconst response = await fetch('https://api.wiregh.com/charge', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_TEST_SECRET_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'test@email.com',
amount: 1000,
mobile_money: {
phone: '0261234989',
provider: 'airteltigo'
}
})
});
const result = await response.json();
console.log(result);<?php
$ch = curl_init('https://api.wiregh.com/charge');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'email' => 'test@email.com',
'amount' => 1000,
'mobile_money' => [
'phone' => '0261234989',
'provider' => 'airteltigo',
],
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_TEST_SECRET_KEY',
'Content-Type: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($result);Test Wire Gh wallets
On the checkout or popup, open the Wire Gh Wallet tab and use these numbers. No SMS is sent in test mode: the code is always 123456 and the wallet PIN is always 1234. Test mode never touches real wallets.
| Number | What happens |
|---|---|
0244000001 | Has enough balance. The payment succeeds. |
0244000002 | Balance too low. The attempt is declined and the customer can try another method. |
0244000003 | Wallet is frozen. The payment is refused. |
Any other number behaves like a number with no Wire Gh account: the code never works.
Test webhooks
Add a test webhook URL on your dashboard and make a payment with any test number. Test events are signed with your test secret key. To try your webhook handler on your own computer, expose it with a tunnelling tool that gives you a public HTTPS address, since we cannot reach local addresses.
Test refunds
Refunds on test transactions complete at once with status processed and send a refund.processed webhook. They come out of your test balance.
Before you go live
Make sure your integration handles each of these:
- a successful payment, verified on your server before you give value;
- a declined payment and a payment with insufficient funds;
- a customer who never approves the prompt;
- a payment that succeeds after your customer has left the page, delivered by webhook;
- the same webhook arriving twice;
- a full and a partial refund.
Then read Going live.