================================================================================
UPLOAD THESE FILES TO FIX M-PESA PAYMENTS
================================================================================

CRITICAL FILES (MUST UPLOAD):
-----------------------------

1. loans/models.py
   → Location: /home/acbptxvs/public_html/branchbusinessadvance.co.ke/loans/
   → What: Fixed phone number matching logic
   → Why: Matches phone numbers in ANY format (+254, 254, 0...)

2. payments/management/commands/reprocess_mpesa_transaction.py
   → Location: /home/acbptxvs/public_html/branchbusinessadvance.co.ke/payments/management/commands/
   → What: Command to reprocess specific or all pending transactions
   → Why: Fixes existing unmatched payments

3. payments/management/commands/fix_mpesa_payments.py
   → Location: /home/acbptxvs/public_html/branchbusinessadvance.co.ke/payments/management/commands/
   → What: Simple command to fix all unmatched payments
   → Why: Easiest way to fix everything at once


TEMPLATES (IF NOT UPLOADED YET):
---------------------------------

4. templates/payments/callbacks.html
   → Location: /home/acbptxvs/public_html/branchbusinessadvance.co.ke/templates/payments/

5. templates/payments/transaction_detail.html
   → Location: /home/acbptxvs/public_html/branchbusinessadvance.co.ke/templates/payments/

6. templates/payments/reprocess_transaction.html
   → Location: /home/acbptxvs/public_html/branchbusinessadvance.co.ke/templates/payments/

7. templates/payments/my_payments.html
   → Location: /home/acbptxvs/public_html/branchbusinessadvance.co.ke/templates/payments/


================================================================================
AFTER UPLOADING, RUN THESE COMMANDS:
================================================================================

# 1. Restart application
touch /home/acbptxvs/public_html/branchbusinessadvance.co.ke/passenger_wsgi.py

# 2. Fix all unmatched M-Pesa payments
cd /home/acbptxvs/public_html/branchbusinessadvance.co.ke
python manage.py fix_mpesa_payments


================================================================================
WHAT WILL HAPPEN:
================================================================================

✓ Existing unmatched transaction will be processed
✓ Borrower will be matched (Phin - +254114565176)
✓ Loan will be matched automatically
✓ Repayment record will be created
✓ Loan balance will be updated
✓ Payment will appear in /loans/repayments/ with M-Pesa badge
✓ Payment will appear in /loans/ (updated balance)
✓ Notifications will be sent
✓ All future M-Pesa payments will work automatically


================================================================================
DOCUMENTATION FILES (FOR REFERENCE):
================================================================================

- QUICK_FIX_COMMANDS.md - Quick command reference
- MPESA_COMPLETE_FIX.md - Complete fix documentation
- FIX_PHONE_MATCHING.md - Phone matching details
- TEMPLATE_UPLOAD_INSTRUCTIONS.md - Template upload guide
- MPESA_PRODUCTION_DEPLOYMENT.md - Full deployment guide


================================================================================
PRIORITY: CRITICAL - Upload files 1, 2, 3 immediately!
================================================================================
