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)
| 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 |
no test coverage detected