# πΆ 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 β¦