ontob/qrpayment

QR payments code library

Maintainers

Package info

github.com/ontob/qrpayment

pkg:composer/ontob/qrpayment

Statistics

Installs: 4 953

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v2.0.0 2022-05-23 08:15 UTC

This package is auto-updated.

Last update: 2026-03-19 16:27:41 UTC


README

QR payments code library

Creates QR code for bank in Czechia, Slovakia, Poland and banks using EPC QR code

Installation

Use Composer to install the library. Also make sure you have enabled and configured the GD extension if you want to generate images. For Slovakia QR codes xz library is required.

composer require ontob/qrpayment

Usage

use Ontob\QrPayment\QrPaymentCZE;

$qrCode = QrPaymentCZE::create('CZ2920100000002500278163')
                ->setAmount(300)
                ->setCurrency('CZK')
                ->setVariableSymbol('123589123');
use Ontob\QrPayment\QrPaymentSVK;

$qrCode = QrPaymentSVK::create('CZ2920100000002500278163')
                ->setAmount(300)
                ->setCurrency('CZK')
                ->setVariableSymbol('123589123');
                // ->setXZbinaryPath() - optional setting XZ library path if not default
use Ontob\QrPayment\QrPaymentPOL;

$qrCode = QrPaymentPOL::create('CZ2920100000002500278163')
                ->setAmount(300)
                ->setVariableSymbol('123589123');
                // Currency is not used, it is always PL
use Ontob\QrPayment\QrPaymentEPC;

$qrCode = QrPaymentEPC::create('CZ2920100000002500278163')
                ->setAmount(300)
                ->setCurrency('CZK')
                ->setVariableSymbol('123589123');

Check each classes for additional fields.


Get image

// returns Endroid\QrCode\Writer\Result\PngResult
$image = $qrCode->qrImage();

// Get Base64 string
$image->getDataUri();
// Save image to file
$image->saveToFile('qrimage.png');

License

Open-sourced software licensed under the MIT license.