Skip to content

Commit

Permalink
ATP-106 - Updated card length validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Stanford authored and Mark Stanford committed Aug 7, 2015
1 parent be05b4a commit 0fbe5aa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions dist/rxp-js.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! rxp-js - v1.0.0 - 2015-07-31
/*! rxp-js - v1.0.0 - 2015-08-07
* The official Realex Payments JS SDK
* https://github.com/realexpayments/rxp-js
* Licensed MIT
Expand Down Expand Up @@ -301,12 +301,12 @@ var RealexRemote = (function() {

/*
* Validate Card Number. Returns true if card number valid. Only allows
* non-empty numeric values between 14 and 23 characters. A Luhn check is
* non-empty numeric values between 12 and 19 characters. A Luhn check is
* also run against the card number.
*/
var validateCardNumber = function(cardNumber) {
// test numeric and length between 14 and 23
if (!/^\d{14,23}$/.test(cardNumber)) {
// test numeric and length between 12 and 19
if (!/^\d{12,19}$/.test(cardNumber)) {
return false;
}

Expand Down
Loading

0 comments on commit 0fbe5aa

Please sign in to comment.