本文整理汇总了PHP中Bank::getBankID方法的典型用法代码示例。如果您正苦于以下问题:PHP Bank::getBankID方法的具体用法?PHP Bank::getBankID怎么用?PHP Bank::getBankID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::getBankID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isValid
/**
* @param int $bank
* @param int $account
* @return bool
* @throws ValidationTestAPIException
* @throws NotInitializedTestAPIException
* @throws BankNotFoundTestAPIException
*/
protected function isValid(Bank $bank, $account)
{
$isValid = kto_check_blz($bank->getBankID(), $account);
switch ($isValid) {
case self::NOT_INITIALIZED:
throw new NotInitializedTestAPIException("LUT not initialized");
case self::BANK_NOT_FOUND:
throw new BankNotFoundTestAPIException($bank->getBankID());
case self::INVALID_NULL:
case self::INVALID_KTO:
case self::INVALID_FALSE:
return false;
default:
if ($isValid < 0) {
throw new ValidationTestAPIException("unknown code {$isValid}");
}
return true;
}
}
示例2: getESER9
/**
* @throws ValidatorESERException
* @return string
*/
protected function getESER9()
{
$bankID = $this->bank->getBankID();
$account = ltrim($this->account, '0');
if (strlen($account) != 9) {
throw new ValidatorESERException();
}
if ($bankID[3] != 5) {
throw new ValidatorESERException();
}
$blzPart0 = substr($bankID, -4, 2);
$blzPart1 = substr($bankID, -1);
$accountPart0 = $account[0];
$t = $account[1];
$p = $account[2];
$accountTail = ltrim(substr($account, 3), '0');
$eser = $blzPart0 . $t . $blzPart1 . $accountPart0 . $p . $accountTail;
return $eser;
}
示例3: __construct
public function __construct(Bank $bank)
{
parent::__construct("bank {$bank->getBankID()} has no main agency.");
$this->bank = $bank;
}
示例4: getAgenciesForBank
/**
* @throws DataBackendException
* @return Agency[]
* @see DataBackend::getAgenciesForBank()
*/
public function getAgenciesForBank(Bank $bank)
{
try {
$stmt = $this->statementContainer->prepare("SELECT {$this->agencyAttributes} FROM {$this->prefix}agency a\n WHERE bank = :bankID AND id != :mainAgency");
$agencies = array();
$stmt->execute(array(":bankID" => $bank->getBankID(), ":mainAgency" => $bank->getMainAgency()->getID()));
foreach ($stmt->fetchAll() as $agencyResult) {
$agencies[] = $this->getAgencyObject($bank, $agencyResult);
}
$stmt->closeCursor();
return $agencies;
} catch (\PDOException $e) {
$stmt->closeCursor();
throw new DataBackendIOException($e->getMessage(), 0, $e);
} catch (MissingAttributesDataBackendIOException $e) {
$stmt->closeCursor();
throw new \LogicException($e);
}
}
示例5: getErrorMessage
/**
* @param Bank $bank
* @param String $account
* @param array $results
* @return String
*/
private function getErrorMessage(Bank $bank, $account, array $results)
{
$resultTranslation = array(TestAPIResult::VALID => "valid", TestAPIResult::INVALID => "invalid", TestAPIResult::ERROR => "error");
$message = "bank: {$bank->getBankID()} method: {$bank->getValidationType()} account: {$account}";
foreach ($results as $result) {
$message .= " {$result->getTestAPI()->getName()}: " . $resultTranslation[$result->getResult()];
if ($result instanceof TestAPIErrorResult) {
$message .= " {$result->getMessage()}";
}
}
return $message;
}
示例6: testNullIsInvalid
/**
* 0 - 0000000000 should always be invalid
*
* @param String $validatorType
* @throws ClassFileIOException
* @throws MissingClassException
* @dataProvider provideBanks
*/
public function testNullIsInvalid(Bank $bank)
{
for ($length = 0; $length <= 10; $length++) {
$account = str_pad("0", $length, "0", STR_PAD_LEFT);
$this->assertFalse($bank->isValid($account), "{$bank->getBankID()}/{$bank->getValidationType()} {$account} should be invalid.");
}
}
示例7: isValid
/**
* @param int $account
* @return bool
* @throws ValidationTestAPIException
* @throws NotInitializedTestAPIException
* @throws BankNotFoundTestAPIException
*/
protected function isValid(Bank $bank, $account)
{
$fileParam = empty($this->bankdata) ? '' : "--file={$this->bankdata}";
$cmd = "{$this->binary} {$fileParam} '{$bank->getBankID()}' '{$account}'";
exec($cmd, $out, $result);
switch ($result) {
case self::VALID:
return true;
case self::INVALID:
return false;
case self::BANK_NOT_FOUND:
throw new BankNotFoundTestAPIException("Bank not found: {$bank->getBankID()}");
default:
throw new ValidationTestAPIException("unknown code {$result}: " . implode("\n", $out));
}
}