Checks to see if the cc number is a valid number for any accepted credit card @param ccPassed - a string representing a credit card number @return true, if the credit card number is any valid credit card number for any of the accepted card types, false otherwise
(String ccPassed)
| 1006 | * @return true, if the credit card number is any valid credit card number for any of the accepted card types, false otherwise |
| 1007 | */ |
| 1008 | public static boolean isAnyCard(String ccPassed) { |
| 1009 | if (isEmpty(ccPassed)) return defaultEmptyOK; |
| 1010 | |
| 1011 | String cc = stripCharsInBag(ccPassed, creditCardDelimiters); |
| 1012 | |
| 1013 | if (!isCreditCard(cc)) return false; |
| 1014 | if (isMasterCard(cc) || isVisa(cc) || isAmericanExpress(cc) || isDinersClub(cc) || |
| 1015 | isDiscover(cc) || isEnRoute(cc) || isJCB(cc)) |
| 1016 | return true; |
| 1017 | return false; |
| 1018 | } |
| 1019 | |
| 1020 | /** Checks to see if the cc number is a valid number for any accepted credit card, and return the name of that type |
| 1021 | * @param ccPassed - a string representing a credit card number |
nothing calls this directly
no test coverage detected