PHP Eyowo Payment API: Process payments using the Eyowo API

Recommend this page to a friend!
  Info   View files Documentation   View files View files (16)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-02-15 (6 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 20 All time: 9,998 This week: 370Up
Version License PHP version Categories
eyowo-php 1.0The PHP License5PHP 5, Wireless and Mobile, E-Commerce, W...
Description Author

This class can used to process payments using the Eyowo API.

It can send HTTP requests to the Eyewo API Web server to perform several types of operations related with payments. Currently it can:

- Request a token to access the API validating a phone of an user with an account in Eyowo using a code that is sent by SMS to the user phone to authorize to access the API on his behalf.
- Request to pay an amount from the authorized user to another user with a given phone number.
- Request to pay an amount from the authorized user to another user with a given bank account.
- Get the authorized user account balance.

Picture of Zacchaeus Bolaji
  Performance   Level  
Name: Zacchaeus Bolaji <contact>
Classes: 13 packages by
Country: Nigeria Nigeria
Age: ???
All time rank: 301716 in Nigeria Nigeria
Week rank: 128 Up6 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 8x

Details

eyowo-php

CircleCI Latest Stable Version Total Downloads License StyleCI Build Status Scrutinizer Code Quality

A PHP API wrapper for Eyowo.

Requirements

  • Curl 7.34.0 or more recent (Unless using Guzzle)
  • PHP 5.4.0 or more recent
  • OpenSSL v1.0.1 or more recent

Install

Via Composer

    $ composer require djunehor/eyowo-php

Usage

1. Get your API KEYS

2. configure package (optional)

  • Add `EYOWO_APP_KEY` and `EYOWO_APP_SECRET` to your `.env` and set the values

3. Initialise API

use Djunehor\Eyowo\Api;

$production is an optional boolean parameter to specify if to use production URL or sandbox.
// Default is false
$eyowo = new Api($appKey, $production); //if appKey is not passed, package uses value in .env

NOTE: The sandbox URL was not responding as at last test. So, you might just set $production as true

Validate a user

// phone should be in the format 2348020000000
$eyowo->validate($phone);

Authenticate user

// sends SMS to user phone
$eyowo->initiateAuthorization($phone);

// $code is the 6-digit number send to user phone
$eyowo->generateToken($phone, $code);
[
'success' => true,
'data' => [
'accessToken' => kjaskajs7a8s6as7a7s68a,
'refreshToken' => askhas7a7s6a7yajgsa67u
]

$walletToken = $eyowo->getAccessToken();
$refreshToken = $eyowo->getRefreshToken();

Refresh Token

$eyowo->refreshToken($refreshToken);

Get banks

$output = $eyowo->banks();
[
'success' => true,
'data' => [
    'banks' => [
            [
                        "bankCode" => "090270",
                        "bankName" => "AB MICROFINANCE BANK"
                    ]
...
]
    ]
]

$banks = $eyowo->getBanks();

            [
                        "bankCode" => "090270",
                        "bankName" => "AB MICROFINANCE BANK"
                    ]
...
]
 

Transfer to phone

//amount should be in kobo
$eyowo->transferToPhone($walletToken, $amount, $phone);

Transfer to bank

//amount should be in kobo
$eyowo->transferToPhone($walletToken, $amount, $accountName, $accountNumber, $bankCode);

Wallet Balance

$eyowo->balance($walletToken); returns raw API response
$balance = $eyowo->getBalance(); // returns int|float

VTU

// provider has to be one of ['mtn', 'glo', 'etisalat', 'airtel'];
$eyowo->vtu($walletToken, $amount, $phone, $provider);

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

  • Clone this repo
  • Run `composer install`
  • Run `cp .env.sample .env`
  • Set your API keys in `.env`
  • Run `composer test`

Contributing

Please see CONTRIBUTING and CONDUCT for details. Check our todo list for features already intended.

Security

If you discover any security related issues, please email yabacon.valley@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

  Files folder image Files  
File Role Description
Files folder image.circleci (1 file)
Files folder image.github (4 files)
Files folder imagesrc (1 file)
Files folder imagetests (1 file)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.sample Data Auxiliary data
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file TODO.md Data Auxiliary data

  Files folder image Files  /  .circleci  
File Role Description
  Accessible without login Plain text file config.yml Data Auxiliary data

  Files folder image Files  /  .github  
File Role Description
  Accessible without login Plain text file CONDUCT.md Data Auxiliary data
  Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
  Accessible without login Plain text file ISSUE_TEMPLATE.md Data Auxiliary data
  Accessible without login Plain text file PULL_REQUEST_TEMPLATE.md Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
  Plain text file Api.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file EyowoTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:20
This week:0
All time:9,998
This week:370Up

For more information send a message to info at phpclasses dot org.