PHPackages                             henryejemuta/laravel-megasup - 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-megasup

ActiveLibrary[Payment Processing](/categories/payments)

henryejemuta/laravel-megasup
============================

A laravel package to seamlessly integrate MegaSup API into your laravel application. The MegaSup 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 &amp; mobile apps). You can also start your own VTU business by integrating our VTU API and resell our services in Nigeria.

v1.0.0(4y ago)126MITPHPPHP ^7.4|^8.0

Since Aug 29Pushed 4y ago1 watchersCompare

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

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

Laravel MegaSup
===============

[](#laravel-megasup)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a4f460449aa30cdb67e73613dd40f3b336c9d5f8bd36eecfd3628c60aa589948/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68656e7279656a656d7574612f6c61726176656c2d6d6567617375702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/henryejemuta/laravel-megasup)[![Latest Stable Version](https://camo.githubusercontent.com/e19d46afd93f09af5703b880cfc66d4df121c860eb7edaaee4dfd268d62c0e34/68747470733a2f2f706f7365722e707567782e6f72672f68656e7279656a656d7574612f6c61726176656c2d6d6567617375702f762f737461626c65)](https://packagist.org/packages/henryejemuta/laravel-megasup)[![Total Downloads](https://camo.githubusercontent.com/0742d80f50d3956f154ed32a21cfe4fb93f93c12a58ee8798abb772805b2b29d/68747470733a2f2f706f7365722e707567782e6f72672f68656e7279656a656d7574612f6c61726176656c2d6d6567617375702f646f776e6c6f616473)](https://packagist.org/packages/henryejemuta/laravel-megasup)[![License](https://camo.githubusercontent.com/1b6592e42e03cbc59171e724391308f74d30f180ce651ed0ec2a3af3ff4ef04f/68747470733a2f2f706f7365722e707567782e6f72672f68656e7279656a656d7574612f6c61726176656c2d6d6567617375702f6c6963656e7365)](https://packagist.org/packages/henryejemuta/laravel-megasup)[![Quality Score](https://camo.githubusercontent.com/f23c48cd7b7726d18c05f1077b895a95cbd76154d8297ca860de0721f5c2cf64/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f68656e7279656a656d7574612f6c61726176656c2d6d6567617375702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/henryejemuta/laravel-megasup)

What is MegaSup
---------------

[](#what-is-megasup)

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

What is Laravel MegaSup
-----------------------

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

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

Create a MegaSup Account [Sign Up](https://mega-sub.com/signup/).

Look up MegaSup API Documentation [API Documentation](https://www.mega-sub.com/documentation/).

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

[](#installation)

You can install the package via composer:

```
composer require henryejemuta/laravel-megasup
```

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

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

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

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

```
use HenryEjemuta\LaravelMegaSup\Facades\MegaSup;
use HenryEjemuta\LaravelMegaSup\Classes\MegaSupResponse;

...

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

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

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

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

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

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

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

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

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

1718d 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 (1 commits)")

---

Tags

paymentNigeriaairtimedata bundlebill paymentUtility BillsCable Billshenryejemutalaravel-megasupMegaSup

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)
