PHPackages                             paybysquare/php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. paybysquare/php

ActiveLibrary[Payment Processing](/categories/payments)

paybysquare/php
===============

Pay By Square (Slovak payment QR standard) payload generator. Pure PHP, no extensions, no shell-outs.

v0.1.0(yesterday)013↑2669.2%1MITPHP &gt;=8.2

Since Jul 22Compare

[ Source](https://github.com/usmansher/paybysquare-php)[ Packagist](https://packagist.org/packages/paybysquare/php)[ Docs](https://github.com/usmansher/paybysquare)[ RSS](/packages/paybysquare-php/feed)WikiDiscussions Synced today

READMEChangelogDependencies (1)Versions (2)Used By (1)

paybysquare/php
===============

[](#paybysquarephp)

Pay By Square payload generator for PHP — the Slovak Banking Association's payment QR standard. **Pure PHP ≥ 8.2**: no extensions, no shell-outs, installs on any shared host.

Part of the [paybysquare/php](https://github.com/usmansher/paybysquare)multi-language suite: the same contract is implemented in TypeScript (`@paybysquare/core` on npm) and served by a hosted/self-hostable HTTP API — all verified against one shared set of test vectors. Using Laravel? See [`paybysquare/laravel`](https://packagist.org/packages/paybysquare/laravel)for a facade, config defaults, and a Blade QR component.

Install
-------

[](#install)

```
composer require paybysquare/php
```

Usage
-----

[](#usage)

```
use PayBySquare\Payment;
use PayBySquare\PayBySquare;

$payload = PayBySquare::generatePayload(new Payment(
    amount: 25.50,
    iban: 'SK7283300000009111111118',
    beneficiaryName: 'Acme s.r.o.',
    swift: 'FIOZSKBAXXX',
    variableSymbol: '2026001',
    note: 'Invoice FA20260103',
));
// $payload is the string to put into a QR code
```

Array input works too (canonical camelCase keys):

```
$payload = PayBySquare::generatePayload([
    'amount' => 25.50,
    'iban' => 'SK7283300000009111111118',
    'beneficiaryName' => 'Acme s.r.o.',
]);
```

Render with any QR library, e.g. [bacon/bacon-qr-code](https://packagist.org/packages/bacon/bacon-qr-code):

```
use BaconQrCode\Renderer\ImageRenderer;
use BaconQrCode\Renderer\Image\SvgImageBackEnd;
use BaconQrCode\Renderer\RendererStyle\RendererStyle;
use BaconQrCode\Writer;

$writer = new Writer(new ImageRenderer(new RendererStyle(256), new SvgImageBackEnd()));
$svg = $writer->writeString($payload);
```

### Input

[](#input)

`amount`, `iban` and `beneficiaryName` are required; `currency` (default `EUR`), `date` (`DateTimeInterface` or `YYYY-MM-DD`, default today), `swift`, `variableSymbol`, `constantSymbol`, `specificSymbol`, `note`, `beneficiaryAddress1/2` are optional. Invalid input throws `PayBySquare\ValidationException` with a public `$field` property. Amounts with more than 2 decimal places are rejected, not rounded.

Correctness
-----------

[](#correctness)

Every release passes the shared [test vectors](https://github.com/usmansher/paybysquare/blob/main/spec/test-vectors.json): payloads are decoded by an independent liblzma-based reference verifier and the recovered data must match the spec byte-for-byte. The emitted LZMA stream is literal-coded — roughly 10–20% longer than liblzma's output (at most one QR version larger; scannability is unaffected) — and decodable by any conforming LZMA decoder.

Trademark note
--------------

[](#trademark-note)

PAY by square is a payment standard of the Slovak Banking Association. This is an independent open-source implementation, not affiliated with or endorsed by the SBA or Bysquare.

License
-------

[](#license)

MIT © usmansher

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance100

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5562387?v=4)[Usman Sher](/maintainers/usmansher)[@usmansher](https://github.com/usmansher)

---

Tags

qrpaymentsepaIBANpay by squareslovakiabysquare

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paybysquare-php/health.svg)

```
[![Health](https://phpackages.com/badges/paybysquare-php/health.svg)](https://phpackages.com/packages/paybysquare-php)
```

###  Alternatives

[rikudou/skqrpayment

QR payment library for Slovak accounts

36835.7k2](/packages/rikudou-skqrpayment)[rikudou/czqrpayment

QR payment library for Czech accounts

29478.6k16](/packages/rikudou-czqrpayment)[rikudou/euqrpayment

QR payment library for European Union according to EPC standard version 2

18365.3k1](/packages/rikudou-euqrpayment)[paypayopa/php-sdk

PHP SDK for PayPay Open Payment API

18316.5k5](/packages/paypayopa-php-sdk)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3720.4k](/packages/linkxtr-laravel-qrcode)[kilylabs/qr-payment-php

Генерация QR-кодов для оплаты на базе ГОСТ Р 56042-2014 для PHP

1319.4k](/packages/kilylabs-qr-payment-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
