# Payment Configuration Module

A comprehensive Laravel module for managing MTN MoMo API credentials and processing mobile money payments.

## Features

- **Credential Management**: Secure storage of MTN MoMo API credentials with encryption
- **Collection API**: Request payments from customers
- **Disbursement API**: Send money to customers
- **Connection Testing**: Verify API connectivity before going live
- **Comprehensive Logging**: Track all API interactions for debugging and auditing
- **Role-Based Access**: Restricted to Super Manager role for security
- **Reusable Service**: Clean interface for other modules to process payments

## Module Structure

```
payment-module/
├── app/
│   ├── Http/Controllers/
│   │   └── PaymentConfigurationController.php
│   ├── Models/
│   │   ├── PaymentConfiguration.php
│   │   └── PaymentLog.php
│   └── Services/
│       ├── ConfigurationService.php
│       ├── PaymentProvider.php
│       └── PaymentService.php
├── database/
│   ├── migrations/
│   │   ├── 2024_01_15_000001_create_payment_configurations_table.php
│   │   └── 2024_01_15_000002_create_payment_logs_table.php
│   └── seeders/
│       └── PaymentConfigurationPermissionSeeder.php
├── resources/views/config/payment/
│   ├── index.blade.php
│   ├── form.blade.php
│   ├── test.blade.php
│   ├── logs.blade.php
│   └── documentation.blade.php
├── routes/
│   └── payment.php
├── .env.example.additions
├── DEPENDENCIES_AND_INSTALLATION.md
└── README.md
```

## Quick Start

1. **Copy files** to your Laravel project following the structure above
2. **Run migrations**: `php artisan migrate`
3. **Seed permissions**: `php artisan db:seed --class=PaymentConfigurationPermissionSeeder`
4. **Add environment variables** from `.env.example.additions` to your `.env`
5. **Access** `/config/payment` as a Super Manager user

## Documentation

See `DEPENDENCIES_AND_INSTALLATION.md` for detailed installation instructions and the in-app documentation at `/config/payment/documentation` for usage examples.

## Requirements

- Laravel 12+
- PHP 8.2+
- MySQL 5.7+
- Spatie Laravel Permission package
- SSHIA Laravel System (for theme components)

## License

Part of the SSHIA Laravel System.
