Skip to content

ontob/qrpayment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages