💡 Quick Overview for Business Owners:
This comprehensive guide helps you monetize your Wi-Fi hotspot by accepting M-Pesa payments for internet access - perfect for hotels, cafes, and public spaces in Tanzania.
✅ Technical Outcomes
- • Fully automated M-Pesa voucher system
- • Professional captive portal interface
- • Real-time payment verification
- • Multi-tier pricing options
💰 Business Benefits
- • Generate revenue from Wi-Fi access
- • Reduce bandwidth abuse and freeloaders
- • Professional guest experience
- • Track usage and optimize pricing
🛠️ What You'll Need Before Starting:
Business Requirements:
- • M-Pesa Business Account (Till Number)
- • Valid business license in Tanzania
- • SSL certificate for secure payments
- • Reliable internet connection (backup recommended)
Technical Requirements:
- • Network router (TP-Link Omada or UniFi recommended)
- • Web server (Apache/Nginx)
- • PHP 7.4+ or Python 3.8+
- • MySQL/PostgreSQL database
⚠️ Important: M-Pesa API approval can take 2-4 weeks. Start this process first while setting up the technical infrastructure.
📱 Getting M-Pesa API Access:
Register with Safaricom Developer Portal
Visit developer.safaricom.co.ke and create an account
Apply for API Keys
Submit business documentation and use case description
Get Till Number Integration
Link your existing till number to the API system
// Sample M-Pesa API Configuration (PHP)
class MpesaConfig {
const CONSUMER_KEY = 'your_consumer_key_here';
const CONSUMER_SECRET = 'your_consumer_secret_here';
const ENVIRONMENT = 'sandbox'; // Change to 'production' for live
const SHORTCODE = 'your_till_number';
const PASSKEY = 'your_lipa_na_mpesa_passkey';
const CALLBACK_URL = 'https://yoursite.com/api/mpesa/callback';
// Test credentials for sandbox
const TEST_SHORTCODE = '174379';
const TEST_PASSKEY = 'bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919';
}
// Payment initiation function
function initiateMpesaPayment($amount, $phone, $voucher_code) {
$timestamp = date('YmdHis');
$password = base64_encode(MpesaConfig::SHORTCODE . MpesaConfig::PASSKEY . $timestamp);
$curl_post_data = [
'BusinessShortCode' => MpesaConfig::SHORTCODE,
'Password' => $password,
'Timestamp' => $timestamp,
'TransactionType' => 'CustomerPayBillOnline',
'Amount' => $amount,
'PartyA' => $phone,
'PartyB' => MpesaConfig::SHORTCODE,
'PhoneNumber' => $phone,
'CallBackURL' => MpesaConfig::CALLBACK_URL,
'AccountReference' => $voucher_code,
'TransactionDesc' => 'Wi-Fi Access Voucher'
];
return sendMpesaRequest('mpesa/stkpush/v1/processrequest', $curl_post_data);
}
🖥️ Portal Design Best Practices:
✅ Essential Elements
- • Business branding and logo
- • Clear pricing tiers with time limits
- • Simple payment instructions in Swahili
- • Mobile-responsive design (90% of users are mobile)
- • Progress indicator for payment status
⚠️ Common Mistakes to Avoid
- • Complex voucher code entry process
- • No payment status feedback
- • Missing terms and conditions
- • No customer support contact
- • English-only interface
| Package | Duration | Data Limit | Price (TSh) | Best For |
|---|---|---|---|---|
| Basic | 1 Hour | 500MB | 1,000 | Quick browsing |
| Standard | 4 Hours | 2GB | 3,000 | Work sessions |
| Premium | 24 Hours | 10GB | 8,000 | Heavy usage |
| Business | 7 Days | Unlimited | 25,000 | Extended stays |
🔄 Optimized Payment Process:
User selects package
Clear pricing display with package benefits
System generates unique voucher
8-digit alphanumeric code tied to payment request
Payment prompt sent to phone
STK push notification with amount and business name
Real-time payment verification
Callback processing and voucher activation
Instant internet access
Automatic authentication and session start
🔧 Omada Controller Setup:
- 1. Access Omada Controller - Navigate to your controller IP (typically 192.168.0.1)
- 2. Configure Guest Network - Create separate SSID for guest access
- 3. Enable Captive Portal - Go to Settings → Authentication → Captive Portal
- 4. Set Portal URL - Point to your custom portal: https://yourhotel.com/portal
- 5. Configure Voucher System - Enable voucher authentication with time/data limits
- 6. Test Authentication Flow - Verify voucher codes grant proper access
🔧 UniFi Dream Machine Setup:
- 1. UniFi Network Application - Access through web interface or mobile app
- 2. Guest Portal Configuration - Settings → Guest Control → Guest Portal
- 3. Custom Portal Template - Upload your branded portal design
- 4. Voucher Manager Setup - Configure voucher types and quotas
- 5. Bandwidth Profiles - Set speed limits per package tier
✅ Complete Testing Checklist:
Payment Testing:
- • Test with small amounts (TSh 100-500) first
- • Verify callback URL is accessible
- • Test payment timeout scenarios
- • Check duplicate payment handling
- • Test with different phone number formats
User Experience Testing:
- • Mobile responsiveness on various devices
- • Portal loading speed (should be under 3 seconds)
- • Voucher code entry process
- • Session timeout and reconnection
- • Multi-language support (English/Swahili)
❌ Challenge: Payment Verification Delays
Problem: M-Pesa callbacks can be delayed by 30-120 seconds during peak hours.
✅ Solution:
Implement polling mechanism to check payment status every 30 seconds for up to 5 minutes. Show progress indicator to users: "Verifying payment... Please wait"
❌ Challenge: Voucher Code Confusion
Problem: Users struggle with manual voucher code entry, leading to support calls.
✅ Solution:
Implement QR code generation for vouchers. After payment, display QR code that users can scan instead of typing. Also send SMS with voucher code as backup.
❌ Challenge: Power Outages Affecting System
Problem: Tanzania's power grid issues can disrupt service and frustrate paying customers.
✅ Solution:
Install UPS for critical components (router, server, modem). Set voucher validity to extend automatically if power outage is detected. Consider offline voucher validation mode.
❌ Challenge: High Data Consumption
Problem: Users exceed expected data usage, affecting profitability and other users' experience.
✅ Solution:
Implement bandwidth shaping (limit speed instead of data) and block high-bandwidth applications like torrents. Set fair usage policies and offer data top-up options.
💰 Maximize Your Wi-Fi Revenue:
Dynamic Pricing
Increase prices during peak hours (evening, weekends)
Package Bundling
Offer discounted multi-day packages for extended stays
Upselling Opportunities
Promote premium packages when basic data is consumed
Analytics Integration
Track usage patterns to optimize pricing and capacity
Loyalty Programs
Offer repeat customer discounts and referral bonuses
Corporate Packages
Create bulk packages for business travelers and events
📊 Key Metrics to Track:
Payment Success Rate
Target: >95%
Average Session Duration
Track by package type
Daily Revenue
Monitor trends and patterns
Get Professional Implementation Support
Don't want to handle the technical complexity? NEURALTALE provides complete M-Pesa captive portal setup services.
✅ Complete Setup
M-Pesa API integration, portal design, and router configuration
✅ Training & Support
Staff training and 24/7 technical support in English and Swahili
✅ Revenue Optimization
Analytics setup and pricing strategy consultation
Q: How long does M-Pesa API approval take?
A: Typically 2-4 weeks after submitting complete documentation. We can help expedite the process with proper documentation preparation.
Q: What happens if M-Pesa service is down?
A: Implement a backup voucher system where staff can manually generate codes during M-Pesa outages. Always have alternative payment methods available.
Q: Can customers get refunds for unused time?
A: Set clear terms that vouchers are non-refundable but transferable. Consider offering credits for technical issues on your end.
Q: How much revenue can I expect?
A: Depends on location and traffic, but hotels typically generate TSh 200,000-800,000 monthly from Wi-Fi services. Coffee shops see TSh 50,000-200,000 monthly.
Q: Do I need a developer to maintain the system?
A: Basic maintenance can be handled by non-technical staff, but having a developer relationship is recommended for updates and troubleshooting.
🎯 Your Implementation Timeline:
Week 1-2: Apply for M-Pesa API access and gather business documentation
Week 2-3: Set up hardware infrastructure (router, server, UPS)
Week 3-4: Develop and test captive portal system
Week 4-5: Integration testing with M-Pesa sandbox environment
Week 5-6: Go live with production system and staff training
💡 Pro Tip: Start with a soft launch offering free vouchers to gather user feedback and identify any issues before full commercial deployment.
Need help implementing your M-Pesa captive portal? Contact NEURALTALE for professional setup and ongoing support services.
Legal and Compliance Considerations
Ensure compliance with:
- Tanzania Communications Regulatory Authority (TCRA) requirements
- Data protection regulations
- M-Pesa terms of service
- Local business licensing requirements
Pricing Strategy
Based on our experience with 50+ deployments in Tanzania, here are recommended pricing tiers:
- 1 Hour: 500 TZS
- 4 Hours: 1,500 TZS
- 24 Hours: 3,000 TZS
- Weekly: 15,000 TZS
Maintenance and Monitoring
Set up monitoring for:
- Payment success rates
- System uptime
- User complaints
- Revenue tracking
Need Professional Implementation?
While this guide provides a comprehensive overview, implementing a production-ready captive portal with M-Pesa integration requires technical expertise. Our team at Neuraltale Technologies has deployed similar systems for over 50 businesses across Tanzania.
Contact us for:
- Complete system setup and configuration
- M-Pesa API approval assistance
- Custom branding and design
- Ongoing technical support
