Skip to main content

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:
Features:
  • ✅ 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 +23299000009 (pending) case, or to complete a pending deposit manually, call the completion endpoint directly:
This endpoint is available in every environment (including the hosted sandbox) but only accepts Test Mode credentials — a Live Mode key is rejected with 403. Magic numbers and this endpoint never affect Live Mode.

Card Payments (Stripe)

Test Mode uses Stripe’s test card numbers: Success Cards:
Decline Cards:
Use any:
  • 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/hostpay
5

Test

Make a transaction and verify webhook delivery

Webhook Testing Example

Test Data Management

Cleaning Up Test Data

Test Mode data is isolated and can be safely deleted. Be careful not to use live credentials when cleaning up!

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:
It uses the magic test numbers to complete deposits, so it works against any environment with Test Mode credentials.

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

Generate unique emails/phone numbers for each test run to avoid conflicts:
Delete test data after each test run to keep the environment clean.
  • Zero amounts - Negative amounts - Very large amounts - Invalid wallet IDs - Disabled accounts - Insufficient balances
Verify all webhook events are received and handled correctly.
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