# AfriDirect Payment Plugin 

A production-ready WooCommerce plugin that enables manual payment methods with proof upload functionality.

## Features

- **Multiple Payment Methods**: Support for Bank Transfer, Zelle, PayPal, and Custom payment methods
- **Payment Proof Upload**: Customers can upload proof of payment (images or PDFs)
- **Countdown Timer**: Configurable countdown timer for payment deadline
- **Custom Order Statuses**: 
  - Pending Payment
  - Proof Uploaded
  - Approved
  - Rejected
  - Expired
- **Admin Dashboard**: Review and manage orders requiring payment proof review
- **Email Notifications**: Automated emails for:
  - Order created (with payment instructions)
  - Proof received (admin notification)
  - Approved (with receipt link)
  - Rejected (with reason)
  - Expired
- **Receipt Generation**: Automatic receipt number generation and printable receipt page
- **Modern UI**: Beautiful, responsive design for both admin and frontend
- **WooCommerce Integration**: Works seamlessly with WooCommerce classic checkout and My Account pages

## Installation

1. Upload the `afridirect-payment.php` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to WooCommerce → Settings → Payments → AfriDirect Payment Plugin Proof
4. Enable and configure the payment gateway

## Configuration

### Payment Gateway Settings

1. Navigate to **WooCommerce → Settings → Payments → AfriDirect Payment Plugin**
2. Enable the payment method
3. Configure payment instructions for each payment type:
   - Bank Transfer Instructions
   - Zelle Instructions
   - PayPal Instructions
   - Custom Payment Instructions
4. Set the countdown timer duration (default: 48 hours)

### Admin Dashboard

Access the admin dashboard at **WooCommerce → AfriDirect Payment Plugin** to:
- View orders pending review
- Review uploaded payment proofs
- Approve or reject orders with notes

## Usage

### For Customers

1. During checkout, select "AfriDirect Payment Plugin" as the payment method
2. Choose the payment method type (Bank, Zelle, PayPal, or Custom)
3. Complete the order
4. On the order confirmation page, view payment instructions
5. Upload proof of payment before the deadline expires
6. Access receipt after approval

### For Administrators

1. Receive email notification when proof is uploaded
2. Go to WooCommerce → AfriDirect Payment Plugin
3. Review uploaded proof
4. Approve or reject with notes
5. Customer receives email notification

## File Structure

```
AfriDirect Payment/
├── afridirect-payment.php          # Main plugin file
├── includes/                    # Core classes
│   ├── class-afridirect-payment.php
│   ├── class-payment-gateway.php
│   ├── class-order-statuses.php
│   ├── class-admin-dashboard.php
│   ├── class-proof-handler.php
│   ├── class-email-handler.php
│   ├── class-receipt-generator.php
│   └── class-ajax-handler.php
├── admin/                       # Admin interface
│   ├── views/
│   ├── css/
│   └── js/
├── public/                      # Frontend interface
│   ├── views/
│   ├── css/
│   └── js/
└── README.md
```

## Security Features

- Nonce verification for all AJAX requests
- Capability checks for admin functions
- File type and size validation
- Sanitized and escaped all inputs/outputs
- Secure file storage with .htaccess protection

## Requirements

- WordPress 5.8+
- WooCommerce 5.0+
- PHP 7.4+

## Support

For issues, feature requests, or questions, please contact the plugin developer.

## License

This plugin is free software, released under the GNU General Public License v2.0 or later (GPLv2+). See https://www.gnu.org/licenses/gpl-2.0.html.

