PHPackages                             easydoklad/bysqr - 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. easydoklad/bysqr

ActiveLibrary

easydoklad/bysqr
================

PHP SDK for encoding and decoding PAY and INVOICE by square documents.

v0.0.2(1y ago)01↑2900%MITPHPPHP ^8.2

Since Jul 10Pushed yesterday1 watchersCompare

[ Source](https://github.com/easydoklad/bysqr-php)[ Packagist](https://packagist.org/packages/easydoklad/bysqr)[ RSS](/packages/easydoklad-bysqr/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

bysqr PHP SDK
=============

[](#bysqr-php-sdk)

PHP SDK for the `bysqr` Rust encoder and decoder. The package ships headless binaries for macOS, Linux and Windows on x86-64 and ARM64.

Requirements
------------

[](#requirements)

- PHP 8.2 or newer

The package has no runtime Composer dependencies.

Encode PAY or INVOICE
---------------------

[](#encode-pay-or-invoice)

All decimal values are strings so their precision is preserved.

```
use Bysqr\BankAccount;
use Bysqr\Encoder;
use Bysqr\Pay;
use Bysqr\Payment;
use Bysqr\PaymentOption;

$pay = new Pay(
    payments: [
        new Payment(
            paymentOptions: PaymentOption::PAYMENT_ORDER,
            currencyCode: 'EUR',
            bankAccounts: [new BankAccount('SK7700000000000000000000')],
            amount: '12.34',
            variableSymbol: '20260825',
        ),
    ],
);

$svg = Encoder::make($pay)->toSvg();
$pngDataUrl = Encoder::make($pay)->toPng(size: 512);
$jpegDataUrl = Encoder::make($pay)->toJpeg(size: 512, quality: 90);
```

`Encoder` accepts `Pay`, `Invoice`, or one independently encoded `InvoiceItems` block. PAY and INVOICE branding can be customized with a `Theme` containing a `LogoLayout`, `LogoPosition`, and `LogoColor`.

Decode scanned QR content
-------------------------

[](#decode-scanned-qr-content)

Image scanning deliberately stays in the consuming application. Pass the text read from the QR code to the decoder; no raw encoded payload API is exposed by the encoder.

```
use Bysqr\Decoder;

$decoder = Decoder::make($textReadFromQrCode);

$document = $decoder->toDocument(); // Pay, Invoice, or InvoiceItems
$json = $decoder->toJson();
$xml = $decoder->toXml();
```

Encode and decode INVOICE ITEMS batches
---------------------------------------

[](#encode-and-decode-invoice-items-batches)

`InvoiceItemsList` represents the complete ordered list. The batch encoder splits it into as many branded QR images as required.

```
use Bysqr\InvoiceItemsDecoder;
use Bysqr\InvoiceItemsEncoder;
use Bysqr\InvoiceItemsList;

$list = new InvoiceItemsList(
    invoiceId: 'INV-2026',
    invoiceLines: $invoiceLines,
);

$svgImages = InvoiceItemsEncoder::make($list)->toSvg();

// The scanned texts may be supplied in any order.
$decodedList = InvoiceItemsDecoder::make($scannedQrTexts)->toList();
```

An optional parent `Invoice` can be passed as the second argument to either batch class to validate the invoice ID and line count.

Development
-----------

[](#development)

```
composer install
composer test
```

The release checksums of all bundled executables are recorded in `bin/SHA256SUMS`.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance77

Regular maintenance activity

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~21 days

Total

2

Last Release

393d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c9816ddf58c7cd4ced7066b991312da48c7f143c9125eb053ef4ec00b47ec4ce?d=identicon)[ptrstovka](/maintainers/ptrstovka)

---

Top Contributors

[![ptrstovka](https://avatars.githubusercontent.com/u/5551894?v=4)](https://github.com/ptrstovka "ptrstovka (16 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/easydoklad-bysqr/health.svg)

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[illuminate/console

The Illuminate Console package.

13046.6M7.5k](/packages/illuminate-console)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k54](/packages/civicrm-civicrm-core)[drupal/drupal-driver

A collection of reusable Drupal drivers

6916.6M24](/packages/drupal-drupal-driver)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M687](/packages/shopware-core)

PHPackages © 2026

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