定制 djunehor/eyowo-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

djunehor/eyowo-php

Composer 安装命令:

composer require djunehor/eyowo-php

包简介

Helps make your Eyowo API calls giving a stdClass object.

README 文档

README

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.

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固