承接 abcaeffchen/sepa-utilities 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

abcaeffchen/sepa-utilities

Composer 安装命令:

composer require abcaeffchen/sepa-utilities

包简介

SepaUtilities provides useful methods for validating and sanitizing inputs used in SEPA files supporting PHP >= 8.1.

README 文档

README

Unit Tests Latest Stable Version Total Downloads License

General

SepaUtilities is a PHP class to check and sanitize inputs used in SEPA files such as IBAN numbers, creditor identifiers, names and other text.

PHP Versions

SepaUtilities supports PHP >= 8.1.

Installation

Composer

You can get SepaUtilities via Composer. Just add

{
    "require": {
        "abcaeffchen/sepa-utilities": "^2.0"
    }
}

to your composer.json.

Direct download

If you don't use Composer, you can download SepaUtilities.php and just include it into your PHP files. Make sure you use the namespace AbcAeffchen\SepaUtilities\.

The Utilities

Have a look at the documentation.

Checks

  • checkIBAN($iban): Checks if the IBAN is valid by checking the format and by calculating the checksum and also removes whitespaces and changes all letters to upper case.
  • checkBIC($bic): Checks if the BIC is valid by checking the format and also removes whitespaces and changes all letters to upper case.
  • crossCheckIbanBic($iban, $bic): Checks if IBAN and BIC belong to the same country.
  • isNationalTransaction($iban1,$iban2): Checks if both IBANs are belong to the same country.
  • checkCharset($str): Checks if the string contains only allowed characters.
  • check($field, $input, $options, $version): Checks if the input fits the field. This function also does little format changes, e.g. correcting letter case. Possible field values are (case-insensitive):
    • initgpty: Initiating Party
    • initgptyid: Initiating Party ID
    • msgid: Message ID
    • pmtid: Payment ID
    • pmtinfid: Payment Information ID
    • cdtr: Creditor Name
    • ultmtcdrt: Ultimate Creditor
    • dbtr: Debtor Name
    • ultmtdebtr: Ultimate Debtor
    • ultmtdbtrid: Ultimate Debtor ID
    • iban: IBAN
    • bic: BIC
    • ccy: Currency
    • btchbookg: Batch Booking (boolean as string)
    • instdamt: Instructed Amount
    • rmtinf: Remittance Information
    • ci: Creditor Identifier
    • seqtp: Sequence Type
    • lclinstrm: Local Instrument
    • ctry: Two-letter country code, used in postal address
    • Subfield of pstlAdr
      • adrline: An address line, or an array of at most two address lines
      • bldgnm: Building name
      • bldgnb: Building number
      • twnnm: Town name
      • twnlctnnm: Town location name (within a town)
      • dstrctnm: District name
      • ctrysubdvsn: country subdivision, e.g. state, region, county
      • pstbx: Postbox
      • pstcd: Postal code
      • dept: Department
      • subdept: Subdepartment
      • strtnm: Street name
      • flr: Floor
      • room: Room

The $options take an array

Sanitizing

  • sanitizeLength($input, $maxLen): Shortens the string if it is to long.
  • sanitizeShortText($input,$allowEmpty, $flags): Sanitizes the the charset and shortens the text if necessary.
  • sanitizeLongText($input,$allowEmpty, $flags): Sanitizes the the charset and shortens the text if necessary.
  • replaceSpecialChars($str): replaces all characters that are not allowed in sepa files by a allowed one or removes them. Take a look at this .xls file for more information Notice: Cyrillic is not supported yet, but greek letters are.
  • sanitize($field, $input, $flags): tries to sanitize the input, so it fits the field. Possible fields are
    • cdtr
    • dbtr
    • rmtinf
    • ultmtcdrt
    • ultmtdebtr
    • adrline

Wrappers

  • checkAndSanitize($field, $input, $flags, $options): Checks the input and if it is not valid it tries to sanitize it.
  • checkAndSanitizeAll(&$inputs, $flags, $options): Takes an array of inputs (field => value) and checks and sanitizes each of the fields. The input array is handed over as reference, so the result will be direct effect the input array. The return value is true, if everything is ok and else a string with problematic fields.

Date functions

  • getDate($date, $inputFormat): Returns $date in a SEPA-valid format. You can specify the input format by using the table on this site. By default the german date format (DD.MM.YYYY) is used.
  • getDateWithOffset($workdayOffset, $today, $inputFormat): Computes the next TARGET2 day (including today) with respect to an offset.
  • getDateWithMinOffsetFromToday($target, $workdayMinOffset, $inputFormat, $today): Returns the target date, if it has at least the given offset of TARGET2 days form today. Else the earliest date that respects the offset is returned.

Patterns

  • HTML_PATTERN_IBAN
  • HTML_PATTERN_BIC
  • PATTERN_IBAN
  • PATTERN_BIC
  • PATTERN_CREDITOR_IDENTIFIER
  • PATTERN_SHORT_TEXT
  • PATTERN_LONG_TEXT
  • PATTERN_RESTRICTED_IDENTIFICATION_SEPA1
  • PATTERN_MANDATE_ID

The HTML_PATTERN_* constants can be used as HTML5 pattern attribute. It is user friendlier than the corresponding PATTERN_* as they allow lowercase characters and whitespaces. This is corrected by the check methods.

Licence

SepaUtilities is licensed under the LGPL v3.0 License.

abcaeffchen/sepa-utilities 适用场景与选型建议

abcaeffchen/sepa-utilities 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.07M 次下载、GitHub Stars 达 31, 最近一次更新时间为 2014 年 10 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 abcaeffchen/sepa-utilities 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 2.07M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 31
  • 点击次数: 40
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 31
  • Watchers: 7
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2014-10-17