# Getting Started

### Requirements

Before installing Momo Suite, make sure your environment meets the following requirements:

* PHP >= 8.0
* Laravel >= 8.0.x
* MySQL or PostgreSQL&#x20;
* Composer
* JSON PHP Extension
* cURL PHP Extension
* OpenSSL PHP Extension
* PDO PHP Extension

### Installation

1. Install the package via Composer:

```bash
composer require rais/momo-suite
```

2. Publish the package assets:

<pre class="language-bash"><code class="lang-bash">php artisan vendor:publish --provider="Rais\MomoSuite\MomoSuiteServiceProvider"
<strong>
</strong><strong>or
</strong><strong>
</strong><strong>php artisan momo-suite:install --all
</strong></code></pre>

This will publish:

* Configuration file (`config/momo-suite.php`)
* Migration files
* Dashboard views
* Assets (CSS, JS)

3. Run the migrations:

```bash
php artisan migrate
```

```shellscript
php artisan momo-suite:create-admin ## this ask u to add your details
php artisan momo-suite:create-admin --default  ## create a default admin
```

#### 📝 NOTE  (Customization)

```
php artisan momo-suite:install --views     # Customize views
php artisan momo-suite:install --routes    # Customize routes
php artisan momo-suite:install --migrations # Customize migrations

Add --force to overwrite existing files
php artisan momo-suite:install --all --force
```

#### Configuration

1. Add your provider credentials to your `.env` file:

```markdown
# Hubtel Configuration
HUBTEL_CLIENT_ID=your-client-id
HUBTEL_CLIENT_SECRET=your-client-secret
HUBTEL_MERCHANT_ACCOUNT_NUMBER=your-merchant-account
HUBTEL_CALLBACK_URL=your-callback-url

# Korba Configuration
KORBA_API_KEY=your-api-key
KORBA_CLIENT_ID=your-client-id
KORBA_CLIENT_SECRET=your-client-secret

# Paystack Configuration
PAYSTACK_SECRET_KEY=your-secret-key
PAYSTACK_PUBLIC_KEY=your-public-key

# ... other provider configurations
```

2. Configure the package in `config/momo-suite.php`:

```php
return [
    'default_provider' => 'hubtel',
    
    'providers' => [
        'hubtel' => [
            'client_id' => env('HUBTEL_CLIENT_ID'),
            'client_secret' => env('HUBTEL_CLIENT_SECRET'),
            'merchant_account_number' => env('HUBTEL_MERCHANT_ACCOUNT_NUMBER'),
            'callback_url' => env('HUBTEL_CALLBACK_URL'),
        ],
        // ... other provider configurations
    ],
    
];
```

#### Quick Start Guide

```
1. Basic Usage with Facade:
```

```php
use Rais\MomoSuite\Facades\Momo;

// Receive Money (Collection)
$result = Momo::setProvider('hubtel')
    ->receive([
        'phone' => '0551234987',
        'amount' => 1.00,
        'network' => 'MTN',
        'reference' => 'Test Payment',
    ]);

// Send Money (Disbursement)
$result = Momo::setProvider('hubtel')
    ->send([
        'phone' => '0241234987',
        'amount' => 1.00,
        'network' => 'MTN',
        'reference' => 'Test Disbursement',
    ]);

// avaiable networks
MTN | TELECEL | AIRTELTIGO
```

2. Access the Dashboard:
   * Visit: `your-domain.com/momo/dashboard`
   * Monitor transactions
   * View analytics
   * Manage users
3. Handle Webhooks:
   * Configure your webhook URL in your provider's dashboard
   * Webhooks will be automatically processed
   * Transaction statuses will be updated in real-time
4. View Transaction Details:

```php
use Rais\MomoSuite\Models\Transaction;

$transaction = Transaction::find($id);
echo $transaction->status;
echo $transaction->amount;
echo $transaction->network;
```
