Before installing Momo Suite, make sure your environment meets the following requirements:
composer require rais/momo-suite
php artisan vendor:publish --provider="Rais\MomoSuite\MomoSuiteServiceProvider"
or
php artisan momo-suite:install --all
php artisan momo-suite:create-admin ## this ask u to add your details
php artisan momo-suite:create-admin --default ## create a default admin
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
# 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
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
],
];
1. Basic Usage with Facade:
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
use Rais\MomoSuite\Models\Transaction;
$transaction = Transaction::find($id);
echo $transaction->status;
echo $transaction->amount;
echo $transaction->network;