🚀 Funds Withdrawal System Setup
Complete setup instructions for the automatic payout system
1 Run Database Migration
Create the payout_requests table that stores all payout requests:
Or manually run the SQL from:
database/migrations/create_payout_requests_table.sql
2 Configure Payment Methods
Landlords must set up payment methods before requesting payouts:
- Go to landlord account settings
- Find "Payment Setup" section
- Add either:
- Bank Account: Bank name, account number, account holder name
- Mobile Money: Phone number, account name
- Save the payment method
3 Setup Automatic Payout Processor
Configure a cron job to automatically process eligible payouts every minute:
📋 Cron File Location:
cron/auto_payout_processor.php
Option A: Windows Task Scheduler (XAMPP)
- Open Task Scheduler (Win + R → taskschd.msc)
- Create Basic Task → Name: "Homnex Auto Payout"
- Set Trigger to run every 1 minute
- Set Action to run program:
C:\xampp\php\php.exe -f "C:\xampp\htdocs\fransamhomesLive\cron\auto_payout_processor.php"
Option B: cPanel / Linux Hosting
- Go to cPanel → Cron Jobs
- Add New Cron Job with command:
/usr/bin/php -f /home/username/public_html/fransamhomesLive/cron/auto_payout_processor.php
- Set frequency to "Every 1 minute"
Option C: Manual Test (CLI)
Test the cron job manually by running:
php C:\xampp\htdocs\fransamhomesLive\cron\auto_payout_processor.php
4 Access the Funds Withdrawal Page
The system is now ready! Landlords can access:
- View total revenue and breakdowns
- Check available funds for withdrawal
- Request manual payouts
- Track payout history and status
URL: ?page=landlord_funds_withdrawal
5 Monitor the System
Check cron job execution logs:
Log File:
logs/payout_cron.log
Example log entry:
[2024-01-15 10:30:45] === Auto Payout Processor Started ===
[2024-01-15 10:30:45] Found 5 landlords with payment methods configured
[2024-01-15 10:30:46] ✓ Auto payout created for landlord 1: GH₵ 500.00
[2024-01-15 10:30:50] === Auto Payout Processor Completed ===
✓ Setup Checklist
- Database migration completed
- Payment methods field in landlord account verified
- Cron job scheduled/configured
- Landlords can access Funds & Withdrawal page
- System logs are accessible