/**
  * @return bool
  */
 public function validate($input)
 {
     return $this->bav->isValidBankAccount($this->bank, $input);
 }
Exemple #2
0
 /**
  * @return bool
  */
 public function validate($input)
 {
     return $this->bav->isValidBank($input);
 }
Exemple #3
0
 *
 * If you didn't install BAV yet and Configuration::isAutomaticInstallation() is true
 * (default) then BAV will install the bundesbank file which might take a few seconds.
 *
 * @filesource
 * @author Markus Malkusch <*****@*****.**>
 * @see BAV
 */
require_once __DIR__ . "/../vendor/autoload.php";
use malkusch\bav\BAV;
/**
 * Let's have some fun with the bank 10000000
 */
try {
    // API Facade with default configuration
    $bav = new BAV();
    // Does the bank exist?
    echo "Bank 10000000 ", $bav->isValidBank("10000000") ? "exists" : "doesn't exist", "\n";
    // Does the account exist?
    echo "Account 12345 is ", $bav->isValidBankAccount("10000000", "12345") ? "valid" : "invalid", "\n";
    // Use PHP's validation filter
    if (filter_var("10000000", FILTER_CALLBACK, $bav->getValidBankFilterCallback())) {
        echo "Bank 10000000 is valid.\n";
    } else {
        echo "Bank 10000000 is invalid.\n";
    }
    // Account filter validation needs a previous call to the bank filter.
    if (filter_var("12345", FILTER_CALLBACK, $bav->getValidAccountFilterCallback())) {
        echo "Account 12345 is valid.\n";
    } else {
        echo "Account 12345 is invalid.\n";