PHP Classes
elePHPant
Icontem

PHP Eyowo Payment API: Process payments using the Eyowo API

Recommend this page to a friend!

  Author Author  
Name: Zacchaeus Bolaji <contact>
Classes: 11 packages by
Country: Nigeria Nigeria
Innovation award
Innovation award
Nominee: 6x


  Detailed description   Download Download .zip .tar.gz  
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.

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.


  Classes of Zacchaeus Bolaji  >  PHP Eyowo Payment API  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  

 

Name: PHP Eyowo Payment API
Base name: eyowo-php
Description: Process payments using the Eyowo API
Version: -
PHP version: 5
License: The PHP License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Wireless and Mobile Wireless communications, handheld and pocket computing View top rated classes
Group folder image E-Commerce Online stores, shopping baskets and payment methods View top rated classes
Group folder image Web services Web data clipping, SOAP or XML-RPC clients and servers View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  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

Download Download all files: eyowo-php.tar.gz eyowo-php.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.