PHPackages                             bazegel/laravel-monobank - 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. bazegel/laravel-monobank

ActiveLibrary[API Development](/categories/api)

bazegel/laravel-monobank
========================

Laravel package for Monobank

01PHP

Since Sep 9Pushed 9mo agoCompare

[ Source](https://github.com/Bazegel/laravel-monobank)[ Packagist](https://packagist.org/packages/bazegel/laravel-monobank)[ RSS](/packages/bazegel-laravel-monobank/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

**English** | [Українська](README.uk.md)

Laravel Monobank Acquiring API
==============================

[](#laravel-monobank-acquiring-api)

A package for integrating with the Monobank Acquiring API in Laravel applications.

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

[](#installation)

You can install the package via composer:

```
composer require bazegel/laravel-monobank
```

Configuration
-------------

[](#configuration)

1. Publish the configuration file:

    ```
    php artisan vendor:publish --provider="Bazegel\Monobank\Providers\MonobankServiceProvider" --tag="config"
    ```

    This command will create a `config/monobank.php` file.
2. Add your acquiring token to the `.env` file:

    ```
    MONOBANK_TOKEN=your_secret_token
    ```

Usage
-----

[](#usage)

The package provides a convenient `Monobank` facade for interacting with the API.

### Creating an Invoice

[](#creating-an-invoice)

To create an invoice and redirect the user to the payment page:

```
use Bazegel\Monobank\Facades\Monobank;
use Illuminate\Http\Request;

class PaymentController extends Controller
{
    public function createPayment(Request $request)
    {
        $invoiceData = [
            'amount' => 1000, // Amount in the smallest currency units (e.g., kopecks)
            'ccy' => 980, // ISO 4217 currency code (980 = UAH)
            'redirectUrl' => route('payment.success'),
            'webHookUrl' => route('monobank.webhook'),
            'merchantPaymInfo' => [
                'destination' => 'Payment for order #12345',
                'basketOrder' => [
                    [
                        'name' => 'Product 1',
                        'qty' => 1,
                        'sum' => 1000,
                        'unit' => 'pcs.'
                    ]
                ]
            ],
        ];

        try {
            $response = Monobank::createInvoice($invoiceData);

            // Get the payment URL
            $paymentUrl = $response->getData('pageUrl');

            // Redirect the user to the payment page
            return redirect()->away($paymentUrl);

        } catch (\Exception $e) {
            // Error handling
            return back()->withErrors('Payment creation error: ' . $e->getMessage());
        }
    }
}
```

### Checking Invoice Status

[](#checking-invoice-status)

You can check the status of a previously created invoice by its `invoiceId`.

```
use Bazegel\Monobank\Facades\Monobank;

$invoiceId = '240228A9aB1cD23d4E5f'; // Invoice ID received upon creation

try {
    $response = Monobank::getInvoiceStatus($invoiceId);

    // 'created', 'processing', 'hold', 'success', 'failure', 'expired'
    $status = $response->getData('status');

    if ($status === 'success') {
        // Payment is successful
    }

} catch (\Exception $e) {
    // Error handling
}
```

### Handling Webhooks

[](#handling-webhooks)

Create a route and a controller to handle incoming notifications from Monobank.

**Route (`routes/web.php`):**

```
Route::post('/monobank/webhook', [MonobankWebhookController::class, 'handle'])->name('monobank.webhook');
```

**Controller:**

```
use Bazegel\Monobank\Facades\Monobank;
use Illuminate\Http\Request;

class MonobankWebhookController extends Controller
{
    public function handle(Request $request)
    {
        // 1. Signature validation (IMPORTANT!)
        // You need to implement the validation of the X-Sign header.
        // $publicKey = Monobank::getKeyForVerification()->getData('key');
        // ... signature validation logic ...

        // 2. Parsing the data
        $invoice = Monobank::parseCallbackData($request);

        $status = $invoice->getStatus(); // 'success', 'failure', etc.
        $invoiceId = $invoice->getInvoiceId();
        $amount = $invoice->getAmount();

        // Your logic for handling the payment status goes here
        // For example, updating the order status in the database

        return response('OK', 200);
    }
}
```

> **Important:** Before processing a webhook, you must verify the `X-Sign` digital signature in the request headers to ensure that the request actually came from Monobank. To do this, get the public key using `Monobank::getKeyForVerification()`.

License
-------

[](#license)

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

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance40

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

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://avatars.githubusercontent.com/u/9958959?v=4)[Bazegel](/maintainers/Bazegel)[@Bazegel](https://github.com/Bazegel)

### Embed Badge

![Health badge](/badges/bazegel-laravel-monobank/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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