Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MasterCard checker is outdated #5

Open
tsaisean opened this issue May 8, 2018 · 0 comments
Open

MasterCard checker is outdated #5

tsaisean opened this issue May 8, 2018 · 0 comments

Comments

@tsaisean
Copy link

tsaisean commented May 8, 2018

The card start with 2221-2720 is not passing current checker.
Can consider to update the utils.

private static boolean checkIfMasterCard(int size, String value) {
		int firstChars = Integer.parseInt(value.substring(0, 2));
		int firstCharsRules2017 = Integer.parseInt(value.substring(0, 4));
		if (size == 16
				&& ((firstChars >= 51 && firstChars <= 55)
				|| (firstCharsRules2017 >= 2221 && firstChars <= 2720))) {
			return true;
		} else {
			return false;
		}
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant