MCPcopy Create free account
hub / github.com/banq/jdonframework / isAnyCard

Method isAnyCard

src/main/java/com/jdon/util/UtilValidate.java:1008–1018  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 10

isEmptyMethod · 0.95
stripCharsInBagMethod · 0.95
isCreditCardMethod · 0.95
isMasterCardMethod · 0.95
isVisaMethod · 0.95
isAmericanExpressMethod · 0.95
isDinersClubMethod · 0.95
isDiscoverMethod · 0.95
isEnRouteMethod · 0.95
isJCBMethod · 0.95

Tested by

no test coverage detected