diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-03-15 22:12:50 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-03-15 22:39:36 (EDT) |
commit | 355d5b64585a99476ea4bff1e48a4b7e7402ea4f (patch) | |
tree | 70423452885a748782dde40f817d1a99d66ee3e9 | |
parent | 6e80eb984c973fb5675a8ad143a68ae9254469fa (diff) | |
download | epirts.js-355d5b64585a99476ea4bff1e48a4b7e7402ea4f.zip epirts.js-355d5b64585a99476ea4bff1e48a4b7e7402ea4f.tar.gz epirts.js-355d5b64585a99476ea4bff1e48a4b7e7402ea4f.tar.bz2 |
Epirts.card.validateCVC(): Implement
-rw-r--r-- | epirts.js | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -84,6 +84,13 @@ var Stripe = Epirts = (function() { }; pub.validateCVC = function(cvc) { + cvc += ''; + if (cvc.match(/\D/)) { + return false; + } else if (cvc.length < 3 || cvc.length > 4) { + return false; + } + return true; }; pub.cardType = function(number) { |