Skip to content

Commit

Permalink
Support 2 series Mastercard per issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
dnmfarrell committed May 14, 2017
1 parent 4b3d2ac commit 2cc1469
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Data/FormValidator/Constraints.pm
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,8 @@ sub match_cc_number {
return undef unless $card_type =~ /^[admv]/i;

return undef if ($card_type =~ /^v/i && substr($the_card, 0, 1) ne "4") ||
($card_type =~ /^m/i && substr($the_card, 0, 1) ne "5") ||
($card_type =~ /^m/i && substr($the_card, 0, 1) ne "5" &&
substr($the_card, 0, 1) ne "2") ||
($card_type =~ /^d/i && substr($the_card, 0, 4) ne "6011") ||
($card_type =~ /^a/i && substr($the_card, 0, 2) ne "34" &&
substr($the_card, 0, 2) ne "37");
Expand Down

0 comments on commit 2cc1469

Please sign in to comment.