hubleto/pay-by-square-encoder

Encoder for Pay By Square

Installs: 3

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

pkg:composer/hubleto/pay-by-square-encoder

dev-main 2026-01-26 09:05 UTC

This package is not auto-updated.

Last update: 2026-01-27 07:37:38 UTC


README

Generator of QR codes for pay by square

Introduction

PAY by square is a Slovak banking standard for encoding payment info into QR codes. It uses LZMA-compressed XML/XSD data, Base32 encoding, and CRC32 checksums, formatted as QR Code 2005. The code contains SEPA-compliant details, including up to 5 IBAN/BIC accounts, amounts, and, crucially, variable symbols.

For detailed specification visit https://www.sbaonline.sk/wp-content/uploads/2020/03/pay-by-square-specifications-1_1_0.pdf

About

This library encodes payment information into a Pay-By-Square compliant string. It uses external LZMA compression utility (the 'xz').

Use the string generated by the encoder as the input to your favourite QR code generator library.

Linux

Linux by default contains a xz utility, typicaly located in /usr/bin/xz.

Windows

You will need the xz.exe utility which can be downloaded e.g. from https://sourceforge.net/projects/xz-for-windows/files/XZ-5.2.1_Win32%28static%29.zip/download.

Install

composer require hubleto/pay-by-square-qr-code

Usage

$pbsEnc = new \Hubleto\Utilities\PayBySquareEncoder();
$pbsEnc->setAmount(9.99);
$pbsEnc->setIban("SK99 0000 0012 3456 7890");
$pbsEnc->setBic("ABCDEFGH");
$pbsEnc->setBeneficiaryName("The Beneficiary Ltd.");
$pbsEnc->setVariableSymbol("2020123456");
$pbsEnc->setConstantSymbol("0308");
$pbsEnc->setSpecificSymbol("1000");
$pbsEnc->setNote("Payment for the services");

$pbsEnc->setXzPath("/usr/bin/xz"); // set the path to your XZ utility
$encoded = $pbsEnc->getEncodedString();

// Now, use here the `$encoded` in your favourite QR code generator library.