Testing
Test mode is a full copy of Biftpay with fake money. Use a bp_test_ key and everything you create (payments, customers, payouts, webhooks) lives only in test mode. Live keys (bp_live_) never see test data, and the other way round.
Test cards#
Use these at checkout with any future expiry date, any 3-digit CVC and any name.
| Card number | What happens |
|---|---|
4000 0000 0000 0002 | Approved. |
4000 0000 0000 0119 | Declined: insufficient funds. |
4000 0000 0000 0556 | Declined. The customer can try another card. |
4000 0000 0000 0663 | The bank takes a while: the payment stays processing and succeeds about 20 seconds later. |
4000 0000 0000 0770 | 3-D Secure. Checkout asks for the code from the customer's bank: 123456 approves, any other code fails, and Cancel gives up. Nothing is taken unless the code is right. |
Any other card number is declined. In test mode, checkout lists these cards under Test cards so you can tap one to fill it in.
Bank transfers#
Choose Bank transfer at checkout to get a test account number. Then press Simulate sending ₦… on the same page: the transfer "arrives", the payment becomes successful and you get the webhook, just as with a real transfer.
Test bank accounts#
When you add a payout account in test mode, the last digits of the account number decide what happens:
| Account number ends in | What happens |
|---|---|
0000 | The bank can't find the account (name enquiry fails). |
7777 | The payout is rejected. |
8888 | The payout stays processing. |
9999 | The payout fails after it's sent; the money goes back to your available balance. |
| anything else | Paid. |
Refunds in test mode: an amount ending in 13 kobo is rejected, and one ending in 17 stays pending for a while before it succeeds.
Test helpers#
Some things take time in real life: money moving from pending to available the next business day, or settlement waiting for 08:00. Test helpers make them happen now, so your automated tests don't wait. They only work with test keys.
| Helper | What it does |
|---|---|
POST /v1/test_helpers/payment_intents/{id}/succeed | Marks a payment successful, as if the customer paid at checkout. |
POST /v1/test_helpers/virtual_accounts/{id}/simulate_transfer | Pretends a customer sent money to one of your virtual accounts. |
POST /v1/test_helpers/balance/release_pending | Moves everything pending to available now. |
POST /v1/test_helpers/settlements/run | Runs automatic settlement for your account now. |
Each one sends the same webhooks the real thing would, so you can test your whole flow end to end. For card and bank transfer payments, use checkout itself: the test cards and Simulate sending above. Payouts in test mode are sent and confirmed by themselves within a few seconds. See the helpers in the API reference.