承接 hz/qr-invoice 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

hz/qr-invoice

Composer 安装命令:

composer require hz/qr-invoice

包简介

Helper To make QR E-Invoice

README 文档

README

  • PHP >= 7.2
  • An mbstring extension

Installation

You can install the package via composer:

$ composer require hz/qr-invoice

(back to top)

Usage

Generate Base64

use Hz\QrInvoice\GenerateQrCode; use Hz\QrInvoice\Tags\InvoiceDate; use Hz\QrInvoice\Tags\InvoiceTaxAmount; use Hz\QrInvoice\Tags\InvoiceTotalAmount; use Hz\QrInvoice\Tags\Seller; use Hz\QrInvoice\Tags\TaxNumber; $generatedString = GenerateQrCode::fromArray([ new Seller('Husseinzaher'), // seller name  new TaxNumber('1234567891'), // seller tax number new InvoiceDate('2021-07-12T14:25:09Z'), // invoice date as Zulu ISO8601 @see https://en.wikipedia.org/wiki/ISO_8601 new InvoiceTotalAmount('100.00'), // invoice total amount new InvoiceTaxAmount('15.00') // invoice tax amount // TODO :: Support others tags ])->toBase64(); // > Output // AQVTYWxsYQIKMTIzNDU2Nzg5MQMUMjAyMS0wNy0xMlQxNDoyNTowOVoEBjEwMC4wMAUFMTUuMDA=

Generate Plain

use Hz\QrInvoice\GenerateQrCode; use Hz\QrInvoice\Tags\InvoiceDate; use Hz\QrInvoice\Tags\InvoiceTaxAmount; use Hz\QrInvoice\Tags\InvoiceTotalAmount; use Hz\QrInvoice\Tags\Seller; use Hz\QrInvoice\Tags\TaxNumber; $generatedString = GenerateQrCode::fromArray([ new Seller('Husseinzaher'), // seller name  new TaxNumber('1234567891'), // seller tax number new InvoiceDate('2021-12-12T14:25:09Z'), // invoice date as Zulu ISO8601 @see https://en.wikipedia.org/wiki/ISO_8601 new InvoiceTotalAmount('100.00'), // invoice total amount new InvoiceTaxAmount('15.00') // invoice tax amount // TODO :: Support others tags ])->toTLV();

(back to top)

Render A QR Code Image

You can render the tags as QR code image easily

use Hz\QrInvoice\GenerateQrCode; use Hz\QrInvoice\Tags\InvoiceDate; use Hz\QrInvoice\Tags\InvoiceTaxAmount; use Hz\QrInvoice\Tags\InvoiceTotalAmount; use Hz\QrInvoice\Tags\Seller; use Hz\QrInvoice\Tags\TaxNumber; // data:image/png;base64, ......... $displayQRCodeAsBase64 = GenerateQrCode::fromArray([ new Seller('Husseinzaher'), // seller name  new TaxNumber('1234567891'), // seller tax number new InvoiceDate('2021-07-12T14:25:09Z'), // invoice date as Zulu ISO8601 @see https://en.wikipedia.org/wiki/ISO_8601 new InvoiceTotalAmount('100.00'), // invoice total amount new InvoiceTaxAmount('15.00') // invoice tax amount // TODO :: Support others tags ])->render(); // now you can inject the output to src of html img tag :) // <img src="$displayQRCodeAsBase64" alt="QR Code" />

(back to top)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固