定制 ch2877/swiss-payment 二次开发

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

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

ch2877/swiss-payment

Composer 安装命令:

composer require ch2877/swiss-payment

包简介

PHP library to generate Swiss pain.001 messages (complies with ISO-20022)

README 文档

README

Build Status Tested on PHP PHP 7.2, 7.3, 7.4, 8.0

SwissPayment is a PHP library to generate Swiss pain.001 XML messages (complies with ISO-20022).

Installation

Just install Composer and run composer require ch2877/swiss-payment in your project directory.

Usage

To get a basic understanding on how the messages are structured, take a look the resources mentioned below. The following example shows how to create a message containing two transactions:

<?php

require_once __DIR__.'/vendor/autoload.php';

use Z38\SwissPayment\BIC;
use Z38\SwissPayment\IBAN;
use Z38\SwissPayment\Message\CustomerCreditTransfer;
use Z38\SwissPayment\Money;
use Z38\SwissPayment\PaymentInformation\PaymentInformation;
use Z38\SwissPayment\PostalAccount;
use Z38\SwissPayment\StructuredPostalAddress;
use Z38\SwissPayment\TransactionInformation\BankCreditTransfer;
use Z38\SwissPayment\TransactionInformation\IS1CreditTransfer;
use Z38\SwissPayment\UnstructuredPostalAddress;

$transaction1 = new BankCreditTransfer(
    'instr-001',
    'e2e-001',
    new Money\CHF(130000), // CHF 1300.00
    'Muster Transport AG',
    new StructuredPostalAddress('Wiesenweg', '14b', '8058', 'Zürich-Flughafen'),
    new IBAN('CH51 0022 5225 9529 1301 C'),
    new BIC('UBSWCHZH80A')
);

$transaction2 = new IS1CreditTransfer(
    'instr-002',
    'e2e-002',
    new Money\CHF(30000), // CHF 300.00
    'Finanzverwaltung Stadt Musterhausen',
    UnstructuredPostalAddress::sanitize('Altstadt 1a', '4998 Musterhausen'),
    new PostalAccount('80-151-4')
);

$payment = new PaymentInformation(
    'payment-001',
    'InnoMuster AG',
    new BIC('ZKBKCHZZ80A'),
    new IBAN('CH6600700110000204481')
);
$payment->addTransaction($transaction1);
$payment->addTransaction($transaction2);

$message = new CustomerCreditTransfer('message-001', 'InnoMuster AG');
$message->addPayment($payment);

echo $message->asXml();

Tip: Take a look at Z38\SwissPayment\Tests\Message\CustomerCreditTransferTest to see all payment types in action.

Caveats

  • Not all business rules and recommendations are enforced, consult the documentation and validate the resulting transaction file in cooperation with your bank.
  • At the moment cheque transfers are not supported (for details consult chapter 2.2 of the Implementation Guidelines)
  • The whole project is still under development and therefore BC breaks can occur. Please contact me if you need a stable code base.

Contributing

If you want to get your hands dirty, great! Here's a couple of steps/guidelines:

  • Fork this repository
  • Add your changes & tests for those changes (in tests/).
  • Remember to stick to the existing code style as best as possible. When in doubt, follow PSR-2.
  • Send me a pull request!

If you don't want to go through all this, but still found something wrong or missing, please let me know, and/or open a new issue report so that I or others may take care of it.

Further Resources

ch2877/swiss-payment 适用场景与选型建议

ch2877/swiss-payment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 114.24k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2021 年 10 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 ch2877/swiss-payment 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 3
  • Forks: 33
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-18