PHPackages                             kenlas/mnb-qr-code-payment-generator-php - 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. kenlas/mnb-qr-code-payment-generator-php

ActiveLibrary[Payment Processing](/categories/payments)

kenlas/mnb-qr-code-payment-generator-php
========================================

PHP implementation of MNB's QR code payment generation algorithm

v0.1.3(5y ago)3132MITPHPPHP &gt;=7.2

Since Oct 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/kenlas/mnb-qr-code-payment-generator-php)[ Packagist](https://packagist.org/packages/kenlas/mnb-qr-code-payment-generator-php)[ RSS](/packages/kenlas-mnb-qr-code-payment-generator-php/feed)WikiDiscussions main Synced 1mo ago

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

mnb-qr-code-payment-generator-php
=================================

[](#mnb-qr-code-payment-generator-php)

PHP implementation of MNB's (Hungarian National Bank) QR code payment generation algorithm

The complete guide can be found here:

Uses `endroid/qr-code` for QR code image generation.

Requirements
------------

[](#requirements)

PHP 7.2

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

[](#installation)

```
composer require kenlas/mnb-qr-code-payment-generator-php

```

Example usage
-------------

[](#example-usage)

```
$iban = MnbQrCodePayment\Utils::hungarianBbanToIban('11773016-11111018');

$generator = new MnbQrCodePayment\Generator();
$data = $generator
    ->setMethod('HCT')
    ->setBic('OTPVHUHB')
    ->setName('Szabó Jenő')
    ->setIban($iban)
    ->setAmount(1000)
    ->setExpiration(new DateTime('now + 30 minutes'))
    ->setPaymentSituation('GDSV')
    ->setMessage('hello')
    ->setShopId('1234')
    ->setDeviceId('POS')
    ->setInvoiceId('MY-2020/108')
    ->setCustomerId('4682')
    ->setTransactionId('4687-8765-9624-1245-2022')
    ->setLoyaltyId('4682')
    ->setNavVerificationCode('FXC4')
    ->generate();

$image = new MnbQrCodePayment\QrCodeImage($data);
```

You can send the generated QR code directly to the output:

```
$image->display();
```

You can save it as an image:

```
$image->saveTo('my.png');
```

Or you can get the QR code as base64 encoded data URI:

```
echo $image->asDataUri();
```

You can also use your own QR code renderer: (see  for more examples)

```
$customRenderer = new Endroid\QrCode\QrCode();
$customRenderer->setSize(400);
$customRenderer->setMargin(20);
$customRenderer->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]);
$customRenderer->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]);
$image->setRenderer($customRenderer);
```

MnbQrCodePayment\\Generator available setters
---------------------------------------------

[](#mnbqrcodepaymentgenerator-available-setters)

Method nameRequired/optionalMaximum lengthDescriptionsetMethod($code)Required3Must be `HCT` for transfer orders or `RTP` for payment requestsetVersion($version)Optional3For future use only, defaults to `001`setCharacterSet($charset)Optional1For compatibility reasons only, defaults to `1`setBic($bic)Required11The bank's BIC/SWIFT codesetName($name)Required70The payer/beneficiary namesetIban($iban)Required28The payer/beneficiary IBAN account numbersetAmount($amount)Optional12The payment amount in HUF, integers onlysetExpiration($date)Required-PHP Date object for the expiration datesetPaymentSituation($purposeCode)Optional4Purpose code for the given payment situation (see )setMessage($message)Optional70MessagesetShopId($value)Optional35Shop IDsetDeviceId($value)Optional35Device IDsetInvoiceId($value)Optional35Invoice IDsetCustomerId($value)Optional35Customer IDsetTransactionId($value)Optional35Transaction IDsetLoyaltyId($value)Optional35Loyalty IDsetNavVerificationCode($value)Optional35NAV verification codeMnbQrCodePayment\\Utils available helper methods
------------------------------------------------

[](#mnbqrcodepaymentutils-available-helper-methods)

Method nameDescriptionhungarianBbanToIban($bban)Convert a hungarian BBAN (16 or 24 character lengths) to IBAN formatMnbQrCodePayment\\QrCodeImage available methods
-----------------------------------------------

[](#mnbqrcodepaymentqrcodeimage-available-methods)

Method nameDescription*constructor*Optionally initialize with a QR code string, generated by `MnbQrCodePayment\Generator`setQrString($qrString)QR code string generated by `MnbQrCodePayment\Generator`setRenderer($renderer)Set a new renderer - an instance of `Endroid\QrCode\QrCode`. Can be useful if you want to customize QR code's settingsdisplay()Send appropriate headers and display QR code as an image (PNG format by default)saveTo($path)Save QR code as an image file (PNG format by default)asDataUri()Returns the QR code as a base64 encoded data URI - useful to pass to an `img` src attributeContact
-------

[](#contact)

If you have any questions feel free to contact me at

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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 ~4 days

Total

4

Last Release

2023d ago

### Community

Maintainers

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

---

Top Contributors

[![kenlas](https://avatars.githubusercontent.com/u/220132?v=4)](https://github.com/kenlas "kenlas (8 commits)")

---

Tags

phpqrcodegeneratorpaymentmnb

### Embed Badge

![Health badge](/badges/kenlas-mnb-qr-code-payment-generator-php/health.svg)

```
[![Health](https://phpackages.com/badges/kenlas-mnb-qr-code-payment-generator-php/health.svg)](https://phpackages.com/packages/kenlas-mnb-qr-code-payment-generator-php)
```

###  Alternatives

[yandex-money/yandex-money-sdk-php

Yandex.Money API SDK for PHP

105167.4k2](/packages/yandex-money-yandex-money-sdk-php)[cryptonator/merchant-php-sdk

Cryptonator.com Merchant API SDK for PHP

2713.7k](/packages/cryptonator-merchant-php-sdk)[mjaschen/bezahlcode

BezahlCode Generator Library

128.1k](/packages/mjaschen-bezahlcode)[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)[miracode/stripe-bundle

Symfony bundle to integrate Stripe PHP SDK. Ability to save Stripe objects in database using Doctrine.

1016.1k](/packages/miracode-stripe-bundle)[luyadev/luya-module-payment

LUYA Payment allows you to integrate payments in a safe and fast way. The module take care of all the provider required steps (call, create, success, abort, etc.) and provides all the informations for your store.

1012.1k](/packages/luyadev-luya-module-payment)

PHPackages © 2026

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