承接 henryejemuta/laravel-clubkonnect 相关项目开发

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

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

henryejemuta/laravel-clubkonnect

Composer 安装命令:

composer require henryejemuta/laravel-clubkonnect

包简介

A laravel package to seamlessly integrate ClubKonnect API into your laravel application. The ClubKonnect API is an HTTPs GET API that allows you to integrate all virtual top-up and bills payment services available on our platform with your application (websites, desktop apps & mobile apps). You can

README 文档

README

Latest Version on Packagist Latest Stable Version Total Downloads License Quality Score

What is ClubKonnect

The ClubKonnect API is an HTTPs GET API that allows you to integrate all ClubKonnect virtual top-up and bills payment services available on our platform with your application (websites, desktop apps & mobile apps). You can also start your own VTU business by integrating our VTU API and resell our services in Nigeria.

What is Laravel ClubKonnect

Laravel ClubKonnect is a laravel package to seamlessly integrate ClubKonnect api within your laravel application.

Create a ClubKonnect Account Sign Up.

Look up ClubKonnect API Documentation API Documentation.

Installation

You can install the package via composer:

composer require henryejemuta/laravel-clubkonnect

Publish ClubKonnect configuration file, migrations as well as set default details in .env file:

php artisan clubkonnect:init

Usage

Important: Kindly use the $response->successful() to check the response state before proceeding with working with the response and gracefully throw and handle the ClubKonnectErrorException on failed request

Before initiating any transaction kindly check your balance to confirm you have enough ClubKonnect balance to handle the transaction

The Laravel ClubKonnect Package is quite easy to use via the ClubKonnect facade

use HenryEjemuta\LaravelClubKonnect\Facades\ClubKonnect;
use HenryEjemuta\LaravelClubKonnect\Classes\ClubKonnectResponse;

...
//Check ClubKonnect Balance
    $response = ClubKonnect::getWalletBalance();
    if ($response->successful()) {
        $body = $response->getBody();
        echo "Your {$body->phoneno} ClubKonnect Balance is {$body->balance}";
    } else {
        $exception = $response->getErrorException();
        Log::error("Error while checking balance\n\r" . $exception->getCode() . ": " . $exception->getMessage());
    }

//To buy Airtime
    $response = ClubKonnect::purchaseAirtime(NetworkEnum::getNetwork('mtn'), '1500', '08134567890', 'MY_UNIQUE_TXN_ID', 'https://example.com/afterorderurl');
    if (!$response->successful()) {
            $exception = $response->getErrorException();
        Log::error("Error while purchasing airtime\n\r" . $exception->getCode() . ": " . $exception->getMessage());
    }

...

Find an overview of all method with comment on what they do and expected arguments

        /**
         * Check your Server IP
         * @return ClubKonnectResponse
         */
        public function checkYourServerIP(): ClubKonnectResponse
    
        /**
         * Get Your wallet available balance, Wallet is identified by username set in clubkonnect config or environmental variable
         * @return ClubKonnectResponse
         */
        public function getWalletBalance(): ClubKonnectResponse
    
        /**
         * @param NetworkEnum $mobileNetwork
         * @param int $amount
         * @param $phoneNumber
         * @param $requestID
         * @param $callbackUrl
         * @return ClubKonnectResponse
         */
        public function purchaseAirtime(NetworkEnum $mobileNetwork, int $amount, $phoneNumber, $requestID, $callbackUrl): ClubKonnectResponse
    
        /**
         * ClubKonnect API Transaction handler to access:
         * CableTv()->queryByOrderID(string $orderID);
         * CableTv()->queryByRequestID(string $requestID);
         * CableTv()->cancelTransaction(string $orderID);
         *
         * @return Transaction
         */
        public function Transaction(): Transaction
    
        /**
         * Smile Bill handler to access:
         * CableTv()->getDataBundles();
         * CableTv()->verifySmileAccountID($phoneNumber);
         * CableTv()->purchaseBundle(string $plan, string $phoneNumber, $requestID, $callbackUrl = null);
         *
         * @return Smile
         */
        public function Smile(): Smile
    
        /**
         * Cable TV Bill handler to access:
         * CableTv()->getTvPackages();
         * CableTv()->verifyCustomerID(CableTvEnum $cableTv, $smartCardNo);
         * CableTv()->purchasePackage(CableTvEnum $cableTv, string $package, $smartCardNo, $requestID, $callbackUrl = null);
         *
         * @return CableTv
         */
        public function CableTv(): CableTv
    
        /**
         * Recharge Card Printing handler to access:
         * RechargeCardPrinting()->getEPinNetworks();
         * RechargeCardPrinting()->buyEPins(NetworkEnum $network, $amount, int $quantity, $requestID, $callbackUrl = null);
         *
         * @return RechargeCardPrinting
         */
        public function RechargeCardPrinting(): RechargeCardPrinting
    
    
        /**
         * Get all Data Bundles
         * @return ClubKonnectResponse
         */
        public function getDataBundles(): ClubKonnectResponse
    
    
        /**
         * @param NetworkEnum $network
         * @param string $plan
         * @param string $phoneNumber
         * @param $requestID
         * @param $callbackUrl
         * @return ClubKonnectResponse
         */
        public function purchaseDataBundle(NetworkEnum $network, string $plan, string $phoneNumber, $requestID, $callbackUrl): ClubKonnectResponse

        
    /**
     * Electricity Bills payment handler to access:
     * Electricity()->getDiscosAndMinMax();
     * Electricity()->verifyMeterNumber(DiscoEnum $disco, $meterNumber): ClubKonnectResponse
     * Electricity()->buyElectricity(DiscoEnum $disco, $meterNumber, $amount, MeterTypeEnum $meterType, $requestID, $callbackUrl = null): ClubKonnectResponse
     *
     * @return Electricity
     */
    public function Electricity(): Electricity

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email henry.ejemuta@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固