/// <summary> /// Builds new IBAN instance /// </summary> /// <param name="validate">True if the generated IBAN will be validated after generation</param> /// <returns>New IBAN instance</returns> /// <exception cref="IbanFormatException">If values doesn't meet requirements for valid IBAN.</exception> /// <exception cref="UnsupportedCountryException">If specified country code is not supported.</exception> public Iban Build(bool validate) { require(_countryCodeEntry, _bankCode, _accountNumber); string formattedIban = formatIban(); string checkDigit = IbanUtils.CalculateCheckDigit(formattedIban); string ibanValue = IbanUtils.ReplaceCheckDigit(formattedIban, checkDigit); if (validate) { IbanUtils.Validate(ibanValue); } return(Iban.CreateInstance(ibanValue)); }
public string GetIdentificationNumber() => IbanUtils.GetIdentificationNumber(Value);
public string GetBBan() => IbanUtils.GetBBan(Value);
public string GetNationalCheckDigit() => IbanUtils.GetNationalCheckDigit(Value);
public string GetOwnerAccountType() => IbanUtils.GetOwnerAccountType(Value);
public string GetBankCode() => IbanUtils.GetBankCode(Value);
public string GetBranchCode() => IbanUtils.GetBranchCode(Value);
public string GetAccountNumberPrefix() => IbanUtils.GetAccountNumberPrefix(Value);
public string GetAccountNumber() => IbanUtils.GetAccountNumber(Value);
public string GetCheckDigit() => IbanUtils.GetCheckDigit(Value);
public CountryCodeEntry GetCountryCode() => CountryCode.GetCountryCode(IbanUtils.GetCountryCode(Value));
/// <summary> /// Creates IBAN instance. /// Specified IBAN string undergoes validation /// </summary> /// <param name="iban"></param> /// <returns></returns> public static Iban CreateInstance(string iban) { IbanUtils.Validate(iban); return(new Iban(iban)); }