ibracilinks / orange-money
A laravel package for Orange Money Web Payment API.
Installs: 1 553
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 2
Forks: 5
Open Issues: 2
This package is auto-updated.
Last update: 2025-04-19 22:24:48 UTC
README
Installation
- Use following command to install:
composer require ibracilinks/orange-money
- Add the service provider to your
$providers
array inconfig/app.php
file like:
Ibracilinks\OrangeMoney\Providers\OrangeMoneyServiceProvider::class,
- Add the alias to your
$aliases
array inconfig/app.php
file like:
'OrangeMoney' => Ibracilinks\OrangeMoney\Facades\OrangeMoney::class,
- Run the following command to publish configuration:
php artisan vendor:publish --provider "Ibracilinks\OrangeMoney\Providers\OrangeMoneyServiceProvider"
Configuration
- After installation, you will need to add your orangemoney settings. Following is the code you will find in config/orangemoney.php, which you should update accordingly.
return [ 'auth_header' => env('OM_AUTH_HEADER', ''), 'merchant_key' => env('OM_MERCHANT_KEY', ''), 'return_url' => env('OM_RETURN_URL', ''), 'cancel_url' => env('OM_CANCEL_URL', ''), 'notif_url' => env('OM_NOTIf_URL', '') ];
- Add this to
.env.example
and.env
OM_AUTH_HEADER= OM_MERCHANT_KEY= OM_RETURN_URL= OM_CANCEL_URL= OM_NOTIf_URL=
Basic Usage
Following are some ways through which you can access the OrangeMoney provider:
use Ibracilinks\OrangeMoney\OrangeMoney; $payment = new OrangeMoney(); $data = [ "merchant_key"=> '*********', "currency"=> "OUV", "order_id"=> "".time()."", "amount" => 5000, "return_url"=> 'http://www.your-website.com/callback/return', "cancel_url"=> 'http://www.your-website.com/callback/cancel', "notif_url"=>'http://www.your-website.com/callback/notif', "lang"=> "fr", "reference"=> "Your Website" ]; $payment->webPayment($data);
License
The MIT License (MIT). Please see License for more information.
Contributing
Read here for more information.