Skip to content

Commit

Permalink
Update scrupulous.js
Browse files Browse the repository at this point in the history
Adding in a check for a masked cc number since we can't luhn check that
  • Loading branch information
shanezr committed Aug 27, 2015
1 parent 0a277fa commit 46dc1f9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/scrupulous.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@
bit = 1,
sum = 0,
val;


/** no way to validate a masked card, will have to let the backend handle it **/
if ( number.match(/^[xX*-]+\d{4}$/g) ){
console.log("match a mask")
return true;
}

while (len) {
val = parseInt(number.charAt(--len), 10);
sum += (bit ^= 1) ? arr[val] : val;
Expand Down

0 comments on commit 46dc1f9

Please sign in to comment.