Skip to content

MasterCard checker is outdated #5

@tsaisean

Description

@tsaisean

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;
		}
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions