hubipe/huqrpayment
Composer 安装命令:
composer require hubipe/huqrpayment
包简介
QR payment library for Hungary (according to the Magyar Nemzeti Bank standard version 001)
README 文档
README
Library to generate QR payment codes for Hungarian banks (standard by Hungarian national bank (MNB)). This library was copied and modified from the rikudou's EU QR Payment
See the standard
See also QR code payment generator for Czech, Slovak or European Union accounts.
Installation
Via composer: composer require hubipe/huqrpayment
Usage
In the constructor you must supply IBAN which may be a string
or an instance of hubipe\HuQrPayment\Iban\IbanInterface.
Example with string:
<?php use hubipe\HuQrPayment\QrPayment; $payment = new QrPayment('HU42117730161111101800000000');
Example with base IBAN class:
<?php use hubipe\HuQrPayment\QrPayment; use hubipe\HuQrPayment\Iban\IBAN; $payment = new QrPayment(new IBAN('HU42117730161111101800000000'));
The IbanInterface is useful in case you want to create an
adapter that transforms your local format (BBAN) to IBAN.
This package already contains Adapter for Hungarian account numbers:
<?php use hubipe\HuQrPayment\QrPayment; use Rikudou\Iban\Iban\HungarianIbanAdapter; $payment = new QrPayment(new HungarianIbanAdapter('11773016-11111018-00000000'));
Setting payment details
All payment details can be set via setters:
<?php use hubipe\HuQrPayment\Enums\CharacterSet; use hubipe\HuQrPayment\Enums\IdCode; use hubipe\HuQrPayment\Enums\Purpose; use hubipe\HuQrPayment\QrPayment; $payment = new QrPayment('HU42117730161111101800000000'); $payment ->setIdCode(IdCode::TRANSFER_ORDER) ->setCharacterSet(CharacterSet::UTF_8) ->setBic('OTPVHUHB') ->setName('My company name') ->setAmount(53250) ->setCurrency('HUF') ->setDueDate(new DateTimeImmutable('+3 days')) ->setPaymentSituationIdentifier(Purpose::PURCHASE_SALE_OF_GOODS) ->setRemittance('Payment for goods') ->setShopId('SHOP1') ->setMerchantDeviceId('Terminal 1') ->setReceiptId('1234984657S') ->setPayeeInternalId('Payee internal identification') ->setLoyaltyId('GOLDEN_CUSTOMER') ->setNavVerificationCode('FXC4');
QR Code image
This library provides many implementations of QR code image using its sister library
rikudou/qr-payment-qr-code-provider. If any supported
QR code generating library is installed, the method getQrCode() will return an instance of
\Rikudou\QrPaymentQrCodeProvider\QrCode which can be used to get an image containing the generated QR payment data.
<?php use hubipe\HuQrPayment\QrPayment; use Endroid\QrCode\QrCode; $payment = new QrPayment(...); $qrCode = $payment->getQrCode(); // get the raw image data and display them in the browser header('Content-Type: image/png'); echo $qrCode->getRawString(); // use in an img html tag echo "<img src='{$qrCode->getDataUri()}'>"; // write to a file $qrCode->writeToFile('/tmp/some-file.png'); // get the raw object from the underlying system $raw = $qrCode->getRawObject(); // let's assume we're using endroid/qr-code v4 assert($raw instanceof QrCode); // do some custom transformations $raw->setLabelFontSize(15); // the object is still referenced by the adapter, meaning we can now render it the same way as before echo "<img src='{$qrCode->getDataUri()}'>";
hubipe/huqrpayment 适用场景与选型建议
hubipe/huqrpayment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 86.79k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 03 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「qr」 「hungary」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hubipe/huqrpayment 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hubipe/huqrpayment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hubipe/huqrpayment 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Modern Laravel package for the szamlazz.hu invoicing API
Modern Laravel package for SimplePay online payment integration
Paymill integration with Magento 2
Online elállási/felmondási nyilatkozat (45/2014. Korm. rendelet) Laravel csomag — form, tárolás, tartós adathordozós e-mail visszaigazolás.
Experimental Omnipay v2.5 Payment Gateway for https://www.otpbank.hu
Sameday Courier SDK for PHP — fork with countryCode support for counties and cities geolocation
统计信息
- 总下载量: 86.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-03-30