fannypack/jpesa

There is no license information available for the latest version (v1.0) of this package.

laravel jpesa mobile money payment implementation

v1.0 2017-09-12 06:44 UTC

This package is auto-updated.

Last update: 2024-04-05 19:36:23 UTC


README

This is a simple/basic implementation of JPesa payments in laravel 5

Actions supported

Note: You must have a valid JPesa account to use this library

  • RECEIVING MONEY [Request payment]

For more information visit JPesa

Installation

composer require fannypack/jpesa

Register service provider

FannyPack\JPesa\JPesaServiceProvider::class,

Register Facade Register service provider

'JPesa' => FannyPack\JPesa\JPesa::class,

After the service provider is registered run this command

php artisan vendor:publish

This command will create a copy of the library's config file and migrations into your code base

jpesa.php

Run migrations

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

return [
    'username' => env('JPESA_USERNAME', ''),
    'password' => env('JPESA_PASSWORD', ''),
];

Usage in context of your jpesa account

Using it with your models, add

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

$response = JPesa::deposit($from_phone_number, $amount);

Information about a jpesa transaction

$response = JPesa::info($transactionId);

Bugs

For any bugs found, please email me at andrewmvp007@gmail.com or register an issue at issues