定制 fannypack/beyonic 二次开发

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

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

fannypack/beyonic

Composer 安装命令:

composer require fannypack/beyonic

包简介

laravel beyonic mobile money payment implementation

README 文档

README

This is a simple/basic implementation of beyonic payments in laravel 5

Actions supported

Note: You must have a valid Beyonic account to use this library

  • RECEIVING MONEY [Collection request]
  • SENDING MONEY [Payments]

For more information visit Beyonic

Installation

composer require fannypack/beyonic

For Laravel <= 5.4 Register service provider

FannyPack\Beyonic\BeyonicServiceProvider::class,

For Laravel <= 5.4 Register Facade

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

For Laravel > 5.4 Service provider and Facade are discovered automatically

After the service provider is registered run this command

php artisan vendor:publish

This command will create a copy of the library's config file and migrations into your code base

beyonic.php

Run migrations to create beyonic_payments table to store your payment instances

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

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

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

$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

$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

$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

Bugs

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-09-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固