adewalecharles/smeify 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

adewalecharles/smeify

Composer 安装命令:

composer require adewalecharles/smeify

包简介

Integrate Smeify easily into your apllication

README 文档

README

Latest Version Github Forks Github Stars License Total Downloads

Smeify is a Stable Automated Solution for Airtime and Data businesses in Nigeria, this package helps you integrate smeify easily into your laravel application.

Installation

PHP 7.4.3+ and Composer are required.

To get the latest version of adewalecharles/smeify, simply require it

composer require adewalecharles/smeify

Or add the following line to the require block of your composer.json file.

"adewalecharles/smeify": "1.0.*"

You'll then need to run composer install or composer update to download it and have the autoloader updated.

Once adewalecharles/smeify is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

'providers' => [
    ...
    AdewaleCharles\Smeify\SmeifyServiceProvider::class,
    ...
]

Configuration

You can publish the configuration file using this command:

php artisan vendor:publish --provider="AdewaleCharles\Smeify\SmeifyServiceProvider"

A configuration-file named smeify.php with some sensible defaults will be placed in your config directory:

<?php
/*
 * This file is part of the adewalecharles/smeify package.
 *
 * (c) Adewale Ogundiran Charles <shyprince1@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
return [

    /*
    |--------------------------------------------------------------------------
    | Authentication Defaults
    |--------------------------------------------------------------------------
    |
    | This is the authentication credentials you will need to use this package
    |
    */

    'identity' => env('SMEIFY_IDENTITY', null),

    'password' => env('SMEIFY_PASSWORD', null),

];

Usage

Open your .env file and add your smeify login credentials like so:

SMEIFY_IDENTITY = *your smeify username or email*
SMEIFY_PASSWORD = xxxxxxxx

If you are using a hosting service like heroku, ensure to add the above details to your configuration variables.

Then you need to migrate your databse

php artisan migrate

General Usage

To get your list of data plans from smeify all you need to do is call Smeify helper method like so

<?php

namespace App\Http\Controllers;

use AdewaleCharles\Smeify\Http\Smeify;
use Illuminate\Http\Request;

class TestController extends Controller
{

     public function index()
    {

        return Smeify::getDataPlans();
    }

}

To get all your list of transactions from smeify all you need to do is call Smeify helper method like so

<?php

namespace App\Http\Controllers;

use AdewaleCharles\Smeify\Http\Smeify;
use Illuminate\Http\Request;

class TestController extends Controller
{
public function index()
    {

        return Smeify::getTransactions();
    }
}

To initiate an Airtime transaction, just call the smeify helper method like so

<?php

namespace App\Http\Controllers;

use AdewaleCharles\Smeify\Http\Smeify;
use Illuminate\Http\Request;

class TestController extends Controller
{
public function index(Request $request)
    {
        $data = array(
            'phones' => $request['phones'],
            'amount' => $request['amount'],
            'network' => $request['network'],
            'type' => $request['type'] //network can be SAS or VTU
        )

        $response =  Smeify::airtime($data);

        // Then you can do whatever you want with the response either charge your users or log it...
    }
}

To initiate an Data transaction, just call the smeify helper method like so

<?php

namespace App\Http\Controllers;

use AdewaleCharles\Smeify\Http\Smeify;
use Illuminate\Http\Request;

class TestController extends Controller
{
public function index(Request $request)
    {
        $data = array(
             'phones' => $plan['phones'],
            'plan' => $plan['plan'], //plan is the id of the plan you got when you called the getDataPlans() method.
        )

        $response =  Smeify::data($data);

        // Then you can do whatever you want with the response either charge your users or log it...
    }
}

To get Data plans based on a particular network, call this package helper method like so.

<?php

namespace App\Http\Controllers;

use AdewaleCharles\Smeify\Http\Smeify;
use Illuminate\Http\Request;

class TestController extends Controller
{
public function index(Request $request)
    {

        $response =  Smeify::getDataPlansByNetworkId($networkId);

        // Then you can do whatever you want with the response either log it...
    }
}

To verify a transaction or confirm its status using its refrence call this package helper method like so.

<?php

namespace App\Http\Controllers;

use AdewaleCharles\Smeify\Http\Smeify;
use Illuminate\Http\Request;

class TestController extends Controller
{
public function index(Request $request)
    {

        $response =  Smeify::veriyTransactionByReference($reference);

        // Then you can do whatever you want with the response either log it...
    }
}

To verify bulk transactions or confirm there status using their order_id call this package helper method like so.

<?php

namespace App\Http\Controllers;

use AdewaleCharles\Smeify\Http\Smeify;
use Illuminate\Http\Request;

class TestController extends Controller
{
public function index(Request $request)
    {

        $response =  Smeify::verifyTransactionByOrderId($orderId);

        // Then you can do whatever you want with the response either log it...
    }
}

adewalecharles/smeify 适用场景与选型建议

adewalecharles/smeify 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 135 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 10 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「adewalecharles」 「smeify」 「bills payment」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 adewalecharles/smeify 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 adewalecharles/smeify 我们能提供哪些服务?
定制开发 / 二次开发

基于 adewalecharles/smeify 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-28