PHPackages                             bhekor/laravel-monnify - 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. bhekor/laravel-monnify

ActiveLibrary[Payment Processing](/categories/payments)

bhekor/laravel-monnify
======================

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

v0.0.5(1y ago)31.4k↓33.3%1MITPHPPHP ^7.2|^8.0|^8.2

Since Apr 20Pushed 1y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (6)Versions (8)Used By (0)

Laravel Monnify
===============

[](#laravel-monnify)

[![Build Status](https://camo.githubusercontent.com/569fbfd657e276ac52858f37e321b5e1cd7cd5affff2be81aa9933699d8e47b1/68747470733a2f2f7472617669732d63692e6f72672f6268656b6f722f6c61726176656c2d6d6f6e6e6966792e7376673f6272616e63683d6d61696e)](https://travis-ci.org/github/bhekor/laravel-monnify)[![Latest Version on Packagist](https://camo.githubusercontent.com/ec31654152afda623e2073a5612cb168449dfc7880a574614764416fd61242a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6268656b6f722f6c61726176656c2d6d6f6e6e6966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bhekor/laravel-monnify)[![Latest Stable Version](https://camo.githubusercontent.com/c294cbb8ba188239ebd4343ae0d3ece0b7cc6ce3840ba2e04851e2bd27fd8c09/68747470733a2f2f706f7365722e707567782e6f72672f6268656b6f722f6c61726176656c2d6d6f6e6e6966792f762f737461626c65)](https://packagist.org/packages/bhekor/laravel-monnify)[![Total Downloads](https://camo.githubusercontent.com/4d358f1fddfc062d90755839a50f5373d27ee13c14d6878a3bf52b09e1c22e98/68747470733a2f2f706f7365722e707567782e6f72672f6268656b6f722f6c61726176656c2d6d6f6e6e6966792f646f776e6c6f616473)](https://packagist.org/packages/bhekor/laravel-monnify)[![License](https://camo.githubusercontent.com/5b4cbddc36d8a763d251f0fa055d0a5b183898aaa38703a60379913b72ba479f/68747470733a2f2f706f7365722e707567782e6f72672f6268656b6f722f6c61726176656c2d6d6f6e6e6966792f6c6963656e7365)](https://packagist.org/packages/bhekor/laravel-monnify)[![Quality Score](https://camo.githubusercontent.com/9c9c911693d47b2b895e7611c5b5c5d385bae2f9fd8d81db0cb9d912c43dd3a3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6268656b6f722f6c61726176656c2d6d6f6e6e6966792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bhekor/laravel-monnify)

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

What is Monnify
---------------

[](#what-is-monnify)

Monnify is a leading payment technology that powers seamless transactions for businesses through omnichannel platforms

Create a Monnify Account [Sign Up](https://app.monnify.com/create-account).

Look up Monnify API Documentation [API Documentation](https://teamapt.atlassian.net/wiki/spaces/MON/overview).

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

[](#installation)

You can install the package via composer:

```
composer require bhekor/laravel-monnify
```

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

```
php artisan monnify:init
```

Laravel Monnify Webhook Event (RESERVED ACCOUNT SHOULD USE THIS)
----------------------------------------------------------------

[](#laravel-monnify-webhook-event-reserved-account-should-use-this)

To handle Monnify Webhook event-based notifications, the Laravel Monnify already include all required webhook endpoints Log on to your [Monnify Dashboard Setting](https://app.monnify.com/settings), under Developer menu, select **Webhook URLs** and set the respective webhook URL as follows:

- Transaction completion `https://your_domain/laravel-monnify/webhook/transaction-completion`
- Refund completion `https://your_domain/laravel-monnify/webhook/refund-completion`
- Disbursement `https://your_domain/laravel-monnify/webhook/disbursement`
- Settlement `https://your_domain/laravel-monnify/webhook/settlement`

NOTE: Make sure you replace `your_domain` with your server url e.g. example.com

##### LEGACY Webhook

[](#legacy-webhook)

To handle Monnify LEGACY Webhook notification the Laravel Monnify already include the webhook endpoint `https://your_domain/laravel-monnify/webhook`, replace `your_domain` with your server url e.g. example.com

- Log on to your [Monnify Dashboard Setting](https://app.monnify.com/settings), select **API Keys &amp; Webhooks** and set your webhook to `https://your_domain/laravel-monnify/webhook`

##### Setup Listener

[](#setup-listener)

Next, create an Event Listener by running the command below within your project directory;

```
php artisan make:listener MonnifyNotificationListener -e NewWebHookCallReceived
```

The `NewWebHookCallReceived` has two properties:

- `WebHookCall webHookCall` =&gt; This is an unguarded Model with property dump from the webhook call `$event->webHookCall->transactionReference` gives you the transactionReference from the webhook call, learn more about Transaction Completion Webhook properties on Monnify API Docs [Here](https://teamapt.atlassian.net/wiki/spaces/MON/pages/213909300/Transaction+Completion+Webhook)
- `bool isValidTransactionHash` =&gt; This does the transaction hash calculation for you ahead of time, if you prefer doing it yourself; `Monnify::Transactions()->calculateHash($event->webHookCall->paymentReference, $event->webHookCall->amountPaid, $event->webHookCall->paidOn, $event->webHookCall->transactionReference);`Laravel Monnify Webhook Event

Please see [MonnifyLegacyNotificationListener.example.txt](MonnifyLegacyNotificationListener.example.txt) for LEGACY sample implementation of the MonnifyNotificationListener. Please see [MonnifyNotificationListener.example.txt](MonnifyNotificationListener.example.txt) for LEGACY sample implementation of the MonnifyNotificationListener.

### Note

[](#note)

To ensure your listener works correctly, you have to register the event within in your `App\Providers\EventServiceProvider` manually if auto discovery isn't turned on

##### Manually Registering Events

[](#manually-registering-events)

Typically, events should be registered via the `EventServiceProvider` `$listen` array; however, you may also register class or closure based event listeners manually in the `boot` method of your `EventServiceProvider`: [Learn More](https://laravel.com/docs/events#manually-registering-events) about manually registering events

```
use Bhekor\LaravelMonnify\Events\NewWebHookCallReceived;
use App\Listeners\MonnifyNotificationListener;

/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
//    ... Other Event Registeration
    NewWebHookCallReceived::class => [
        MonnifyNotificationListener::class,
//    ... Other Listener you wish to also receive the WebHook call event
    ],
];
```

or

##### Turn On Event Discovery

[](#turn-on-event-discovery)

Event discovery is disabled by default, but you can enable it by overriding the `shouldDiscoverEvents` method of your application's `EventServiceProvider`: [Learn More](https://laravel.com/docs/events#event-discovery) about Event Discovery

```
/**
 * Determine if events and listeners should be automatically discovered.
 *
 * @return bool
 */
public function shouldDiscoverEvents()
{
    return true;
}
```

Usage
-----

[](#usage)

> To use the monnify package you must import the Monnify Facades with the import statement below; Other Classes import is based on your specific usage and would be highlighted in their corresponding sections. You'll also need to import the MonnifyFailedRequestException and handle the exception as all failed request will throw this exception the with the corresponding monnify message and code [Learn More](https://docs.teamapt.com/display/MON/Transaction+Responses)

```
    //...
    use Bhekor\LaravelMonnify\Facades\Monnify;
    use Bhekor\LaravelMonnify\Exceptions\MonnifyFailedRequestException;
//...
```

Important Notice!!!
===================

[](#important-notice)

### Migrating from Previous Version of Laravel Monnify

[](#migrating-from-previous-version-of-laravel-monnify)

This new changes reflect my concern for modular code base, I'm certain you should not have any issues migrating and refactoring your codebase, but if you do, kindly contact me or use the issues tab, and I will make sure your concerns are all attended to. The Monnify class has been broken down grouping all actions into five(5) classes, Banks, CustomerReservedAccounts, Disbursements, SubAccounts, and Transactions see example usage below:

```
    //...
    use Bhekor\LaravelMonnify\Facades\Monnify;
    //...

    $responseBody = Monnify::Transactions()->initializeTransaction(float $amount, string $customerName, string $customerEmail, string $paymentReference, string $paymentDescription, string $redirectUrl, MonnifyPaymentMethods $monnifyPaymentMethods, MonnifyIncomeSplitConfig $incomeSplitConfig = null, string $currencyCode = null);
    $responseBody = Monnify::Transactions()->getAllTransactions(array $queryParams);
    $responseBody = Monnify::Transactions()->calculateHash(string $paymentReference, $amountPaid, string $paidOn, string $transactionReference);
    $responseBody = Monnify::Transactions()->getTransactionStatus(string $transactions);
    $responseBody = Monnify::Transactions()->payWithBankTransfer(string $transactionReference, string $bankCode);
```

Before
------

[](#before)

```
    //...
    use Bhekor\LaravelMonnify\Facades\Monnify;
    use Bhekor\LaravelMonnify\Classes\MonnifyPaymentMethod;
    use Bhekor\LaravelMonnify\Classes\MonnifyPaymentMethods;
    //...

    Monnify::initializeTransaction(
                        15000, "Customer Name", "customer@example.com", "transaction_ref", "Transaction Description",
                        "https://youdomain.com/afterpaymentendpoint", new MonnifyPaymentMethods(MonnifyPaymentMethod::CARD(), MonnifyPaymentMethod::ACCOUNT_TRANSFER()));
```

Now
---

[](#now)

```
    //...
    use Bhekor\LaravelMonnify\Facades\Monnify;
    use Bhekor\LaravelMonnify\Classes\MonnifyPaymentMethod;
    use Bhekor\LaravelMonnify\Classes\MonnifyPaymentMethods;
    //...

    Monnify::Transactions()->initializeTransaction(
                        15000, "Customer Name", "customer@example.com", "transaction_ref", "Transaction Description",
                        "https://youdomain.com/afterpaymentendpoint", new MonnifyPaymentMethods(MonnifyPaymentMethod::CARD(), MonnifyPaymentMethod::ACCOUNT_TRANSFER()));
```

Similar implementation applies to other sections (i.e. Banks, CustomerReservedAccounts, Disbursements, and SubAccounts)

```
    //...
    use Bhekor\LaravelMonnify\Facades\Monnify;
    //...
    $responseBody = Monnify::Banks()->getBanks();
    $responseBody = Monnify::Banks()->getBanksWithUSSDShortCode();
    $responseBody = Monnify::Banks()->validateBankAccount(MonnifyBankAccount $bankAccount);

    $responseBody = Monnify::Disbursements()->initiateTransferSingle(float $amount, string $reference, string $narration, MonnifyBankAccount $bankAccount, string $currencyCode = null);
    $responseBody = Monnify::Disbursements()->initiateTransferSingleWithMonnifyTransaction(MonnifyTransaction $monnifyTransaction);
    $responseBody = Monnify::Disbursements()->initiateTransferBulk(string $title, string $batchReference, string $narration, MonnifyOnFailureValidate $onFailureValidate, int $notificationInterval, MonnifyTransactionList $transactionList);
    $responseBody = Monnify::Disbursements()->authorizeTransfer2FA(string $authorizationCode, string $reference, string $path);

    $responseBody = Monnify::SubAccounts()->createSubAccount(string $bankCode, string $accountNumber, string $email, string $currencyCode = null, string $splitPercentage = null);
    $responseBody = Monnify::SubAccounts()->createSubAccounts(array $accounts);
    $responseBody = Monnify::SubAccounts()->getSubAccounts();
    $responseBody = Monnify::SubAccounts()->deleteSubAccount(string $subAccountCode);

    $responseBody = Monnify::ReservedAccounts()->getAllTransactions(array $queryParams);
    $responseBody = Monnify::ReservedAccounts()->reserveAccount(string $accountReference, string $accountName, string $customerEmail, string $customerName = null, string $customerBvn = null, string $currencyCode = null, bool $restrictPaymentSource = false, MonnifyAllowedPaymentSources $allowedPaymentSources = null, MonnifyIncomeSplitConfig $incomeSplitConfig = null);
    $responseBody = Monnify::ReservedAccounts()->getAccountDetails(string $accountReference);
    $responseBody = Monnify::ReservedAccounts()->updateSplitConfig(string $accountReference, MonnifyIncomeSplitConfig $incomeSplitConfig);
```

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

Bugs &amp; Issues
-----------------

[](#bugs--issues)

If you notice any bug or issues with this package kindly create and issues here [ISSUES](https://github.com/bhekor/laravel-monnify/issues)

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Ibidapo Adeolu](https://github.com/bhekor)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance48

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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

Every ~174 days

Total

5

Last Release

423d ago

PHP version history (3 changes)v0.0.1PHP ^7.2|^8.0

v0.0.4PHP ^7.2|^8.0|^9.0|^10.0|^11.0

v0.0.5PHP ^7.2|^8.0|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/a9fa33dda7a8273805d765fb106d099bfc989312a3b35aac349958e7fa0f6819?d=identicon)[bhekor](/maintainers/bhekor)

---

Top Contributors

[![bhekor](https://avatars.githubusercontent.com/u/10033255?v=4)](https://github.com/bhekor "bhekor (10 commits)")

---

Tags

laravelpaymentcard-paymentbank transfermonnify

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bhekor-laravel-monnify/health.svg)

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

###  Alternatives

[henryejemuta/laravel-monnify

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

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

A Laravel package for integrating the Viva Payments gateway

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

PHPackages © 2026

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