From 46dc1f93e2153365478fa914439e5738d8e41a3e Mon Sep 17 00:00:00 2001 From: shanezr Date: Thu, 27 Aug 2015 11:45:02 -0600 Subject: [PATCH] Update scrupulous.js Adding in a check for a masked cc number since we can't luhn check that --- js/scrupulous.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/scrupulous.js b/js/scrupulous.js index 4fe8f33..51f53bc 100644 --- a/js/scrupulous.js +++ b/js/scrupulous.js @@ -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;