Permalink
Browse files

Merge pull request #1272 from SergioCrisostomo/card-regex-update

update credit card regex
  • Loading branch information...
arian committed Jun 22, 2014
2 parents a586f51 + 199b3c8 commit 43a2d890734d391f742bc4eb1240262ff3da2a7d
Showing with 2 additions and 1 deletion.
  1. +2 −1 Source/Forms/Form.Validator.Extras.js
@@ -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;

0 comments on commit 43a2d89

Please sign in to comment.