定制 andrew-svirin/ebics-client-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

andrew-svirin/ebics-client-php

Composer 安装命令:

composer require andrew-svirin/ebics-client-php

包简介

PHP library to communicate with bank through EBICS protocol.

README 文档

README

CI Latest Stable Version Total Downloads License

PHP library to communicate with a bank through EBICS protocol.
PHP EBICS Client - https://ebics-api.github.io/ebics-client-php/
Supported EBICS versions: 2.4, 2.5, 3.0; Encryption versions: E002, X002, A005, A006; Switching EBICS T/TS

💥 (Premium) EBICS API Client

EBICS API Client is a standalone microservice that wraps this library into a ready-to-deploy banking integration solution. Ideal for fintechs, ERPs, payment processors, and enterprises needing a robust EBICS integration without building and maintaining the client layer yourself.

Premium Features

  • 🚀 Instant deployment — Docker-based microservice, deploy in minutes.

  • 🔌 REST API — Complete EBICS operations via simple HTTP calls. No PHP expertise needed.

  • 🧪 Dummy EBICS Server — Develop and test your integration locally without a real bank.

    Key Value
    URL https://localhost/ebics-server-stub
    Host ID EBICSSTUB
    Partner ID P07
    User ID U07
  • 🤖 MCP Server for AI Agents — Connect AI coding assistants directly to your EBICS server.

    {
      "mcpServers": {
        "ebics-server": {
          "type": "remote",
          "url": "http://localhost/mcp",
          "headers": {
            "Authorization": "Key YOUR_API_KEY_HERE"
          }
        }
      }
    }
  • 📊 Admin dashboard — Monitor transactions, manage keys, view logs.

  • 🛡️ Priority support — Direct access to the development team.

👉 Try the DEMO · Learn more · Watch the video

Already using the open-source library and need more? The Premium microservice is the natural next step — no rewrite, same protocol support, zero configuration debt.

License

ebics-api/ebics-client-php is licensed under the MIT License, see the LICENSE file for details

Installation

$ composer require ebics-api/ebics-client-php

Initialize client

You will need to have this information from your Bank: HostID, HostURL, PartnerID, UserID

<?php
use EbicsApi\Ebics\Factories\KeyringFactory;
use EbicsApi\Ebics\Services\FileKeyringManager;
use EbicsApi\Ebics\Models\Bank;
use EbicsApi\Ebics\Models\User;
use EbicsApi\Ebics\EbicsClient;
use EbicsApi\Ebics\Models\X509\BankX509Generator;

// Prepare `workspace` dir in the __PATH_TO_WORKSPACES_DIR__ manually.
// "__EBICS_VERSION__" should have value "VERSION_30" for EBICS 3.0
$keyringPath = __PATH_TO_WORKSPACES_DIR__ . '/workspace/keyring.json';
$keyringManager = new FileKeyringManager();
if (is_file($keyringPath)) {
    $keyring = $keyringManager->loadKeyring($keyringPath, __PASSWORD__, __EBICS_VERSION__);
} else {
    $keyring = $keyringManager->createKeyring(__EBICS_VERSION__);
    $keyring->setPassword(__PASSWORD__);
}
$bank = new Bank(__HOST_ID__, __HOST_URL__);
// Use __IS_CERTIFIED__ true for EBICS 3.0 and/or French banks, otherwise use false.
if(__IS_CERTIFIED__) {
    $certificateGenerator = (new BankX509Generator());
    $certificateGenerator->setCertificateOptionsByBank($bank);
    $keyring->setCertificateGenerator($certificateGenerator);
}
$user = new User(__PARTNER_ID__, __USER_ID__);
$client = new EbicsClient($bank, $user, $keyring);
if (!is_file($keyringPath)) {
    $client->createUserSignatures();
    $keyringManager->saveKeyring($client->getKeyring(), $keyringPath);
}

Global process and interaction with Bank Department

1. Create and store your 3 keys and send initialization request.

<?php

use EbicsApi\Ebics\Contracts\EbicsResponseExceptionInterface;

/* @var \EbicsApi\Ebics\EbicsClient $client */

try {
    $client->executeStandardOrder(new \EbicsApi\Ebics\Orders\INI());
    /* @var \EbicsApi\Ebics\Services\FileKeyringManager $keyringManager */
    /* @var \EbicsApi\Ebics\Models\Keyring $keyring */
    $keyringManager->saveKeyring($keyring, $keyringPath);
} catch (EbicsResponseExceptionInterface $exception) {
    echo sprintf(
        "INI request failed. EBICS Error code : %s\nMessage : %s\nMeaning : %s",
        $exception->getResponseCode(),
        $exception->getMessage(),
        $exception->getMeaning()
    );
}

try {
    $client->executeStandardOrder(new \EbicsApi\Ebics\Orders\HIA());
    $keyringManager->saveKeyring($keyring, $keyringPath);
} catch (EbicsResponseExceptionInterface $exception) {
    echo sprintf(
        "HIA request failed. EBICS Error code : %s\nMessage : %s\nMeaning : %s",
        $exception->getResponseCode(),
        $exception->getMessage(),
        $exception->getMeaning()
    );
}

2. Generate a EBICS letter

/* @var \EbicsApi\Ebics\EbicsClient $client */
$ebicsBankLetter = new \EbicsApi\Ebics\EbicsBankLetter();

$bankLetter = $ebicsBankLetter->prepareBankLetter(
    $client->getBank(),
    $client->getUser(),
    $client->getKeyring()
);

$pdf = $ebicsBankLetter->formatBankLetter($bankLetter, $ebicsBankLetter->createPdfBankLetterFormatter());

3. Wait for the bank validation and access activation.

4. Fetch the bank keys.

try {
    /* @var \EbicsApi\Ebics\EbicsClient $client */
    $client->executeInitializationOrder(new \EbicsApi\Ebics\Orders\HPB());
    /* @var \EbicsApi\Ebics\Services\FileKeyringManager $keyringManager */
    /* @var \EbicsApi\Ebics\Models\Keyring $keyring */
    $keyringManager->saveKeyring($keyring, $keyringPath);
} catch (EbicsResponseExceptionInterface $exception) {
    echo sprintf(
        "HPB request failed. EBICS Error code : %s\nMessage : %s\nMeaning : %s",
        $exception->getResponseCode(),
        $exception->getMessage(),
        $exception->getMeaning()
    );
}

5. Play with other transactions!

Transaction Description
HEV Download supported protocol versions for the Bank.
INI Send to the bank public signature of signature A005.
HIA Send to the bank public signatures of authentication (X002) and encryption (E002).
H3K Send to the bank public signatures of signature (A005), authentication (X002) and encryption (E002).
HCS Upload for renewing user certificates.
HPB Download the Bank public signatures authentication (X002) and encryption (E002).
SPR Suspend activated keyring.
HPD Download the bank server parameters.
HKD Download customer's customer and subscriber information.
HTD Download subscriber's customer and subscriber information.
HAA Download Bank available order types.
PTK Download transaction status (Plain text).
HAC Download transaction status (XML).
FDL Download the files from the bank.
FUL Upload the files to the bank.
BTD Download request files of any BTF structure.
BTU Upload the files to the bank.

If you need to parse Cfonb 120, 240, 360 use ebics-api/cfonb-php
If you need to parse MT942 use ebics-api/mt942-php

andrew-svirin/ebics-client-php 适用场景与选型建议

andrew-svirin/ebics-client-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 144.81k 次下载、GitHub Stars 达 71, 最近一次更新时间为 2019 年 08 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「client」 「mt940」 「rsa」 「x509」 「openssl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 andrew-svirin/ebics-client-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 andrew-svirin/ebics-client-php 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 71
  • Watchers: 10
  • Forks: 38
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-14