承接 giftbalogun/kudaapitoken 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

giftbalogun/kudaapitoken

Composer 安装命令:

composer require giftbalogun/kudaapitoken

包简介

KudaApiToken is a library to allow communication with Kuda Bank API to setup your own fintech apps

README 文档

README

Github top language Star GitHub issues License

Laravel integration with KudaOpenApi for seemless Banking via Kuda Bank Open Api

Table of Contents

  1. Getting Started
  2. Installation
  3. Usage
  4. Documentation
  5. Testing and Debugging
  6. License
  7. Social Presence

🎯 Getting Started

Enable your product for local transactions with the KUDA Open API platform! With the KUDA Open APIs, you can embed services on your platform and connect your customers to a wide range of banking services.

Note: Ensure you have a KUDA Business account linked to your profile for live access.

Steps:

  1. Sign up for a KUDA Business account.
  2. Generate an API token from your developer dashboard.
  3. Proceed with the installation and configuration below.

🎯 Installation

PHP 7.2+ and Composer are required.

To get the latest version of KudaApiToken, simply require it

composer require giftbalogun/kudapaitoken

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

"giftbalogun/kudapaitoken": "1.0.*"

and add This

"repositories": [
    {
        "type": "git",
        "url": "https://github.com/giftbalogun/kudaApiToken"
    }
],

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

⚙️ Configuration

Publish the configuration file:

php artisan vendor:publish --provider="Giftbalogun\Kudaapitoken\KudaApiTokenServiceProvider"

Open your .env file and add your public key, secret key, merchant email and payment url like so:

KUDA_API_TOKEN=XXXXXXXXXXXXXXXXXXXX
KUDA_API_URL=XXXXXXXXXXXXXXXXXXXXXX
KUDA_USER_EMAIL=YOUR_EMAIL
ENVIRONMENT_ENV=LIVE_OR_TEST

⭐ Documentation

Documentation http://kudaapitoken.readthedocs.io (COMING SOON)

Article Medium to Read https://medium.com/@giftbalogun/laravel-integration-with-kudaopenapi-663825ecd247

✨ Usage

Availbale coomand to be use are in COMMAND file with easy to understand related to ServiceTypes.

Send request with this command.

//simple
$data = [
    'email' => $request->email,
    'phoneNumber' => $request->phone,
    'lastName' => $request->l_name,
    'firstName' => $request->f_name,
    'businessName' => $request->business_name,
    'trackingReference' => $customer_code,
]; # $data is the format for making request to the api 

$ref = rand(); #used to generate randon unique number for the request

//For Pay with Transfer
$data = [
    "Amount"=>5000000,
    "IsFlexiblePayment"=>true, //true or false
    "RemittingAccounts"=>[
    {
        "SplitPercentage"=>50,
        "AccountName"=>"foods",
        "AccountNumber"=>"3020806687"
    },
    {
        "SplitPercentage"=>50,
        "AccountName"=>"foods",
        "AccountNumber"=>"3020808612"
    }
    ]
];

Styles of Calling the Controller

use Giftbalogun\Kudaapitoken\Controllers\KudaBankController;

$this->kudabankservice->create_virtual_account($data, $ref);

OR

use Giftbalogun\Kudaapitoken\Kuda;

$this->kuda->initController('default')->create_virtual_account($data, $ref);
## Controllers include 'Bill', 'Card', 'GiftCard', 'KudaBank' | Default is same as KudaBank

⚡️ Available Controllers

$kuda->initController('Bill');
$kuda->initController('Card');
$kuda->initController('Saving');
$kuda->initController('PayWith');
$kuda->initController('KudaBank'); // default
$kuda->initController('GiftCard');

⚡️ Example: Creating a Customer Account

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Giftbalogun\Kudaapitoken\Controllers\KudaBankController;
use Giftbalogun\Kudaapitoken\Kuda;

class CustomController extends Controller
{
    private $kuda;
    private $kudabankservice;

    public function __construct()
    {
        $this->kudabankservice = new KudaBankController();
        ## Or call from Kuda service
        $this->kuda = new Kuda;
    }

    public function createcustomeraccount()
    {
        $customer_code = '000' . random_int(100000, 999999) . '0000';

        $data = [
            'email' => $request->email,
            'phoneNumber' => $request->phone,
            'lastName' => $request->l_name,
            'firstName' => $request->f_name,
            'businessName' => $request->business_name,
            'trackingReference' => $customer_code,
        ];
        $ref = rand();

        $newcustomeraccount = $this->kudabankservice->create_virtual_account($data, $ref);

        ## Or you can load from the Kuda Service
        
        $newcustomeraccount = $this->kuda->initController('default')->create_virtual_account($data, $ref);
        ## Controllers include 'Bill', 'Card', 'GiftCard', 'KudaBank' | Default is same as KudaBank

        $getvaccount = json_decode($newcustomeraccount['data']);

        return $getvaccount;
    }
}

⚡️ Example: Calling Status Helper

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Giftbalogun\Kudaapitoken\KudaStatusCodes;

class CustomController extends Controller
{
    public function createcustomeraccount()
    {
        $code = '00';
        $message = KudaStatusCodes::getMessage($code, 'kuda_to_kuda');

        echo $message ?? 'Unknown Status';  // Output: Successful
    }
}

💸 Example: Get Admin Balance

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Giftbalogun\Kudaapitoken\Kuda;

class CustomController extends Controller
{
    private $kuda;
    private $kudabankservice;

    public function __construct()
    {
        ##Kuda service
        $this->kuda = new Kuda;
    }

    public function getadminbalance()
    {
        $data = [];

        $ref = rand();

        ##load from the Kuda Service
        $balance = $this->kuda->initController('KudaBank')->getadminbalance($data, $ref);
        ## Controllers include 'Bill', 'Card', 'GiftCard', 'KudaBank' | Default is same as KudaBank

        $getadminbalance = json_decode($balance['data']);

        return $getadminbalance;
    }
}

📝 License

This project is under license from MIT. For more details, see the LICENSE file.

Social Presense

Follow me on social media Medium! Twitter! Instagram! LinkedIn! Porfolio!

Made with ❤️ by Gift Balogun

 

Back to top

giftbalogun/kudaapitoken 适用场景与选型建议

giftbalogun/kudaapitoken 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 47 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 07 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-22