Beispiel #1
0
 /**
  * @group ZF-10556
  */
 public function testIbanDetectionWithoutCountryCode()
 {
     $validator = new IbanValidator();
     $this->assertTrue($validator->isValid('AT611904300234573201'));
 }
Beispiel #2
0
 private function getBankCodeByIban($data, Company $company = null)
 {
     $ibanValidator = new Iban();
     $ibanValidator->setCountryCode('EE');
     $iban = '';
     $bankCode = null;
     foreach ($company->getBanks() as $bank) {
         /* @var $bank \Application\Entity\Bank */
         if (isset($data[12])) {
             $iban = $data[12];
             if (!$ibanValidator->isValid($iban)) {
                 $iban = IbanConverter::bban2iban($iban);
             }
             if ($iban == $bank->getIban()) {
                 $bankCode = Bank::BANK_KREDIIDIPANK;
                 return $bankCode;
             }
         }
         $iban = $data[0];
         if (!$ibanValidator->isValid($iban)) {
             $iban = IbanConverter::bban2iban($iban);
         }
         if ($iban == $bank->getIban()) {
             $bankCode = $bank->getCode();
             return $bankCode;
         }
     }
     return $bankCode;
 }
Beispiel #3
0
 public function testIbanNotSupported()
 {
     $validator = new Validator\Iban('en_US');
     $this->assertFalse($validator->isValid('AT611904300234573201'));
 }
Beispiel #4
0
 /**
  * @group ZF-10556
  */
 public function testIbanDetectionWithoutLocale()
 {
     $validator = new Validator\Iban(false);
     $this->assertTrue($validator->isValid('AT611904300234573201'));
 }