hubipe/huqrpayment 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 hubipe/huqrpayment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 86.79k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 27
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-30