PHP code example of cashlink / bav

1. Go to this page and download the library: Download cashlink/bav library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cashlink / bav example snippets


namespace malkusch\bav;

$configuration = new DefaultConfiguration();

$pdo = new \PDO("mysql:host=localhost;dbname=test;charset=UTF8");
$configuration->setDataBackendContainer(new PDODataBackendContainer($pdo));

$configuration->setUpdatePlan(new AutomaticUpdatePlan());

return $configuration;

use malkusch\bav\BAV;

$bav = new BAV();
$bav->update();

namespace malkusch\bav;

$configuration = new DefaultConfiguration();
$configuration->setUpdatePlan(new AutomaticUpdatePlan());

return $configuration;

use malkusch\bav\BAV;

$bav = new BAV();
$bankID  = "10000000";
$account = "1234567890"

// check for a bank
var_dump(
    $bav->isValidBank($bankID)
);

// check for a bank account
var_dump(
    $bav->isValidBankAccount($bankID, $account)
);

// filter validation
var_dump(
    filter_var($bankID, FILTER_CALLBACK, $bav->getValidBankFilterCallback()),
    filter_var($account, FILTER_CALLBACK, $bav->getValidAccountFilterCallback())
);

// Get informations about a bank
$agency = $bav->getMainAgency($bankID);
echo "{$agency->getName()} {$agency->getCity()}\n";