🚀 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:

  1. Go to landlord account settings
  2. Find "Payment Setup" section
  3. Add either:
    • Bank Account: Bank name, account number, account holder name
    • Mobile Money: Phone number, account name
  4. 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)

  1. Open Task Scheduler (Win + R → taskschd.msc)
  2. Create Basic Task → Name: "Homnex Auto Payout"
  3. Set Trigger to run every 1 minute
  4. 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

  1. Go to cPanel → Cron Jobs
  2. Add New Cron Job with command:
    /usr/bin/php -f /home/username/public_html/fransamhomesLive/cron/auto_payout_processor.php
  3. 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:

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

For detailed configuration:

View Full Setup Guide