PHPackages                             datalinx/php-upn-qr-generator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. datalinx/php-upn-qr-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

datalinx/php-upn-qr-generator
=============================

QR code generator for Slovenian UPN payment order

v2.0.0(11mo ago)919.9k↑51.3%3MITPHPPHP ^8.1CI passing

Since Jul 1Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/DataLinx/php-upn-qr-generator)[ Packagist](https://packagist.org/packages/datalinx/php-upn-qr-generator)[ Docs](https://github.com/datalinx/php-upn-qr-generator)[ RSS](/packages/datalinx-php-upn-qr-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (8)Used By (0)

UPN QR code generator for PHP
=============================

[](#upn-qr-code-generator-for-php)

[![Packagist Downloads](https://camo.githubusercontent.com/f58affe784ee0081c3abc980019bbc98fada1ea42394c74c73b3506451664a8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646174616c696e782f7068702d75706e2d71722d67656e657261746f72)](https://camo.githubusercontent.com/f58affe784ee0081c3abc980019bbc98fada1ea42394c74c73b3506451664a8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646174616c696e782f7068702d75706e2d71722d67656e657261746f72)[![Test runner](https://github.com/DataLinx/php-upn-qr-generator/actions/workflows/test-runner.yml/badge.svg?branch=master)](https://github.com/DataLinx/php-upn-qr-generator/actions/workflows/test-runner.yml)[![codecov](https://camo.githubusercontent.com/8c812c40c4d77ad874592a5836beb0908084937624ac0492e3d2dfed4d6bdb4f/68747470733a2f2f636f6465636f762e696f2f67682f446174614c696e782f7068702d75706e2d71722d67656e657261746f722f67726170682f62616467652e7376673f746f6b656e3d564f5949474550574135)](https://codecov.io/gh/DataLinx/php-upn-qr-generator)[![Conventional Commits](https://camo.githubusercontent.com/9f7a75f0e3af8cca0597d218e8708da4791128679178573a9806a514be52d2eb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e76656e74696f6e616c253230436f6d6d6974732d312e302e302d2532334645353139363f6c6f676f3d636f6e76656e74696f6e616c636f6d6d697473266c6f676f436f6c6f723d7768697465)](https://conventionalcommits.org)[![Packagist License](https://camo.githubusercontent.com/7f67675c9bb1960036c309f764a547bbac6553f21d89f20ad2ebc5f9f3dd1998/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646174616c696e782f7068702d75706e2d71722d67656e657261746f72)](https://camo.githubusercontent.com/7f67675c9bb1960036c309f764a547bbac6553f21d89f20ad2ebc5f9f3dd1998/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646174616c696e782f7068702d75706e2d71722d67656e657261746f72)

About
-----

[](#about)

Using this library you can generate a QR code for a UPN payment order, which is used in Slovenia. The technical specification is defined by the Slovenian Bank Association.

This library can output a PNG, SVG or EPS image to a local file.

The code is fully tested, including OCRing of the generated QR code.

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

[](#requirements)

- PHP &gt;= 7.4 (see versions below)
- mbstring and iconv PHP extensions
- imagick PHP extension, but only if you want to generate PNG (raster) QR code images — not required for vector formats (SVG, EPS)

Installing
----------

[](#installing)

Download it with composer:

```
composer require datalinx/php-upn-qr-generator
```

Versions
--------

[](#versions)

VersionDependenciesDevelopment2.xPHP ^8.1
Bacon QR ^3.0Active1.xPHP ^7.4
Bacon QR ^2.0.7Bugfixes onlyUsage
-----

[](#usage)

In order to generate a QR code you need to pass at least these parameters:

- recipientIban
- recipientCity

The minimal required parameters are based on the Android applications ISPS and Banka IN offered by the Intesa Sanpaolo Bank Slovenia.

See class docblocks for accepted parameter formats and length.

### Sample code

[](#sample-code)

This code shows a typical use-case. See the UPNQR class for more stuff you can put into the QR code.

```
// Create an instance of the UPNQR class
$QR = new UPNQR();

// Set payer
$QR ->setPayerName("Janez Novak")
    ->setPayerStreetAddress("Lepa ulica 33")
    ->setPayerCity("Koper");

// Set recipient
$QR ->setRecipientIban("SI56020360253863406")
    ->setRecipientName("Podjetje d.o.o.")
    ->setRecipientStreetAddress("Neka ulica 5")
    ->setRecipientCity("Ljubljana");

// Transaction details
$QR ->setAmount(55.58)
    ->setRecipientReference("SI081236-17-34565")
    ->setPurposeCode("GDSV")
    ->setPaymentPurpose("Plačilo spletnega naročila št. 304");

try {
    // Generate QR code image of type svg (use .png for PNG images)
    $QR->generateQrCode("./qrcode.svg");
} catch (Exception $e) {
    throw new Exception("Error generating QR code image: " . $e->getMessage());
}
```

The above code will generate this QR code:

[![QR code example](docs/example.svg)](docs/example.svg)

Contributing
------------

[](#contributing)

If you have some suggestions how to make this package better, please open an issue or even better, submit a pull request.

Should you want to contribute, please see the development guidelines in the [DataLinx PHP package template](https://github.com/DataLinx/php-package-template).

### Developer documentation

[](#developer-documentation)

- [QR code technical specification](https://upn-qr.si/uploads/files/Tehnicni%20standard%20UPN%20QR.pdf) (see chapter 5.2)

### Changelog

[](#changelog)

All notable changes to this project are automatically documented in the [CHANGELOG.md](CHANGELOG.md) file using the release workflow, based on the [release-please](https://github.com/googleapis/release-please) GitHub action.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

For all this to work, commit messages must follow the [Conventional commits](https://www.conventionalcommits.org/) specification, which is also enforced by a Git hook.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance52

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 76.4% 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 ~216 days

Recently: every ~268 days

Total

6

Last Release

336d ago

Major Versions

1.x-dev → v2.0.02025-06-16

PHP version history (2 changes)v1.0.0PHP &gt;=7.4

v2.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/131700?v=4)[Omer Sabic](/maintainers/SlimDeluxe)[@SlimDeluxe](https://github.com/SlimDeluxe)

---

Top Contributors

[![SlimDeluxe](https://avatars.githubusercontent.com/u/131700?v=4)](https://github.com/SlimDeluxe "SlimDeluxe (42 commits)")[![markonovak89](https://avatars.githubusercontent.com/u/3106600?v=4)](https://github.com/markonovak89 "markonovak89 (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![nidjo17](https://avatars.githubusercontent.com/u/6123774?v=4)](https://github.com/nidjo17 "nidjo17 (1 commits)")

---

Tags

qr codeupnSloveniapayment order

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/datalinx-php-upn-qr-generator/health.svg)

```
[![Health](https://phpackages.com/badges/datalinx-php-upn-qr-generator/health.svg)](https://phpackages.com/packages/datalinx-php-upn-qr-generator)
```

###  Alternatives

[chillerlan/php-qrcode

A QR Code generator and reader with a user-friendly API. PHP 8.4+

2.4k28.9M208](/packages/chillerlan-php-qrcode)[salla/zatca

A helper to generate the QR code and signed it for ZATCA e-invoicing

159416.7k2](/packages/salla-zatca)[zxing/qr-reader

PHP qr code reader library

7542.7k1](/packages/zxing-qr-reader)[ph-7/qrcode-generator-php-class

Light QRCode PHP class (library). QR Code Generator using vCard 4.0 and the Google Chart AP

10415.5k2](/packages/ph-7-qrcode-generator-php-class)[amirezaeb/heroqr

A Powerful QR Code Management Library For PHP

9510.3k](/packages/amirezaeb-heroqr)[tarfin-labs/zbar-php

zbar-php is a php package that provides an interface to the zbar bar-code reading library.

2593.2k](/packages/tarfin-labs-zbar-php)

PHPackages © 2026

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