About this library
This is a simple/basic implementation of JPesa payments in laravel 5, (*1)
Actions supported
Note: You must have a valid JPesa account to use this library
- RECEIVING MONEY [Request payment], (*2)
For more information visit JPesa, (*3)
Installation
composer require fannypack/jpesa, (*4)
Register service provider, (*5)
FannyPack\JPesa\JPesaServiceProvider::class,
Register Facade
Register service provider, (*6)
'JPesa' => FannyPack\JPesa\JPesa::class,
After the service provider is registered run this command, (*7)
php artisan vendor:publish
This command will create a copy of the library's config file and migrations into your code base, (*8)
jpesa.php
Run migrations, (*9)
php artisan migrate
Environment setup
The library loads configurations from the .env file in your application's root folder. These are the contents of jpesa.php, (*10)
return [
'username' => env('JPESA_USERNAME', ''),
'password' => env('JPESA_PASSWORD', ''),
];
Usage in context of your jpesa account
Using it with your models, add, (*11)
namespace App;
use FannyPack\JPesa\Billable;
use Illuminate\Database\Eloquent\Model;
class Account extends Model
{
use Billable;
}
Requesting payment from a registered mobile money number, (*12)
$response = JPesa::deposit($from_phone_number, $amount);
Information about a jpesa transaction, (*13)
$response = JPesa::info($transactionId);
Bugs
For any bugs found, please email me at andrewmvp007@gmail.com or register an issue at issues, (*14)