kingsquare/php-mt940
Composer 安装命令:
composer require kingsquare/php-mt940
包简介
Simple MT940 parser in PHP
README 文档
README
php-mt940?
The php-mt940 package provides a lightweight parser for MT940 format which is used by SWIFT. The output is transformed into easy to use dataclasses Transaction_banking which itself contains Statement_banking objects. Pretty straight forward.
Requirements
- At least PHP 7
Installation
If composer is not yet on your system, follow the instructions on getcomposer.org to do so.
To add this dependency to your project, simply run the following command from the root of your project:
composer require kingsquare/php-mt940
This ensures that you install the latest stable release.
How to use the parser?
I've attached a simple script in the examples directory to explain it a bit more in detail, but after loading the required classes, the usage should be pretty simple:
<?php // ... load everything ... // // instantiate the actual parser // and parse them from a given file, this could be any file or a posted string $parser = new \Kingsquare\Parser\Banking\Mt940(); $tmpFile = __DIR__.'/test.mta'; $parsedStatements = $parser->parse(file_get_contents($tmpFile)); ?>
Included engines
Currently the following engines are included:
- ABNAMRO (here)
- ING (here)
- KNAB (here)
- RABOBANK (here)
- SPARKASSE (here)
- TRIODOS (here)
- HSBC (here)
- SNS (here) Experimental
- BUNQ (here)
- PENTA (here)
- ASN (here)
- KBS (here)
- ZETB (here)
- KONTIST (here)
- a default
UNKNOWN-engine (here)
Custom engines
To override engines or just try a one-off engine on a file, you can pass an engine into the parse-method:
<?php // ... load everything ... // class MyCustomMt940Engine extends \Kingsquare\Parser\Banking\Mt940\Engine { // add your overrides / overloads and custom logic here } // instantiate the actual parser // and parse them from a given file, this could be any file or a posted string $parser = new \Kingsquare\Parser\Banking\Mt940(); $engine = new MyCustomMt940Engine(); $tmpFile = __DIR__.'/test.mta'; $parsedStatements = $parser->parse(file_get_contents($tmpFile), $engine); ?>
Known issues
I've provided unittests but please take a look at the github issue tracker for the latest ideas's, issues or other stuff..
Future plans
I do intend to add new engines or keep everything running smoothly, but since i don't have access to any more test files, it's hard to add new engines ;) The unknown engine should work or atleast give some idea as to where different banks diverge from the standard. If you do have any ideas, examples or new banks that you'd like to see incorporated, please don't hesitate and send me an issue / pullrequest!
Contact
This is GitHub, you know where to find me :)
License
PHP-MT940 is licensed under the MIT License - see the LICENSE file for details
kingsquare/php-mt940 适用场景与选型建议
kingsquare/php-mt940 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 835.91k 次下载、GitHub Stars 达 106, 最近一次更新时间为 2014 年 02 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「parsing」 「mt940」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kingsquare/php-mt940 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kingsquare/php-mt940 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kingsquare/php-mt940 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
An MT940 bank statement parser for PHP
PHP library to communicate with bank through EBICS protocol.
PHP library to communicate with bank through EBICS protocol.
A port of the PEAR Net_HL7 library to PHP5.3+
Unified parser for several bank statement formats from Belgian banks
An MT940 bank statement parser for PHP
统计信息
- 总下载量: 835.91k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 107
- 点击次数: 24
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-02-26