datalinx/php-upn-qr-generator
Composer 安装命令:
composer require datalinx/php-upn-qr-generator
包简介
QR code generator for Slovenian UPN payment order
README 文档
README
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
- PHP >= 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
Download it with composer:
composer require datalinx/php-upn-qr-generator
Versions
| Version | Dependencies | Development |
|---|---|---|
| 2.x | PHP ^8.1 Bacon QR ^3.0 |
Active |
| 1.x | PHP ^7.4 Bacon QR ^2.0.7 |
Bugfixes only |
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
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:
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.
Developer documentation
- QR code technical specification (see chapter 5.2)
Changelog
All notable changes to this project are automatically documented in the CHANGELOG.md file using the release workflow, based on the release-please GitHub action.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
For all this to work, commit messages must follow the Conventional commits specification, which is also enforced by a Git hook.
datalinx/php-upn-qr-generator 适用场景与选型建议
datalinx/php-upn-qr-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28.93k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2022 年 07 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「qr code」 「upn」 「Slovenia」 「payment order」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 datalinx/php-upn-qr-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 datalinx/php-upn-qr-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 datalinx/php-upn-qr-generator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
UPN form generator
Validate, generate and extract data from JMBG (Unique Master Citizen Number)
Promotional Codes Generator for Laravel 5.1
PHP SDK for DPD Slovenia and Croatia
Zend Captcha bundle
统计信息
- 总下载量: 28.93k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 33
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-01