Skip to content

MatokUK/pay-by-square-svk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payment Generator Library for Slovak Banks

Overview

This PHP library hanle generation of QR Code Payment.

Installation

You can install the library using Composer:

composer require matok/pay-by-square-svk

Requirements

You need https://en.wikipedia.org/wiki/XZ_Utils in order to generate pyament QR Code. To set this dependecy you have to pass path to this application in constructor.

use Matok\PayBySquare\PaymentGenerator\Generator;
...
$generator = new Generator('/usr/bin/xz');

How to use

use Matok\PayBySquare\Value\DueDate;
use Matok\PayBySquare\Value\Iban;
use Matok\PayBySquare\Value\PriceEur;
use Matok\PayBySquare\Value\Message;
...

$iban = new Iban('SK39 8360 5207 0042 0320 8125');
$price = new PriceEur('2.50');
$variableSymbol = VariableSymbol(123);
$message = new Message('my payment message');

$payment = $generator->generatePayment(
    $iban,
    $price,
    $variableSymbol,
    $message,
    DueDate::today()
);

You have several possibilities how to display QR Code:

// inline:
echo '<img src="' . $payment->toQrCode()->toPngInline(); .'" alt="qr code">';
// generate in controller:
header('Content-Type: image/png');
echo $payment->toQrCode()->toPng();
// you can generate QR Code by any library using payment string
showQrCode($payment->toString());

License

This library is released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages