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:1
Install ngrok
2
Expose your local server
https://abc123.ngrok.io3
Configure the webhook in the Dashboard
Go to Settings > Webhooks and add your ngrok URL:
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:1
Complete Testing
- Test all payment scenarios (success, failure, pending)
- Test webhook reception and processing
- Test refunds and cancellations
2
Security
- API keys stored in environment variables
- Webhook signature verification implemented
- HTTPS enabled on all endpoints
3
Configuration
- Production callback URLs configured
- Webhooks pointing to production server
- Production keys (
sk_live_) in place