Git Product home page Git Product logo

jengahq's Introduction

Jengahq

Latest Unstable Version Total Downloads Build Status [StyleCI] Packagist

Jengahq is Equity's Jenga API V2 wrapper for Laravel.

Note: This package is still under active development. See Contributing to start contributing.

Installing Jengahq

The recommended way to install Jengahq is through Composer

composer require ammly/jengahq

See instructions for installing Composer if you don't have it installed.

Requirements

This package requires the following

"php": ">=5.5.0",
"guzzlehttp/guzzle": "~6.0"

Setup

Register for an accout at JengaHq and obtain your credentials

Follow the Official Documentation guide on how to generate your ssl keys and upload your public key to your account's API Keys section.

Store the keys in your Laravel project's storage folder.

Configuration

Populate the following configs on your .env file.

JENGA_USERNAME=
JENGA_PASSWORD=
JENGA_API_KEY=
JENGA_PHONE=
JENGA_BASE_ENDPOINT=https://uat.jengahq.io

Usage

Include the package on to your file

<?php 

use Ammly\Jengahq\Jengahq;

Then you can new up a new instance and send your request.

$jengahq = new Jengahq;
$jengahq->sendMoney($params);

Or use the Jengahq Facade

Jenga::sendMoney($params);

generate Token

Use $jengahq->authenticate() to generate a token that will be sent as the Authorization header of every request. This is called automatically by all actions in this package.

Account Balance

Use $jengahq->accountBalance() to check account balance.

Sample

<?php 

use Ammly\Jengahq\Jengahq;

$params = [
    'account_id' => 1100161816677,
    'country_code' => 'KE',
    'date' => date('Y-m-d'),
];

$jenga = new Jengahq;
$jenga->accountBalance($params);

Send Money

Use $jengahq->sendMoney() to send money through Pesalink or InternalFundsTransfer for an Internal Equity account.

Sample

<?php 

use Ammly\Jengahq\Jengahq;

$params = [
    'country_code' => 'KE',
    'date' => date('Y-m-d'),
    'source_name' => 'John Doe',
    'source_accountNumber' => '0001092883',
    'destination_name' => 'Jane Doe',
    'destination_mobileNumber' => '25474738846',
    'destination_bankCode' => 63,
    'destination_accountNumber' => '9200002773',
    'transfer_currencyCode' => 'KES',
    'transfer_amount' => '10',
    'transfer_type' => 'PesaLink', //Or InternalFundsTransfer
    'transfer_reference' => '127364836548',
    'transfer_description' => 'Some description',
];

$jenga = new Jengahq;
$jenga->sendMoney($params);

IPRS Search

Use $jenga->iprsSearch($params) to perform an IPRS search.

sample

<?php 

use Ammly\Jengahq\Jengahq;
$params = [
    'country_code' => 'KE',
    'account_id' => '1100161816677';
    'document_type' => 'ID'; // Or Passport
    'first_name' => 'John';
    'last_name' => 'Doe';
    'document_number' => '28663883';
];

$jenga = new Jengahq;
$jenga->iprsSearch($params);

Help and docs

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.