turanjanin/serbian-fiscal-receipts-parser
Composer 安装命令:
composer require turanjanin/serbian-fiscal-receipts-parser
包简介
Library for parsing Serbian fiscal receipts.
README 文档
README
This library allows you to parse the contents of URLs encoded within QR codes on Serbian fiscal receipts.
Installation
You can install the package via composer:
composer require turanjanin/serbian-fiscal-receipts-parser
This package requires PHP 8.1 or newer.
It depends on PSR-7 compatible HTTP client for making HTTP requests. If not explicitly provided, the package will try to detect and instantiate already existing client class.
Usage
$url = 'https://suf.purs.gov.rs/v/?vl=A1ZCTUhYOVNYVzZVQlBaTzCyKwEA%2FmgAAMDh5AAAAAAAAAABhXchESoAAAAP3tYiO2%2BdI6Z5y2v4eC5wJTxirHDeiB1hqaKpgb%2FGvUy6yLkMNgZNqKxLqR40mK2cAfqZmKQ3%2BuCcTbec%2BQ3%2F9YY5EhTDP5HxDNhG%2FugU849FmvrVzP0sKecosSNL10dFtlH8Wgor2A2DDs8sHlmfmpokJnVcm24b%2BCz2bSCSl3HtzGRJ1w4Sw9hhdzsQ4WuPo%2FMEGMlmV8a%2Ffc7X05cWsDCHZoA5uPNWfN%2Bre8%2By5JETDJgRwNDFipYIdh0k62TMp5P0%2FzbCueIJJjas5IxAS9iIdpoTAIIl3eKwUZUWvEwtbGz5nkz52hw5%2Bmg50Uczx1SRifYq%2FEDt79xNkcceS0llpMyNdQ12TSYyL0UjMNymgGX4WPajSzPkQuFBcGLB%2BNLOn2AKLPJXa3B8b87eESXrcIbilNXS3zyr3eg4DIqcTVLXwHwcSh1WDmWKI2TFSu%2Bc6iORB11ln1kYbsEsuCoUegxRJR3RW4%2BkQz45%2Bbm4O5qWTCkDlZ73XHATWPn%2BpPfHP2Fh0Y0QK8gGxNiqrdbob3u0l8uaxKcEDaX%2F4HXnhMezvLEEwBNgWXDMn29uWYx9SWEvPrxV%2FLsIULQbE%2FlcvPeYIla63NhCyuEuGLIlwB2p%2B9O8x7sxD53fTMC7EKKRFUV13WBJS2N5%2BLUh33joYo8Qrc%2BNV2CqrtChYTftFukoKbQvCUKOYYIW0%2FA%3D'; $fetcher = new \Turanjanin\FiscalReceipts\Fetcher(); // Get receipt from the given URL by parsing a web page. $receipt = $fetcher->fetchFromUrl($url); // Get receipt from the given URL by fetching the JSON API. $receipt = $fetcher->fetchFromApi($url); // Or, if you already have URL content stored in $html variable: $receipt = $fetcher->fetchFromHtml($html);
If you already have a plain text version of the receipt, you can call the Parser class directly:
$parser = new \Turanjanin\FiscalReceipts\Parser(); $receipt = $parser->parseJournal($receiptContent);
Receipt class will give you access to the following receipt elements:
- Store data
- Receipt number, counter and type
- List of receipt items
- List of all taxes
- Total amount
Alternatively, you can decode receipt URL and extract some of the data offline, without the need for HTTP calls:
$payload = \Turanjanin\FiscalReceipts\UrlDecoder::decode($url); $payload->getTotalAmount(); $payload->getBuyerId(); $payload->getReceiptNumber(); $payload->getReceiptCounter(); $payload->getReceiptDate();
Author
License
The MIT License (MIT). Please see License File for more information.
turanjanin/serbian-fiscal-receipts-parser 适用场景与选型建议
turanjanin/serbian-fiscal-receipts-parser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 296 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 08 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「tax」 「fiscal」 「receipts」 「bills」 「serbia」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 turanjanin/serbian-fiscal-receipts-parser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 turanjanin/serbian-fiscal-receipts-parser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 turanjanin/serbian-fiscal-receipts-parser 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP wrapper for the Quaderno REST API
API client for validating Tax Identification Number.
Validate the format of EU vat numbers.
Module allowing creation of tax rates and categories in the CMS via SiteConfig
PHP wrapper for the Quaderno REST API
Um php-client melhorado para a integração com oa maravilhosa API do https://enotas.com.br/gateway. Apenas V1(por enquanto)
统计信息
- 总下载量: 296
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-01