https://github.com/ionbazan/pl-qr-payment
This library helps you generate payment QR codes for Polish bank mobile applications.
https://github.com/ionbazan/pl-qr-payment
banking payment php poland qr-code transfer
Last synced: about 2 months ago
JSON representation
This library helps you generate payment QR codes for Polish bank mobile applications.
- Host: GitHub
- URL: https://github.com/ionbazan/pl-qr-payment
- Owner: IonBazan
- License: mit
- Created: 2018-09-22T22:26:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-29T05:35:09.000Z (over 1 year ago)
- Last Synced: 2025-07-30T17:40:41.928Z (3 months ago)
- Topics: banking, payment, php, poland, qr-code, transfer
- Language: PHP
- Homepage:
- Size: 29.3 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QR Payment (PL)
[](https://packagist.org/packages/ion-bazan/pl-qr-payment)
[](http://travis-ci.com/IonBazan/pl-qr-payment)
[](https://codecov.io/gh/IonBazan/pl-qr-payment)
[](https://dashboard.stryker-mutator.io/reports/github.com/IonBazan/pl-qr-payment/master)
[](https://packagist.org/packages/ion-bazan/pl-qr-payment)
[](https://packagist.org/packages/ion-bazan/pl-qr-payment)
[](https://packagist.org/packages/ion-bazan/pl-qr-payment)This library helps you generate payment QR codes for Polish bank mobile applications. This is useful in invoice generators, etc to let your customers pay event faster 💸.
Makes use of [endroid/qr-code](https://github.com/endroid/qr-code) for QR-code generation but you can use any library, because the QR string is available via `getQrString()` method.
**Please note, that this library is only suitable for Polish bank systems**
## Installation
Use [Composer](https://getcomposer.org/) to install the library.
```bash
composer require ion-bazan/pl-qr-payment
```## Minimal usage example
```php
use IonBazan\PaymentQR\Poland\QrPayment;$payment = new QrPayment(
'4249000050026313017364142', // Account number
'Testowy odbiorca', // Recipient name
'Tytuł płatności', // Payment title
12345 // Amount in gr
);/** @var \Endroid\QrCode\QrCode $qrCode */
$qrCode = $payment->getQrCode(); // Do anything you want with the QrCode objectheader('Content-Type: '.$qrCode->getContentType());
echo $qrCode->writeString();
```## Advanced usage
```php
use IonBazan\PaymentQR\Poland\QrPayment;$payment = new QrPayment(
'4249000050026313017364142', // Account number
'Testowy odbiorca', // Recipient name
'Tytuł płatności', // Payment title
12345, // Amount in gr
'5214349636', // Recipient NIP (optional)
'PL', // Country code (only PL is supported) (optional)
'11223344', // Customer ID for Direct Debit (optional)
'990066' // Invoobill ID (optional)
);$qrString = $payment->getQrString(); // You can encode it using the QR library of your choice ...
echo $qrString; // ... or just print it for debug
```## Validation
Currently, this library does not offer any fancy validation. It tries to stop you from breaking things by stripping invalid characters but don't expect too much.
You should already have your data valid before generating the QR code.## Footnotes
This library is a quick approach to implement so called [Rekomendacja Związku Banków Polskich dotycząca kodu dwuwymiarowego („2D”), umożliwiającego realizację polecenia przelewu oraz aktywację usług bankowych na rynku polskim - wersja 1.0](https://zbp.pl/public/repozytorium/dla_bankow/rady_i_komitety/bankowosc_elektroczniczna/rada_bankowosc_elektr/zadania/2013.12.03_-_Rekomendacja_-_Standard_2D.pdf)
According to that document, QR codes should have following parameters:
| Parameter | Value |
|------------------|-----------------------------------|
| Type | **QR** |
| Size | **250 px** (min. 1.8 cm x 1.8 cm) |
| Error Correction | **Low (L)** |
| Encoding | **UTF-8** |## License
This library is under the MIT license.