Overview
Testing is crucial for ensuring your integration works correctly before going live. HOST Pay provides a complete Test Mode environment that mirrors production functionality without processing real money.Test Mode Features
Mock Services
Simulated payment providers
Isolated Data
Separate test database
Full API Access
All endpoints available
Webhook Events
Real webhook notifications
Getting Test Credentials
1
Log In
Access the HOST Pay dashboard
2
Select Application
Navigate to your application
3
Get Test Keys
Generate Test Mode API credentials
4
Store Securely
Save in environment variables
Test Mode Payment Methods
Mobile Money (Monime)
In Test Mode, mobile money uses MockMonimePaymentService:- ✅ Instant mock responses
- ✅ No real money involved
- ✅ Predictable behavior
- ✅ Webhook events triggered
Magic test numbers
In Test Mode, the outcome of a mobile-money deposit is driven by the user’s phone number — no second API call needed. Create a user with one of these numbers, then any deposit into that user’s wallet resolves deterministically (the wallet is credited/failed and your webhook fires, just like production):
For payouts (
/transactions/wallet/mobile-money-cashout/), the same magic
numbers apply to the recipient phone_number in the request — so you can
trigger a decline per-transaction without pre-configuring a user:
Test Mode payouts settle immediately, so there is no merchant-controlled
“pending” payout — only
+23299000002 changes the outcome (a decline); every
other number completes.For the This endpoint is available in every environment (including the hosted
sandbox) but only accepts Test Mode credentials — a Live Mode key is
rejected with
+23299000009 (pending) case, or to complete a pending deposit
manually, call the completion endpoint directly:403. Magic numbers and this endpoint never affect Live Mode.Card Payments (Stripe)
Test Mode uses Stripe’s test card numbers: Success Cards:- Future expiry date (e.g., 12/30)
- Any 3-digit CVC (e.g., 123)
- Any billing address
Test Scenarios
Scenario 1: Happy Path
Test the complete user flow:Scenario 2: Error Handling
Test error cases:Scenario 3: Wallet Transfers
Test peer-to-peer transfers:Testing Webhooks
Local Testing with ngrok
1
Install ngrok
bash # Download from ngrok.com or npm install -g ngrok 2
Start Your Server
bash python app.py # or node server.js 3
Create Tunnel
bash ngrok http 3000 4
Configure Webhook
Add the ngrok URL to your dashboard:
https://abc123.ngrok.io/webhooks/hostpay5
Test
Make a transaction and verify webhook delivery
Webhook Testing Example
Test Data Management
Cleaning Up Test Data
Automated Testing
End-to-End Smoke Test
The SDK repository ships a runnable smoke test (examples/smoke_sdk.py) that walks the full money path — user →
wallet → deposit → transfer → escrow → payout — against a Test Mode instance
and asserts each step:
Writing Your Own Tests
Use the Python SDK with Test Mode credentials — deposits complete instantly via the magic numbers, so integration tests stay fast and deterministic:Best Practices
Use Unique Identifiers
Use Unique Identifiers
Generate unique emails/phone numbers for each test run to avoid conflicts:
Clean Up After Tests
Clean Up After Tests
Delete test data after each test run to keep the environment clean.
Test Edge Cases
Test Edge Cases
- Zero amounts - Negative amounts - Very large amounts - Invalid wallet IDs - Disabled accounts - Insufficient balances
Test Webhooks Thoroughly
Test Webhooks Thoroughly
Verify all webhook events are received and handled correctly.
Monitor Test Mode Usage
Monitor Test Mode Usage
Track API calls and errors to identify integration issues early.
Going Live Checklist
Before switching to Live Mode:Need Help?
Test Mode Guide
Learn about Test vs Live environments
Support
Get help with testing