PHPackages                             andreikainer/laravel-mpay24 - 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. andreikainer/laravel-mpay24

ActiveLibrary[Payment Processing](/categories/payments)

andreikainer/laravel-mpay24
===========================

09PHP

Since Oct 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/andreikainer/laravel-mpay24)[ Packagist](https://packagist.org/packages/andreikainer/laravel-mpay24)[ RSS](/packages/andreikainer-laravel-mpay24/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-mpay24
==============

[](#laravel-mpay24)

This package is a plugin for Laravel 5 for working with mpay24.com payments.

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

[](#installation)

Install using composer: `composer require stalinko/laravel-mpay24`

Then add this to `providers` list in `config/app.php`:

```
    'LaravelMPay24\LaravelMPay24ServiceProvider',
```

Give settings for the new service in `config/services.php`:

```
    'mpay24' => [
        'merchantId' => 'XXXXXXX', //required
        'password' => 'XXXXXXXX', //required
        'test' => true, //optional
        'debug' => true, //optional
        'successUrl' => 'WelcomeController@anySuccess', //optional
        'errorUrl' => 'WelcomeController@anyError', //optional
        'confirmationUrl' => 'WelcomeController@anyConfirmation', //optional
    ],
```

Usage
-----

[](#usage)

Now you have a service `app()->mpay24` which is object of `\LaravelMPay24\Shop` class. This object initiates `MPay24Shop` class for you with settings given in the config. To define logic of the shop you must create your own shop class extending `\LaravelMPay24\Models\AbstractShop`, instantiate an object of that class and pass it to `app()->mpay24` service:

```
    $shopDelegator = new BasicShop();
    app()->mpay24->setShopDelegator($shopDelegator);
```

Thus mpay24 will delegate all it's actions to your shop. `BasicShop` is an example implementation of the delegator shop, you can find it in the package.

`app()->mpay24` sets callback urls to the `ORDER` object using the service settings. But you are free to set it in your custom shop class, `app()->mpay24` won't override these setting.

Working example
---------------

[](#working-example)

Example controller (`WelcomeController.php`):

```
namespace App\Http\Controllers;

use LaravelMPay24\Models\BasicShop;
use LaravelMPay24\ORDER;
use LaravelMPay24\PaymentResponse;
use LaravelMPay24\Transaction;

class WelcomeController extends Controller {
    /**
     * Show the application welcome screen to the user.
     *
     * @return \Illuminate\Http\Response
     */
    public function getIndex()
    {
        return view('welcome');
    }

    /**
     * Create a test transaction and redirect user to mpay24 page
     */
    public function postIndex()
    {
        $transaction = new Transaction('test transaction');
        $transaction->PRICE = 100.11;

        $order = new ORDER();
        $order->Order->Tid   = $transaction->TID;
        $order->Order->Price = $transaction->PRICE;

        $shopDelegator = new BasicShop();
        $shopDelegator->setTransaction($transaction);
        $shopDelegator->setOrder($order);

        /** @var \LaravelMPay24\Shop $mpay24 */
        $mpay24 = app()->mpay24;
        $mpay24->setShopDelegator($shopDelegator);
        /** @var PaymentResponse $result */
        $result = app()->mpay24->pay();

        if($result->getGeneralResponse()->getStatus() == 'OK') {
            $url = $result->getLocation();
            header('Location: '.$url);
        } else {
            echo "Return Code: " . $result->getGeneralResponse()->getReturnCode();
        }
    }

    public function anySuccess()
    {
        echo 'Success';
    }

    public function anyError()
    {
        echo 'Error';
    }

    public function anyConfirmation()
    {
        echo 'Confirmation';
    }
}
```

Code of `welcome.blade.php`:

```

 		Payment Test

```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity39

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/10714161?v=4)[Andrei Kainer](/maintainers/andreikainer)[@andreikainer](https://github.com/andreikainer)

### Embed Badge

![Health badge](/badges/andreikainer-laravel-mpay24/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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