Esempio n. 1
0
    print "Is a SEPA member? ";
    if (iban_country_is_sepa($countrycode)) {
        print "Yes";
    } else {
        print "No";
    }
    print ".\n";
    # get example iban
    $iban = $country['iban_example'];
    # output example iban properties one by one
    print "Example IBAN: " . iban_to_human_format($iban) . "\n";
    print " - country  " . iban_get_country_part($iban) . "\n";
    print " - checksum " . iban_get_checksum_part($iban) . "\n";
    print " - bban     " . iban_get_bban_part($iban) . "\n";
    print " - bank     " . iban_get_bank_part($iban) . "\n";
    print " - branch   " . iban_get_branch_part($iban) . "\n";
    print " - account  " . iban_get_account_part($iban) . "\n";
    # output all properties
    #$parts = iban_get_parts($iban);
    #print_r($parts);
    # verify
    print "\nChecking validity... ";
    if (verify_iban($iban)) {
        print "IBAN {$iban} is valid.\n";
    } else {
        print "ERROR: IBAN {$iban} is invalid.\n";
        $errors++;
    }
    print "\n";
}
exit($errors);
Esempio n. 2
0
 public function Branch()
 {
     return iban_get_branch_part($this->iban);
 }
Esempio n. 3
0
function iban_get_parts($iban)
{
    return array('country' => iban_get_country_part($iban), 'checksum' => iban_get_checksum_part($iban), 'bban' => iban_get_bban_part($iban), 'bank' => iban_get_bank_part($iban), 'country' => iban_get_country_part($iban), 'branch' => iban_get_branch_part($iban), 'account' => iban_get_account_part($iban));
}
Esempio n. 4
0
function _iban_nationalchecksum_implementation_es($iban, $mode)
{
    if ($mode != 'set' && $mode != 'find' && $mode != 'verify') {
        return '';
    }
    # blank value on return to distinguish from correct execution
    # extract appropriate substrings
    $bankprefix = iban_get_bank_part($iban) . iban_get_branch_part($iban);
    $nationalchecksum = iban_get_nationalchecksum_part($iban);
    $account = iban_get_account_part($iban);
    $account_less_checksum = substr($account, 2);
    # first we calculate the initial checksum digit, which is MOD11 of the bank prefix with '00' prepended
    $expected_nationalchecksum = _iban_nationalchecksum_implementation_es_mod11_helper("00" . $bankprefix);
    # then we append the second digit, which is MOD11 of the account
    $expected_nationalchecksum .= _iban_nationalchecksum_implementation_es_mod11_helper($account_less_checksum);
    if ($mode == 'find') {
        return $expected_nationalchecksum;
    } elseif ($mode == 'set') {
        return _iban_nationalchecksum_set($iban, $expected_nationalchecksum);
    } elseif ($mode == 'verify') {
        return $nationalchecksum == $expected_nationalchecksum;
    }
}