示例#1
0
        /// <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));
        }
示例#2
0
文件: Iban.cs 项目: jlnovais/Tools
 public string GetIdentificationNumber() => IbanUtils.GetIdentificationNumber(Value);
示例#3
0
文件: Iban.cs 项目: jlnovais/Tools
 public string GetBBan() => IbanUtils.GetBBan(Value);
示例#4
0
文件: Iban.cs 项目: jlnovais/Tools
 public string GetNationalCheckDigit() => IbanUtils.GetNationalCheckDigit(Value);
示例#5
0
文件: Iban.cs 项目: jlnovais/Tools
 public string GetOwnerAccountType() => IbanUtils.GetOwnerAccountType(Value);
示例#6
0
文件: Iban.cs 项目: jlnovais/Tools
 public string GetBankCode() => IbanUtils.GetBankCode(Value);
示例#7
0
文件: Iban.cs 项目: jlnovais/Tools
 public string GetBranchCode() => IbanUtils.GetBranchCode(Value);
示例#8
0
文件: Iban.cs 项目: jlnovais/Tools
 public string GetAccountNumberPrefix() => IbanUtils.GetAccountNumberPrefix(Value);
示例#9
0
文件: Iban.cs 项目: jlnovais/Tools
 public string GetAccountNumber() => IbanUtils.GetAccountNumber(Value);
示例#10
0
文件: Iban.cs 项目: jlnovais/Tools
 public string GetCheckDigit() => IbanUtils.GetCheckDigit(Value);
示例#11
0
文件: Iban.cs 项目: jlnovais/Tools
 public CountryCodeEntry GetCountryCode() => CountryCode.GetCountryCode(IbanUtils.GetCountryCode(Value));
示例#12
0
文件: Iban.cs 项目: jlnovais/Tools
 /// <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));
 }