PHPackages                             henryejemuta/laravel-megasubplug - 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. [Payment Processing](/categories/payments)
4. /
5. henryejemuta/laravel-megasubplug

ActiveLibrary[Payment Processing](/categories/payments)

henryejemuta/laravel-megasubplug
================================

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

v1.0.0(2y ago)19[1 issues](https://github.com/henryejemuta/laravel-megasubplug/issues)MITPHPPHP ^8.0

Since May 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/henryejemuta/laravel-megasubplug)[ Packagist](https://packagist.org/packages/henryejemuta/laravel-megasubplug)[ Docs](https://github.com/henryejemuta/laravel-megasubplug)[ RSS](/packages/henryejemuta-laravel-megasubplug/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Laravel MegaSubPlug
===================

[](#laravel-megasubplug)

[![Latest Version on Packagist](https://camo.githubusercontent.com/af02b41b4c200a6668a25920bbf93d54b6b20a303921b4a78c6eed107b97771c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68656e7279656a656d7574612f6c61726176656c2d6d656761737562706c7567706c75672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/henryejemuta/laravel-megasupplug)[![Latest Stable Version](https://camo.githubusercontent.com/3d071d589aadbc65e79ee1a7e6bc7d589c2ac7d101819500946abbf99c974ccf/68747470733a2f2f706f7365722e707567782e6f72672f68656e7279656a656d7574612f6c61726176656c2d6d656761737570706c75672f762f737461626c65)](https://packagist.org/packages/henryejemuta/laravel-megasupplug)[![Total Downloads](https://camo.githubusercontent.com/e8c1dfb8f10b0ce404c7b2abf86b7b3578c2b30392dcbb1021e37ef9d27210d2/68747470733a2f2f706f7365722e707567782e6f72672f68656e7279656a656d7574612f6c61726176656c2d6d656761737570706c75672f646f776e6c6f616473)](https://packagist.org/packages/henryejemuta/laravel-megasupplug)[![License](https://camo.githubusercontent.com/9c222b703c85df100fed4ea9ae2ac9f6360994823b986c02ab9846a5b9a97762/68747470733a2f2f706f7365722e707567782e6f72672f68656e7279656a656d7574612f6c61726176656c2d6d656761737570706c75672f6c6963656e7365)](https://packagist.org/packages/henryejemuta/laravel-megasupplug)[![Quality Score](https://camo.githubusercontent.com/551117ec488656d7551cfe8e4964ff91571c42e5dbf4f065b2c9fcce8c5cdd56/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f68656e7279656a656d7574612f6c61726176656c2d6d656761737570706c75672e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/henryejemuta/laravel-megasupplug)

What is MegaSubPlug
-------------------

[](#what-is-megasubplug)

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

What is Laravel MegaSubPlug
---------------------------

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

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

Create a MegaSubPlug Account [Sign Up](https://megasubplug.com/Register/).

Look up MegaSubPlug API Documentation [API Documentation](./mega-sub-plug-apidocs.pdf). The Updated Mega-Sub Api Documentation is now part of the repository, as there seems to be broken links finding it on their dashboard

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

[](#installation)

You can install the package via composer:

```
composer require henryejemuta/laravel-megasubplug
```

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

```
php artisan megasubplug: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 MegaSubPlugErrorException on failed request**

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

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

```
use HenryEjemuta\LaravelMegaSubPlug\Facades\MegaSubPlug;
use HenryEjemuta\LaravelMegaSubPlug\Classes\MegaSubPlugResponse;

...

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

//A dump of the MegaSubPlugResponse on successful airtime purchase
HenryEjemuta\LaravelMegaSubPlug\Classes\MegaSubPlugResponse {#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 = MegaSubPlugFacade::buyData(MegaSubPlugNetworkEnum::getNetwork("mtn"), 7, "08134567890");
} catch (MegaSubPlugErrorException $exception) {
    Log::error($exception->getMessage() . "\n\r" . $exception->getCode());
}

//A dump of the MegaSubPlugResponse on successful data purchase
HenryEjemuta\LaravelMegaSubPlug\Classes\MegaSubPlugResponse {#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 MegaSubPlugResponse
     * @throws MegaSubPlugErrorException
     */
    public function checkUserDetails(): MegaSubPlugResponse

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

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

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

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

    /**
     * Electricity Bills payment handler to access:
     * Electricity()->verifyMeterNumber(DiscoEnum $disco, $meterNumber, MeterTypeEnum $meterType): MegaSubPlugResponse
     * Electricity()->buyElectricity(DiscoEnum $disco, $meterNumber, $amount, MeterTypeEnum $meterType): MegaSubPlugResponse
     *
     * @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

18

—

LowBetter than 8% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1084d ago

### 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 (2 commits)")

---

Tags

paymentNigeriaairtimedata bundlebill paymentUtility BillsCable Billshenryejemutalaravel-megasubplugMegaSubPlug

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

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