承接 czechphp/czech-bank-account 相关项目开发

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

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

czechphp/czech-bank-account

最新稳定版本:v1.3.2

Composer 安装命令:

composer require czechphp/czech-bank-account

包简介

Provides useful utilities for czech bank account validation and data manipulation.

README 文档

README

Provides useful utilities for czech bank account validation and data manipulation.

Installation

Install the latest version with

$ composer require czechphp/czech-bank-account 

Documentation

Bank Account Number Validator

Czech: Validátor českého národního čísla bankovního účtu

<?php use Czechphp\CzechBankAccount\Validator\BankAccountNumberValidator; $validator = new BankAccountNumberValidator(); $violation = $validator->validate('19-19', [ 'type' => BankAccountNumberValidator::OPTION_TYPE_VARIABLE, ]); if ($violation === BankAccountNumberValidator::ERROR_NONE) { // valid }

Bank Code Validator

Czech: Validátor kódů platebního styku v ČR (kódy bank)

<?php use Czechphp\CzechBankAccount\Validator\BankCodeValidator; use Czechphp\CzechBankAccount\Loader\BankCode\FilesystemLoader; $validator = new BankCodeValidator(new FilesystemLoader()); $violation = $validator->validate('0100'); if ($violation === BankCodeValidator::ERROR_NONE) { // valid }

Variable Symbol Validator

Czech: Validátor variabilního symbolu

<?php use Czechphp\CzechBankAccount\Validator\VariableSymbolValidator; $validator = new VariableSymbolValidator(); $violation = $validator->validate('123'); if ($violation === VariableSymbolValidator::ERROR_NONE) { // valid }

Specific Symbol Validator

Czech: Validátor specifického symbolu

<?php use Czechphp\CzechBankAccount\Validator\SpecificSymbolValidator; $validator = new SpecificSymbolValidator(); $violation = $validator->validate('123'); if ($violation === SpecificSymbolValidator::ERROR_NONE) { // valid }

Constant Symbol Validator

Czech: Validátor konstantního symbolu

In default validates only format of constant symbol.

<?php use Czechphp\CzechBankAccount\Validator\ConstantSymbolValidator; $validator = new ConstantSymbolValidator(); $violation = $validator->validate('0006'); if ($violation === ConstantSymbolValidator::ERROR_NONE) { // valid }

(Deprecated) To use optional validation against database of known constant symbols, validator needs Filter instance in the constructor and filter option in the validate methods call.

<?php use Czechphp\CzechBankAccount\ConstantSymbol\Filter\ArrayCacheFilter; use Czechphp\CzechBankAccount\ConstantSymbol\Filter\Filter; use Czechphp\CzechBankAccount\ConstantSymbol\Loader\ArrayRequireLoader; use Czechphp\CzechBankAccount\Validator\ConstantSymbolValidator; $filter = new ArrayCacheFilter(new Filter(new ArrayRequireLoader())); $validator = new ConstantSymbolValidator($filter); $violation = $validator->validate('0006', [ 'filter' => ['include' => ['all']], ]); if ($violation === ConstantSymbolValidator::ERROR_NONE) { // valid }

Constant Symbol Component (Deprecated)

Loads list of known constant symbols and filters out specified categories and symbols.

In the provided database of constant symbols groups all, public and restricted are used.

  • group all contains all symbols without exception
  • group public contains symbols that are safe to use by public
  • group restricted contains symbols that only banks or government is allowed to use

Note that provided database of known constant symbols may be incomplete or restriction groups may be incorrectly set. The reason is that it is complicated to obtain up to date list of constant symbols and the fact that constant symbols are slowly deprecated by the government. This database exist so that it is possible to restrict user from entering constant symbol that public is not allowed to use.

ArrayRequireLoader

In default loads data bundled with library, but can be set to read from any file.

Filter

Filters loaded data.

Filter criteria is divided into filters include and exclude. Both filters accept group names and individual constant symbol codes.

For example criteria ['include' => ['public', 'restricted'], 'exclude' => ['5']] will return list of symbols that are part of of groups public and/or restricted while symbol 5 is excluded from the list.

ArrayCacheFilter

Caches result of latest criteria.

It is recommended to use at least array cache due to the size of the list of known constant symbols. Loading and filtering of the list can take up to tens of milliseconds.

Bank Code Component

Loads directory of payment system codes.

Loaded data is multidimensional array in following format:

<?php use Czechphp\CzechBankAccount\Loader\BankCode\FilesystemLoader; use Czechphp\CzechBankAccount\Loader\BankCode\LoaderInterface; $loader = new FilesystemLoader(); $data = $loader->load(); // first two rows of $data variable [ [ LoaderInterface::CODE => '0100', // string LoaderInterface::NAME => 'Komerční banka, a.s.', // string LoaderInterface::BIC => 'KOMBCZPP', // string|null LoaderInterface::CERTIS => true, // bool ], [ LoaderInterface::CODE => '0300', LoaderInterface::NAME => 'Československá obchodní banka, a. s.', LoaderInterface::BIC => 'CEKOCZPP', LoaderInterface::CERTIS => true, ], ];

FilesystemLoader

In default loads data bundled with library, but can be set to read from any file.

FileGetContentsLoader

Loads data from official remote source using file_get_contents.

SymfonyHttpClientLoader

Loads data from official remote source using http client implementing symfony/http-client-implementation.

SymfonyCachedLoader

Decorator loader caches result from parent loader using cache client implementing symfony/cache-implementation.

ChainLoader

Chains loaders. If chained loader fails, then it calls next loader in line.

Bank Account Number Format Converter

Converts bank account number format between common formats.

<?php use Czechphp\CzechBankAccount\Utils\BankAccountNumberFormatConverter; BankAccountNumberFormatConverter::convertVariableToConstant('19-19'); // returns "0000190000000019" BankAccountNumberFormatConverter::convertConstantToVariable('0000190000000019'); // returns "19-19"

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固