Exemplo n.º 1
0
 public static bool IsValidNumber(string cardNum, CreditCardType?cardType)
 {
     return(CreditCardHelper._cardRegex.Match(cardNum).Groups[cardType.ToString()].Success && CreditCardHelper.PassesLuhnTest(cardNum));
 }
Exemplo n.º 2
0
        public static bool IsValidNumber(string cardNum)
        {
            CreditCardType?cardTypeFromNumber = CreditCardHelper.GetCardTypeFromNumber(cardNum);

            return(CreditCardHelper.IsValidNumber(cardNum, cardTypeFromNumber));
        }