PHPackages                             henryejemuta/laravel-husmodata - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. henryejemuta/laravel-husmodata

ActiveLibrary[API Development](/categories/api)

henryejemuta/laravel-husmodata
==============================

A laravel package to seamlessly integrate HusmoData API into your laravel application. The HusmoData API allows you to integrate all virtual top-up and bills payment services available on the HusmoData platform with your application (websites, desktop apps &amp; mobile apps). You can also start your own VTU business by integrating this API and resell HusmoData services in Nigeria.

031PHP

Since Sep 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/henryejemuta/laravel-husmodata)[ Packagist](https://packagist.org/packages/henryejemuta/laravel-husmodata)[ RSS](/packages/henryejemuta-laravel-husmodata/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel HusmoData
=================

[](#laravel-husmodata)

[![Latest Version on Packagist](https://camo.githubusercontent.com/56849e957d514c15288ed9eadb595b75ce20d9f3ea836c2b69a0b60c7bc7a50d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68656e7279656a656d7574612f6c61726176656c2d6875736d6f646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/henryejemuta/laravel-husmodata)[![Latest Stable Version](https://camo.githubusercontent.com/8623f7e1e38af5c4d9b4cba98e7faffb0bc7a0601cecdac11cb53902bd3c574c/68747470733a2f2f706f7365722e707567782e6f72672f68656e7279656a656d7574612f6c61726176656c2d6875736d6f646174612f762f737461626c65)](https://packagist.org/packages/henryejemuta/laravel-husmodata)[![Total Downloads](https://camo.githubusercontent.com/dd4817b21ea43354e8296262246a6cb859c7acfef7c939c584d6c660564f92c2/68747470733a2f2f706f7365722e707567782e6f72672f68656e7279656a656d7574612f6c61726176656c2d6875736d6f646174612f646f776e6c6f616473)](https://packagist.org/packages/henryejemuta/laravel-husmodata)[![License](https://camo.githubusercontent.com/86edf8503b084dd5f74cb1f675608e39011fe25f07ca8b7a34aa98392fdc3346/68747470733a2f2f706f7365722e707567782e6f72672f68656e7279656a656d7574612f6c61726176656c2d6875736d6f646174612f6c6963656e7365)](https://packagist.org/packages/henryejemuta/laravel-husmodata)[![Quality Score](https://camo.githubusercontent.com/d1d79363087fedaff4223299a8bb2d47e8560f791d878bca049616b2123e8238/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f68656e7279656a656d7574612f6c61726176656c2d6875736d6f646174612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/henryejemuta/laravel-husmodata)

What is HusmoData
-----------------

[](#what-is-husmodata)

The HusmoData API allows you to integrate all virtual top-up and bills payment services available on the HusmoData platform with your application (websites, desktop apps &amp; mobile apps). You can also start your own VTU business by integrating this API and resell HusmoData services in Nigeria.

What is Laravel HusmoData
-------------------------

[](#what-is-laravel-husmodata)

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

Create a HusmoData Account [Sign Up](https://www.husmodata.com/signup/).

Get your API Token from your HusmoData Dashboard [Get My API Token](https://www.husmodata.com/documentation/).

Look up HusmoData API Documentation [API Documentation](https://documenter.getpostman.com/view/10645604/TVKHVFW7).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require henryejemuta/laravel-husmodata
```

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

```
php artisan husmodata:init
```

Usage
-----

[](#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 HusmoDataErrorException on failed request**

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

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

```
use HenryEjemuta\LaravelHusmoData\Facades\HusmoData;
use HenryEjemuta\LaravelHusmoData\Classes\HusmoDataResponse;

...

//To buy Airtime
try{
    $response = HusmoDataFacade::buyAirtime(NetworkEnum::getNetwork('mtn'), 100, '08134567890');
} catch (HusmoDataErrorException $exception) {
    Log::error($exception->getMessage() . "\n\r" . $exception->getCode());
}

//A dump of the HusmoDataResponse on successful airtime purchase
/*
HenryEjemuta\LaravelHusmoData\Classes\HusmoDataResponse {#1423 ▼
  -message: ""
  -hasError: false
  -error: null
  -code: 200
  -body: {#1539 ▼
    +"id": 167630
    +"airtime_type": "VTU"
    +"network": 1
    +"paid_amount": "97.0"
    +"mobile_number": "08134567890"
    +"amount": "100"
    +"plan_amount": "₦100"
    +"plan_network": "MTN"
    +"balance_before": "2892.6"
    +"balance_after": "2795.6"
    +"Status": "successful"
    +"create_date": "2021-08-28T21:02:54.311846"
    +"Ported_number": true
  }
}
*/

//To buy Data Bundle
try{
    $response = HusmoDataFacade::buyData(HusmoDataNetworkEnum::getNetwork("mtn"), 7, "08134567890");
} catch (HusmoDataErrorException $exception) {
    Log::error($exception->getMessage() . "\n\r" . $exception->getCode());
}

//A dump of the HusmoDataResponse on successful data purchase
/*
HenryEjemuta\LaravelHusmoData\Classes\HusmoDataResponse {#1423 ▼
  -message: ""
  -hasError: false
  -error: null
  -code: 200
  -body: {#1539 ▼
    +"id": 108602
    +"network": 1
    +"balance_before": "2698.6"
    +"balance_after": "2459.6"
    +"mobile_number": "08134567890"
    +"plan": 7
    +"Status": "successful"
    +"plan_network": "MTN"
    +"plan_name": "1.0GB"
    +"plan_amount": "₦239.0"
    +"create_date": "2021-08-28T21:27:41.169631"
    +"Ported_number": true
  }
}
...
*/
```

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

```
    /**
     * Get Your MegaSub account details including available balance
     * @return HusmoDataResponse
     * @throws HusmoDataErrorException
     */
    public function checkUserDetails(): HusmoDataResponse

    /**
     * @param NetworkEnum $mobileNetwork
     * @param int $amount
     * @param $phoneNumber
     * @param bool $portedNumber
     * @param string $airtimeType
     * @return HusmoDataResponse
     * @throws HusmoDataErrorException
     */
    public function buyAirtime(NetworkEnum $mobileNetwork, int $amount, $phoneNumber, bool $portedNumber = true, string $airtimeType = "VTU"): HusmoDataResponse

    /**
     * HusmoData API Transaction handler to access:
     * Transaction()->getAllDataTransaction(): HusmoDataResponse
     * Transaction()->queryDataTransaction(int $txnId): HusmoDataResponse
     * Transaction()->queryAirtimeTransaction(int $txnId): HusmoDataResponse
     * Transaction()->queryElectricityBillTransaction(int $txnId): HusmoDataResponse
     * Transaction()->queryCableTvTransaction(int $txnId): HusmoDataResponse
     *
     * @return Transaction
     */
    public function Transaction(): Transaction

    /**
     * Cable TV Bill handler to access:
     * CableTv()->verifyIUC(CableTvEnum $cableTv, $smartCardNo): HusmoDataResponse
     * CableTv()->purchasePackage(CableTvEnum $cableTv, string $package, $smartCardNo): HusmoDataResponse
     *
     * @return CableTv
     */
    public function CableTv(): CableTv

    /**
     * @param NetworkEnum $network
     * @param string $plan
     * @param string $phoneNumber
     * @param bool $portedNumber
     * @return HusmoDataResponse
     * @throws HusmoDataErrorException
     */
    public function buyData(NetworkEnum $network, string $plan, string $phoneNumber, bool $portedNumber = true): HusmoDataResponse

    /**
     * Electricity Bills payment handler to access:
     * Electricity()->verifyMeterNumber(DiscoEnum $disco, $meterNumber, MeterTypeEnum $meterType): HusmoDataResponse
     * Electricity()->buyElectricity(DiscoEnum $disco, $meterNumber, $amount, MeterTypeEnum $meterType): HusmoDataResponse
     *
     * @return Electricity
     */
    public function Electricity(): Electricity
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Henry Ejemuta](https://github.com/henryejemuta)
- [All Contributors](https://github.com/henryejemuta/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/54673a3d375309540e1831b2827b8bf499d048dfe3cdb56193cf575c4105d85f?d=identicon)[henryejemuta](/maintainers/henryejemuta)

---

Top Contributors

[![henryejemuta](https://avatars.githubusercontent.com/u/13375596?v=4)](https://github.com/henryejemuta "henryejemuta (1 commits)")

### Embed Badge

![Health badge](/badges/henryejemuta-laravel-husmodata/health.svg)

```
[![Health](https://phpackages.com/badges/henryejemuta-laravel-husmodata/health.svg)](https://phpackages.com/packages/henryejemuta-laravel-husmodata)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
