# 📶 Wi-Fi Pay & Connect
> **A lightweight captive portal for purchasing Wi-Fi access through M-Pesa and voucher-based authentication.**
Wi-Fi Pay & Connect is a PHP and MySQL-powered captive portal designed for hotspot environments where users can select an internet package, initiate an M-Pesa payment, redeem access vouchers, and check payment status.
The system is designed around a simple customer journey:
**Choose a package → Pay → Verify → Connect.**
---
## 📸 Screenshots
### 🏠 Wi-Fi Access Portal
The main captive portal allows customers to view available Wi-Fi packages, compare pricing and connection speeds, and initiate payment.
---
### 💳 M-Pesa Payment Interface
Customers can select their preferred package and provide their Kenyan mobile number to initiate the M-Pesa payment process.
---
## ✨ Features
### 📶 Wi-Fi Packages
Plans are dynamically retrieved from the database and can contain:
* Package name
* Duration
* Download speed
* Upload speed
* Price in Kenyan Shillings
* Active/inactive status
Example:
```text
Package
├── Name
├── Duration
├── Download Speed
├── Upload Speed
└── Price
```
---
### 💳 M-Pesa Payments
The portal provides a payment entry point for M-Pesa customers.
The intended payment flow is:
```text
Customer
│
▼
Select Package
│
▼
Enter Phone Number
│
▼
Initiate M-Pesa Payment
│
▼
Customer Authorizes Payment
│
▼
Payment Verification
│
▼
Activate Wi-Fi Access
```
---
### 🎟️ Voucher Support
Users who already have a valid access voucher can enter their voucher code instead of making a new payment.
```text
Voucher Code
│
▼
Voucher Validation
│
├── Invalid / Expired
│
└── Valid
│
▼
Access Activated
```
---
### 🔎 Payment Status
Customers can check the status of a payment using the phone number associated with the transaction.
Possible states can include:
```text
PENDING
SUCCESS
FAILED
EXPIRED
```
---
### 🌐 Client Identification
The portal can retrieve the connecting client's:
* IP address
* MAC address whe …