2017 © Pedro Peláez
 

library beyonic

laravel beyonic mobile money payment implementation

image

fannypack/beyonic

laravel beyonic mobile money payment implementation

  • Saturday, April 14, 2018
  • by mpaannddreew
  • Repository
  • 1 Watchers
  • 0 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 39 % Grown

The README.md

About this library

This is a simple/basic implementation of beyonic payments in laravel 5, (*1)

Actions supported

Note: You must have a valid Beyonic account to use this library - RECEIVING MONEY [Collection request] - SENDING MONEY [Payments], (*2)

For more information visit Beyonic, (*3)

Installation

composer require fannypack/beyonic, (*4)

For Laravel <= 5.4 Register service provider, (*5)

FannyPack\Beyonic\BeyonicServiceProvider::class,

For Laravel <= 5.4 Register Facade, (*6)

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

For Laravel > 5.4 Service provider and Facade are discovered automatically, (*7)

After the service provider is registered run this command, (*8)

php artisan vendor:publish

This command will create a copy of the library's config file and migrations into your code base, (*9)

beyonic.php

Run migrations to create beyonic_payments table to store your payment instances, (*10)

php artisan migrate

Environment setup

The library loads configurations from the .env file in your application's root folder. These are the contents of beyonic.php, (*11)

return [
    'apiKey' => env('BEYONIC_API_KEY', ''),
    'currency' => env('CURRENCY', 'UGX'),
    'callback_url' => env('CALLBACK_URL', ''),
    'account_id' => env('ACCOUNT_ID', ''),
];

Usage in context of your beyonic account

Using it with your models, add trait FannyPack\Beyonic\Billable to your models and make sure your model has a phone_number field, (*12)

namespace App;

use FannyPack\Beyonic\Billable;
use Illuminate\Database\Eloquent\Model;

class Account extends Model
{
    use Billable;
}

Requesting payment from a billable instance, this method takes an optional phone number in case you want to provide a different number to withdraw the funds from and the method returns a FannyPack\Beyonic\Payment::class instance, (*13)

$account = Account::find(1);
$payment = Beyonic::deposit($account, $amount, $reason, $optional_phone_number);
// or
$payment = $account->deposit($amount, $reason, $optional_phone_number);

Information about a Collection request, (*14)

$payment = $account->payments[0]
$response = Beyonic::info($payment);
// or
$response = $payment->info();

Sending payment to th phone number associated with the billable instance, this method takes an optional phone number in case you want to provide a different number to deposit the funds to and the method returns a FannyPack\Beyonic\Payment::class instance, (*15)

$payment = Beyonic::withdraw($account, $amount, $reason, $optional_phone_number);
// or
$payment = $account->withdraw($amount, $reason, $optional_phone_number);

For information about the response body visit Beyonic, (*16)

Bugs

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

The Versions

14/04 2018

dev-master

9999999-dev

laravel beyonic mobile money payment implementation

  Sources   Download

The Requires

 

by Mpande Andrew

laravel php library payments mobile money beyonic

14/04 2018

v2.1beta

2.1.0.0-beta

laravel beyonic mobile money payment implementation

  Sources   Download

The Requires

 

by Mpande Andrew

laravel php library payments mobile money beyonic

14/04 2018

v2.0

2.0.0.0

laravel beyonic mobile money payment implementation

  Sources   Download

The Requires

 

by Mpande Andrew

laravel php library payments mobile money beyonic

14/04 2018

v2.0beta

2.0.0.0-beta

laravel beyonic mobile money payment implementation

  Sources   Download

The Requires

 

by Mpande Andrew

laravel php library payments mobile money beyonic

12/09 2017

dev-dev-master

dev-dev-master

laravel beyonic mobile money payment implementation

  Sources   Download

The Requires

 

by Mpande Andrew

laravel php library payments mobile money beyonic

12/09 2017

v1.0

1.0.0.0

laravel beyonic mobile money payment implementation

  Sources   Download

The Requires

 

by Mpande Andrew

laravel php library payments mobile money beyonic