First you need to add shapecode/iban-bundle
to composer.json
:
{
"require": {
"shapecode/iban-bundle": "~2.0"
}
}
Please note that dev-develop
points to the latest development version. Of course you can also use an explicit version number, e.g., 1.0.*
.
You also have to add ShapecodeIbanBundle
to your AppKernel.php
:
<?php
// app/AppKernel.php
//...
class AppKernel extends Kernel
{
//...
public function registerBundles()
{
$bundles = array(
...
new Shapecode\Bundle\IbanBundle\ShapecodeIbanBundle(),
);
//...
return $bundles;
}
//...
}
<?php
// get iban from country code, bank identification and account number
$iban = $this->getContainer()->get('shapecode_iban.generator')->generateIban('DE', '50010517', '0648489890');
// get bic from iban
$bic = $this->getContainer()->get('shapecode_iban.generator')->generateBic($iban);
// validate iban
$isIban = $this->getContainer()->get('shapecode_iban.generator')->validateIban($iban);