Sandbox vs Production Mode
Yabetoo provides two distinct environments for safe development and testing.Sandbox (Test)
Test environment for development. No real transactions are made.Key prefix:
sk_test_Production (Live)
Production environment for real transactions.Key prefix:
sk_live_API Keys Configuration
Recommended Environment Variables
Create a.env file at the root of your project:
.env
Usage in Your Code
Test Phone Numbers
In sandbox mode, use these phone numbers to simulate different scenarios:| Number | Operator | Behavior |
|---|---|---|
242000000001 | MTN | Payment succeeds |
242000000002 | MTN | Fails (insufficient funds) |
242000000003 | MTN | Pending 30s, then succeeds |
242000000004 | Airtel | Payment succeeds |
242000000005 | Airtel | Fails (invalid number) |
Testing Webhooks Locally
To receive webhooks locally, use a tunneling tool like ngrok:Verify Webhook Signatures
Always verify webhook signatures to ensure they come from Yabetoo:Best Practices
Error Handling
Error Handling
Always implement robust error handling:
Idempotency
Idempotency
Use idempotency keys to avoid duplicates on retry:
Logging and Monitoring
Logging and Monitoring
Log all transactions for debugging:
Pre-Production Checklist
Before going live, verify:Complete Testing
- Test all payment scenarios (success, failure, pending)
- Test webhook reception and processing
- Test refunds and cancellations
Security
- API keys stored in environment variables
- Webhook signature verification implemented
- HTTPS enabled on all endpoints
Useful Resources
Postman Collection
Quickly test the API with our Postman collection
API Reference
Complete API documentation
Error Handling
List of error codes and solutions
Webhooks
Webhook configuration and management