Skip to content

Commit

Permalink
Merge pull request #1272 from SergioCrisostomo/card-regex-update
Browse files Browse the repository at this point in the history
update credit card regex
  • Loading branch information
arian committed Jun 22, 2014
2 parents a586f51 + 199b3c8 commit 43a2d89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/Forms/Form.Validator.Extras.js
Expand Up @@ -194,7 +194,8 @@ Form.Validator.addAllThese([
if (ccNum.test(/^4[0-9]{12}([0-9]{3})?$/)) valid_type = 'Visa';
else if (ccNum.test(/^5[1-5]([0-9]{14})$/)) valid_type = 'Master Card';
else if (ccNum.test(/^3[47][0-9]{13}$/)) valid_type = 'American Express';
else if (ccNum.test(/^6011[0-9]{12}$/)) valid_type = 'Discover';
else if (ccNum.test(/^6(?:011|5[0-9]{2})[0-9]{12}$/)) valid_type = 'Discover';
else if (ccNum.test(/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/)) valid_type = 'Diners Club';

if (valid_type){
var sum = 0;
Expand Down

0 comments on commit 43a2d89

Please sign in to comment.