endereco/bank-account-check

此包最新版本(1.0.0)没有提供许可证信息。

1.0.0 2021-10-18 08:40 UTC

This package is auto-updated.

Last update: 2024-09-18 15:04:08 UTC


README

使用此工具可以检查账号尾号校验码。

安装

composer require endereco/bank-account-check

更新

composer update endereco/bank-account-check

使用

require './vendor/autoload.php';

use Endereco\BankAccountCheck\BankAccount; // Facade definieren.

$bankAccount = "";
$bankCode = "";
$countryCode = "DE";

if (BankAccount::isCountrySupported($countryCode) && BankAccount::isBankCodeSupported($bankCode)) {

    // Hauptaufgabe.
    $bankAccountValid = BankAccount::isValid($bankAccount, $bankCode); // true oder false.
    echo  $bankAccountValid . PHP_EOL;

    // Prüfmethode herausfinden.
    $checkMethod = BankAccount::getCheckMethod($bankCode); // gibt z.B. "08" zurück.
    echo  $checkMethod . PHP_EOL;

} else {
    // Kontonummer kann nicht geprüft werden.
    echo  "Kontonummer kann nicht geprüft werden." . PHP_EOL;
}

单个方法

isCountrySupported

检查是否支持该国家。

调用

BankAccount::isCountrySupported($countryCode)

传递参数

返回值

isBankCodeSupported

检查计算方法是否支持银行行号。

调用

 BankAccount::isBankCodeSupported($bankCode)

传递参数

返回值

isValid

检查账号尾号校验码是否正确。

调用

 BankAccount::isValid($bankAccount, $bankCode)

传递参数

返回值

getCheckMethod

提供银行行号的计算方法。

调用

BankAccount::getCheckMethod($bankCode)

传递参数

返回值