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

Method isJCB

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

Checks to see if the cc number is a valid JCB number @param cc - a string representing a credit card number; Sample number: 3088000000000009(16 digits) @return true, if the credit card number is a valid JCB card number, false otherwise

(String cc)

Source from the content-addressed store, hash-verified

988 * @return true, if the credit card number is a valid JCB card number, false otherwise
989 */
990 public static boolean isJCB(String cc) {
991 String first4digs = cc.substring(0, 4);
992
993 if ((cc.length() == 16) &&
994 (first4digs.equals("3088") ||
995 first4digs.equals("3096") ||
996 first4digs.equals("3112") ||
997 first4digs.equals("3158") ||
998 first4digs.equals("3337") ||
999 first4digs.equals("3528")))
1000 return isCreditCard(cc);
1001 return false;
1002 }
1003
1004 /** Checks to see if the cc number is a valid number for any accepted credit card
1005 * @param ccPassed - a string representing a credit card number

Callers 3

isAnyCardMethod · 0.95
getCardTypeMethod · 0.95
isCardMatchMethod · 0.95

Calls 1

isCreditCardMethod · 0.95

Tested by

no test coverage detected