定制 henryejemuta/php-clubkash-vtu 二次开发

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

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

henryejemuta/php-clubkash-vtu

最新稳定版本:v0.0.1

Composer 安装命令:

composer require henryejemuta/php-clubkash-vtu

包简介

A PHP package for integrating with the ClubKash VTU API.

README 文档

README

Run Tests Latest Stable Version Total Downloads License Quality Score

A robust PHP package for integrating with the ClubKash (Nellobytes Systems) VTU API. This package allows you to easily purchase airtime, data, cable TV, and electricity tokens.

Features

  • Airtime Purchase: Buy airtime for all major Nigerian networks.
  • Data Purchase: Buy data bundles for all major Nigerian networks.
  • Cable TV Subscription: Subscribe to DSTV, GOTV, and Startimes.
  • Electricity Bill Payment: Pay for prepaid and postpaid electricity meters.
  • Wallet Balance: Check your wallet balance.
  • Universal Compatibility: Works with Laravel, CodeIgniter, Symfony, and raw PHP projects.

Installation

You can install the package via composer:

composer require henryejemuta/php-clubkash-vtu

Usage

Initialization

To start using the package, initialize the Client with your UserID, API Key, and optional configuration. You can also pass an existing token if available to skip initial authentication.

use HenryEjemuta\Clubkash\Client;

$config = [
    'timeout' => 30,
    // 'token' => 'YOUR_CACHED_TOKEN', // Optional: Reuse valid token
];

$client = new Client('YOUR_USER_ID', 'YOUR_API_KEY', $config);

Authentication (Token Generation)

The API supports token-based authentication. Tokens are valid for 7 days. It is recommended to cache the token and reuse it.

// Authenticate to get a new token
$authResponse = $client->authenticate();
if (isset($authResponse['token'])) {
    $token = $authResponse['token'];
    // Store $token in your database/cache with expiry
}

Check Wallet Balance

try {
    $balance = $client->getWalletBalance();
    print_r($balance);
} catch (\Exception $e) {
    echo "Error: " . $e->getMessage();
}

Airtime Purchase

// Network Codes: 01=MTN, 02=GLO, 03=9Mobile, 04=Airtel
$response = $client->purchaseAirtime('01', 100.00, '08012345678');
print_r($response);

Data Purchase

// Data Plan Code: Get from ClubKash Documentation or use verify tool
$response = $client->purchaseData('01', 'DATA_PLAN_CODE', '08012345678');
print_r($response);

Cable TV Subscription

// CableTV: 'dstv', 'gotv', 'startimes'
$response = $client->purchaseCableTV('dstv', 'package_code', 'IUC_NUMBER', 'PHONE_NUMBER');
print_r($response);

Electricity Payment

// ElectricCompany: '01', '02', etc. MeterType: '01' (Prepaid), '02' (Postpaid)
$response = $client->purchaseElectricity('01', 'METER_NUMBER', '01', 1000.00, 'PHONE_NUMBER');
print_r($response);

API Documentation

For full API documentation, please refer to the Nellobytes Systems API.

Testing

composer test

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-25