public OCIAID(bool asid, IssuerType isstype, ApplicationType apptype, ISOCountryCode country, ulong id) { ArsslensoftAssigned = asid; IssuanceType = isstype; Application = apptype; Country = country; Identifier = id; }
/// <summary> /// Parameterized constructor. /// </summary> /// <param name="customerName"></param> /// <param name="issuerType"></param> /// <param name="creditCardNumber"></param> /// <param name="expirationMonth"></param> /// <param name="expirationYear"></param> public CreditCardInformation(string customerName, IssuerType issuerType, string creditCardNumber, int expirationMonth, int expirationYear) { _customerName = customerName; _issuerType = issuerType; this.CreditCardNumber = creditCardNumber; _expirationMonth = expirationMonth; _expirationYear = expirationYear; }
} // ParseIssueIdentifier() /// <summary> /// This function parses the enumerated issuer type from the string /// credit card number. /// </summary> /// <param name="strAccountNumber"> /// The input fully-qualified credit card number. /// </param> /// <returns> /// The substring representation of the issuer identifier. /// </returns> internal static IssuerType ParsIssuerType(string strAccountNumber) { IssuerType eit = IssuerType.Unknown; foreach (CCNumberParser pars in m_apars) { if (pars.Parse(strAccountNumber.Length, CreditCardNumber.ParseIssueIdentifier(strAccountNumber))) { eit = pars.IssuerType; // Assumption: mutually exclusive types break; } // if( Parser.Parse() } // foreach( CCNumberParser pars in m_apars ) return(eit); } // ParsIssuerType()
public static OCIAID Parse(string ociaid) { string[] oid = ociaid.Split('-'); string org = oid[0]; bool asid = false; if (org == "AS-OCIAID") { asid = true; } IssuerType it = IssuerType.Unknown; if (Enum.IsDefined(typeof(IssuerType), oid[1])) { it = (IssuerType)Enum.Parse(typeof(IssuerType), oid[1]); } ApplicationType app = ApplicationType.Unknown; if (Enum.IsDefined(typeof(ApplicationType), oid[2])) { app = (ApplicationType)Enum.Parse(typeof(ApplicationType), oid[2]); } ISOCountryCode country = ISOCountryCode.Unknown; if (Enum.IsDefined(typeof(ISOCountryCode), oid[3])) { country = (ISOCountryCode)Enum.Parse(typeof(ISOCountryCode), oid[3]); } ulong id = ulong.Parse(oid[4]); return(new OCIAID(asid, it, app, country, id)); }