PHP code example of jschaedl / bav

1. Go to this page and download the library: Download jschaedl/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/ */

    

jschaedl / bav example snippets





use Bav\Backend\Parser\BankDataParser;
use Bav\Backend\BankDataResolver;
use Bav\Encoder\EncoderFactory;

$bankDataFile = 'blz_2013_12_09_txt.txt';

$encoder = EncoderFactory::create(Bav::DEFAULT_ENCODING);

$parser = new BankDataParser($bankDataFile);
$parser->setEncoder($encoder);       

$bav = new Bav();
$bav->setBankDataResolver(new BankDataResolver($parser));

$bank = $bav->getBank('20090500');
$agency = $bank->getMainAgency();
$this->assertEquals('netbank', $agency->getName());
$this->assertEquals('000000', $agency->getIbanRule());

$bank = $bav->getBank('58561250');
$this->assertEquals('58564788', $bank->getBankId());

$bank = $bav->getBank('20090500');
$this->assertTrue($bank->isValid('1359100'));


curl -sS https://getcomposer.org/installer | php