fiskaly/fiskaly-sdk-php
最新稳定版本:1.2.200
Composer 安装命令:
composer require fiskaly/fiskaly-sdk-php
包简介
fiskaly Cloud-TSE SDK for PHP
README 文档
README
The fiskaly SDK includes an HTTP client that is needed1 for accessing the kassensichv.io API that implements a cloud-based, virtual CTSS (Certified Technical Security System) / TSE (Technische Sicherheitseinrichtung) as defined by the German KassenSichV (Kassensicherungsverordnung).
Supported Versions
- PHP 7.1+
Features
- Automatic authentication handling (fetch/refresh JWT and re-authenticate upon 401 errors).
- Automatic retries on failures (server errors or network timeouts/issues).
- Automatic JSON parsing and serialization of request and response bodies.
- Future: [1] compliance regarding BSI CC-PP-0105-2019 which mandates a locally executed SMA component for creating signed log messages.
- Future: Automatic offline-handling (collection and documentation according to Anwendungserlass zu § 146a AO)
Integration
Composer
The PHP SDK is available for a download via Composer.
Packagist - Package Repository.
Simply execute this command from the shell in your project directory:
$ composer require fiskaly/fiskaly-sdk-php
Or you can manually add the package to your composer.json file:
"require": { "fiskaly/fiskaly-sdk-php": "*" }
then run
$ composer install
Finally, be sure to include the autoloader in your code:
<?php require_once('vendor/autoload.php');
Service
Additionally, to the SDK, you'll also need the fiskaly service. Follow these steps to integrate it into your project:
- Go to https://developer.fiskaly.com/downloads#service
- Download the appropriate service build for your platform
- Start the service
Usage
Demo
<?php require __DIR__ . '\\vendor\\autoload.php'; use FiskalyClient\FiskalyClient; /** initialize the fiskaly API client class using credentials */ try { $client = FiskalyClient::createUsingCredentials('http://localhost:8080/invoke', $_ENV["FISKALY_API_KEY"], $_ENV["FISKALY_API_SECRET"], 'https://kassensichv.io/api/v1'); } catch (Exception $e) { exit($e); } /** get version of client and SMAERS */ try { $version = $client->getVersion(); echo "Version: ", $version, "\n\n"; } catch (Exception $e) { exit($e); }
Another way to create FiskalyClient object is using context string. You can get it via getContext method and save it in memory via $_SESSION variable or persistent in cache or database.
<?php /** initialize the fiskaly API client class using context */ try { $client = FiskalyClient::createUsingContext('http://localhost:8080/invoke', $_SESSION["FISKALY_CONTEXT"]); } catch (Exception $e) { exit($e); }
Client Configuration
The SDK is built on the fiskaly Client which can be configured through the SDK.
A reason why you would do this, is to enable the debug mode.
Enabling the debug mode
The following code snippet demonstrates how to enable the debug mode in the client.
<?php /** configure client */ try { $config_params = array( 'debug_level' => 4, 'debug_file' => __DIR__ . '../../fiskaly.log', 'client_timeout' => 5000, 'smaers_timeout' => 2000, ); $config = $client->configure($config_params); echo "Configuration: ", $config, "\n\n"; } catch (Exception $e) { exit($e); }
Related
fiskaly/fiskaly-sdk-php 适用场景与选型建议
fiskaly/fiskaly-sdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 266.41k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「src」 「fiskaly」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fiskaly/fiskaly-sdk-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fiskaly/fiskaly-sdk-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fiskaly/fiskaly-sdk-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A dependency injection compiler for Ray.Di
A lib to handle image inlining in your (css, img src, etc.)
A lib to handle image inlining in your (css, img src, etc.)
Alfabank REST API integration
Official PHP SDK for the VCR.AM Virtual Cash Register API — fiscalize sales, refunds, and prepayments through Armenia's State Revenue Committee.
Extract all links from string in extended PSR-13 format.
统计信息
- 总下载量: 266.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04