call method

BankInformation? call()

Returns all information from sheba code

Implementation

BankInformation? call() {
  final shebaCode = _shebaCode;
  if (!isValid) return null;
  final bankCode = patternCode.firstMatch(shebaCode)?[1] ?? '';
  var bank = banksInfo[bankCode];
  if (bank == null) return null;
  if (bank.isAccountNumberAvailable) {
    final data = bank.process!(shebaCode);
    bank.accountNumber = data.accountNumber;
    bank.formattedAccountNumber = data.formattedAccountNumber;
  }
  bank.process = null;
  return bank;
}