diff --git a/dist/rxp-js.js b/dist/rxp-js.js index 8955ce0..60f1b55 100644 --- a/dist/rxp-js.js +++ b/dist/rxp-js.js @@ -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 @@ -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; } diff --git a/dist/rxp-js.min.js b/dist/rxp-js.min.js index 2e930c5..bd19127 100644 --- a/dist/rxp-js.min.js +++ b/dist/rxp-js.min.js @@ -1,6 +1,6 @@ -/*! 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 */ -var RealexHpp=function(){"use strict";function a(a){var b=document.createElement("a");return b.href=a,b.hostname}var b="https://hpp.realexpayments.com/pay",c=function(a){b=a},d=function(){function a(){function a(){var a=document.createElement("div");a.setAttribute("id","rxp-overlay-"+m),a.style.position="fixed",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.left="0",a.style.transition="all 0.3s ease-in-out",a.style.zIndex="100",document.body.appendChild(a),setTimeout(function(){a.style.background="rgba(0, 0, 0, 0.7)"},1),g=a}function c(){j=document.createElement("img"),j.setAttribute("id","rxp-frame-close-"+m),j.setAttribute("src","data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54b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pSURBVHjafFRdTsJAEF42JaTKn4glGIg++qgX4AAchHAJkiZcwnAQD8AF4NFHCaC2VgWkIQQsfl/jNJUik8Duzs/XmW9mN7Xb7VRc5vP5zWKxaK5Wq8Zmu72FqobfJG0YQ9M0+/l8/qFQKDzGY1JxENd1288vLy1s786KRZXJZCLber1Wn7MZt4PLarVnWdZ9AmQ8Hncc17UvymVdBMB/MgPQm+cFFcuy6/V6lzqDf57ntWGwYdBIVx0TfkBD6I9M35iRJgfIoAVjBLDZbA4CiJ5+9AdQi/EahibqDTkQx6fRSIHcPwA8Uy9A9Gcc47Xv+w2wzhRDYzqdVihLIbsIiCvP1NNOoX/29FQx3vgOgtt4FyRdCgPRarX4+goB9vkyAMh443cOEsIAAcjncuoI4TXWMAmCIGFhCQLAdZ8jym/cRJ+Y5nC5XCYAhINKpZLgSISZgoqh5iiLQrojAFICVwGS7tCfe5DbZzkP56XS4NVxwvTI/vXVVYIDnqmnnX70ZxzjNS8THHooK5hMpxHQIREA+tEfA9djfHR3MHkdx3Hspe9r3B+VzWaj2RESyR2mlCUE4MoGQDdxiwHURq2t94+PO9bMIYyTyDNLwMoM7g8+BfKeYGniyw2MdfSehF3Qmk1IvCc/AgwAaS86Etp38bUAAAAASUVORK5CYII="),j.setAttribute("style","transition: all 0.5s ease-in-out; opacity: 0; float: left; position: absolute; left: 50%; margin-left: 135px; z-index: 99999999; top: 65px;"),setTimeout(function(){j.style.opacity="1"},500),j.addEventListener("click",f,!0),g.appendChild(j)}function d(){k=document.createElement("div"),k.setAttribute("id","rxp-white-bg-"+m),k.style.position="absolute",k.style.width="360px",k.style.height="480px",k.style.backgroundColor="#ffffff",k.style.left="50%",k.style.marginLeft="-180px",k.style.zIndex="101",g.appendChild(k)}function e(){h=document.createElement("img"),h.setAttribute("src","data:image/gif;base64,R0lGODlhHAAcAPYAAP////OQHv338fzw4frfwPjIkPzx4/nVq/jKlfe7dv337/vo0fvn0Pzy5/WrVv38+vjDhva2bfzq1fe/f/vkyve8d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ILiYlCwtHmIcxQU4fjAYMDFjdiApQSGBU5QgGRjOmEFgQCUMKZf8AKLgBAgiZNvkaURkSo8aUI+wAYJDSYcyONloibexIoYQwQS6oEPgxpOGMXPQOPdjCMFESCgcZHdFiYUROQ0dChCgRkRCFOg4cRMCCiIcGAjhCUDgq6AiHDhWyxShAhJACKFweJJHAAgoFQ1dfrAwQlKRMhAwpfnCZMkXEihqCHmAwUIXRkAgRoLiQgsIHABsrVDRl1OPMDQAPZIzAAcAEjRVzOT2gI+XTjREMBF0RUZMThhyyAGyYYGCQhtaoCJVQMjk3ISQafAtHFAgAIfkECQoAAAAsAAAAABwAHAAAB/+AAIKDhIWGh4iGD4mMh1UCjYkNXlWDSQKVgo+Rgkl3HZkCSEmdMwqcgnNOWoI8SDwAD0VFSKgAP05ONgACPLApKUUujAsesABIek46CkmuAjNFp4IPPIuEQ3p2dDgAJBEmhdAuLikDGljDhTY6OjtZM4guAlRYWFSZhmB9cF3Xhxg0aBjw75ABNVYaGcDACEkDA+EaVUmSJJ8gF2AmgDgRBkWkGQwWlJBA5ViSG3PqOHiTIFIDDwtESkhBqAqRKTgoROJRJAUmRlA8MHoggSEjA16yQKiFiEqMGFgSXaETQcsEKoiSYIlRI0YJdYRMuIkgxYcLCSs0gEVyxcq8K1NhhpQwxCDEgEE3WrQggsPHFCpQcGCNlYKIRUNXyrTA4aIHAigArOAYUrDRhgk0yF1YQQBAChwhGqB6IEbJNCMIpggaAOYKKgwXjAJggSAiAANHbBW6kgMsAN+6q7jWTfxQIAA7AAAAAAAAAAAA"),h.setAttribute("id","rxp-loader-"+m),h.style.left="50%",h.style.position="fixed",h.style.background="#FFFFFF",h.style.borderRadius="50%",h.style.width="30px",h.style.marginLeft="-15px",h.style.zIndex="200",h.style.marginLeft="-15px",h.style.top="120px",document.body.appendChild(h),i=document.createElement("iframe"),i.setAttribute("name","rxp-frame-"+m),i.setAttribute("id","rxp-frame-"+m),i.setAttribute("height","85%"),i.setAttribute("frameBorder","0"),i.setAttribute("width","360px"),i.setAttribute("seamless","seamless"),i.style.top="40px",i.style.left="50%",i.style.marginLeft="-180px",i.style.zIndex="10001",i.style.position="absolute",i.style.transition="transform 0.5s ease-in-out",i.style.transform="scale(0.7)",i.style.opacity="0",g.appendChild(i),i.onload=function(){i.style.opacity="1",i.style.transform="scale(1)",h.parentNode&&h.parentNode.removeChild(h),c(),setTimeout(function(){d()},500)};var a=document.createElement("form");a.setAttribute("method","POST"),a.setAttribute("action",b);for(var e in l){var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("name",e),f.setAttribute("value",l[e]),a.appendChild(f)}var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("name","HPP_TEMPLATE_TYPE"),j.setAttribute("value","LIGHTBOX"),a.appendChild(j);var k=document.createElement("a");k.href=window.location.href;var n=k.protocol+"//"+k.host,o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("name","HPP_ORIGIN"),o.setAttribute("value",n),a.appendChild(o),i.contentWindow.document.body?i.contentWindow.document.body.appendChild(a):i.contentWindow.document.appendChild(a),a.submit()}function f(){j.parentNode&&j.parentNode.removeChild(j),i.parentNode&&i.parentNode.removeChild(i),k.parentNode&&k.parentNode.removeChild(k),h.parentNode&&h.parentNode.removeChild(h),g.className="",setTimeout(function(){g.parentNode&&g.parentNode.removeChild(g)},300)}var g,h,i,j,k,l,m=m||Math.random().toString(16).substr(2,8);return{lightbox:function(){a(),e()},close:function(){f()},setToken:function(a){l=a}}}var c;return{getInstance:function(b){return c||(c=a()),c.setToken(b),c}}}(),e=function(c,e,f){function g(c){if(a(c.origin)===a(b)){h.close();var d=c.data,f=document.createElement("form");f.setAttribute("method","POST"),f.setAttribute("action",e);var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("name","hppResponse"),g.setAttribute("value",d),f.appendChild(g),document.body.appendChild(f),f.submit()}}var h=d.getInstance(f);document.getElementById(c).addEventListener?document.getElementById(c).addEventListener("click",h.lightbox,!0):document.getElementById(c).attachEvent("onclick",h.lightbox),window.addEventListener?window.addEventListener("message",g,!1):window.attachEvent("message",g)};return{init:e,setHppUrl:c}}(),RealexRemote=function(){"use strict";var a=function(a){if(!/^\d{14,23}$/.test(a))return!1;for(var b=0,c=0,d=0,e=!1,f=a.length-1;f>=0;f--)c=parseInt(a.substring(f,f+1),10),e?(d=2*c,d>9&&(d-=9)):d=c,b+=d,e=!e;var g=b%10;return 0!==g?!1:!0},b=function(a){return a&&a.trim()&&/^[\u0020-\u007E\u00A0-\u00FF]{1,100}$/.test(a)?!0:!1},c=function(a){return/^\d{3}$/.test(a)?!0:!1},d=function(a){return/^\d{4}$/.test(a)?!0:!1},e=function(a){if(!/^\d{4}$/.test(a))return!1;var b=parseInt(a.substring(0,2),10);parseInt(a.substring(2,4),10);return 1>b||b>12?!1:!0},f=function(a){if(!e(a))return!1;var b=parseInt(a.substring(0,2),10),c=parseInt(a.substring(2,4),10),d=new Date,f=d.getMonth()+1,g=d.getFullYear();return g%100>c?!1:c===g%100&&f>b?!1:!0};return{validateCardNumber:a,validateCardHolderName:b,validateCvn:c,validateAmexCvn:d,validateExpiryDateFormat:e,validateExpiryDateNotInPast:f}}(); \ No newline at end of file +var RealexHpp=function(){"use strict";function a(a){var b=document.createElement("a");return b.href=a,b.hostname}var b="https://hpp.realexpayments.com/pay",c=function(a){b=a},d=function(){function a(){function a(){var a=document.createElement("div");a.setAttribute("id","rxp-overlay-"+m),a.style.position="fixed",a.style.width="100%",a.style.height="100%",a.style.top="0",a.style.left="0",a.style.transition="all 0.3s ease-in-out",a.style.zIndex="100",document.body.appendChild(a),setTimeout(function(){a.style.background="rgba(0, 0, 0, 0.7)"},1),g=a}function c(){j=document.createElement("img"),j.setAttribute("id","rxp-frame-close-"+m),j.setAttribute("src","data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmN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ciI/PlHco5QAAAHpSURBVHjafFRdTsJAEF42JaTKn4glGIg++qgX4AAchHAJkiZcwnAQD8AF4NFHCaC2VgWkIQQsfl/jNJUik8Duzs/XmW9mN7Xb7VRc5vP5zWKxaK5Wq8Zmu72FqobfJG0YQ9M0+/l8/qFQKDzGY1JxENd1288vLy1s786KRZXJZCLber1Wn7MZt4PLarVnWdZ9AmQ8Hncc17UvymVdBMB/MgPQm+cFFcuy6/V6lzqDf57ntWGwYdBIVx0TfkBD6I9M35iRJgfIoAVjBLDZbA4CiJ5+9AdQi/EahibqDTkQx6fRSIHcPwA8Uy9A9Gcc47Xv+w2wzhRDYzqdVihLIbsIiCvP1NNOoX/29FQx3vgOgtt4FyRdCgPRarX4+goB9vkyAMh443cOEsIAAcjncuoI4TXWMAmCIGFhCQLAdZ8jym/cRJ+Y5nC5XCYAhINKpZLgSISZgoqh5iiLQrojAFICVwGS7tCfe5DbZzkP56XS4NVxwvTI/vXVVYIDnqmnnX70ZxzjNS8THHooK5hMpxHQIREA+tEfA9djfHR3MHkdx3Hspe9r3B+VzWaj2RESyR2mlCUE4MoGQDdxiwHURq2t94+PO9bMIYyTyDNLwMoM7g8+BfKeYGniyw2MdfSehF3Qmk1IvCc/AgwAaS86Etp38bUAAAAASUVORK5CYII="),j.setAttribute("style","transition: all 0.5s ease-in-out; opacity: 0; float: left; position: absolute; left: 50%; margin-left: 135px; z-index: 99999999; top: 65px;"),setTimeout(function(){j.style.opacity="1"},500),j.addEventListener("click",f,!0),g.appendChild(j)}function d(){k=document.createElement("div"),k.setAttribute("id","rxp-white-bg-"+m),k.style.position="absolute",k.style.width="360px",k.style.height="480px",k.style.backgroundColor="#ffffff",k.style.left="50%",k.style.marginLeft="-180px",k.style.zIndex="101",g.appendChild(k)}function e(){h=document.createElement("img"),h.setAttribute("src","data:image/gif;base64,R0lGODlhHAAcAPYAAP////OQHv338fzw4frfwPjIkPzx4/nVq/jKlfe7dv337/vo0fvn0Pzy5/WrVv38+vjDhva2bfz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hIMR4c+cU5OaymILiYlCwtHmIcxQU4fjAYMDFjdiApQSGBU5QgGRjOmEFgQCUMKZf8AKLgBAgiZNvkaURkSo8aUI+wAYJDSYcyONloibexIoYQwQS6oEPgxpOGMXPQOPdjCMFESCgcZHdFiYUROQ0dChCgRkRCFOg4cRMCCiIcGAjhCUDgq6AiHDhWyxShAhJACKFweJJHAAgoFQ1dfrAwQlKRMhAwpfnCZMkXEihqCHmAwUIXRkAgRoLiQgsIHABsrVDRl1OPMDQAPZIzAAcAEjRVzOT2gI+XTjREMBF0RUZMThhyyAGyYYGCQhtaoCJVQMjk3ISQafAtHFAgAIfkECQoAAAAsAAAAABwAHAAAB/+AAIKDhIWGh4iGD4mMh1UCjYkNXlWDSQKVgo+Rgkl3HZkCSEmdMwqcgnNOWoI8SDwAD0VFSKgAP05ONgACPLApKUUujAsesABIek46CkmuAjNFp4IPPIuEQ3p2dDgAJBEmhdAuLikDGljDhTY6OjtZM4guAlRYWFSZhmB9cF3Xhxg0aBjw75ABNVYaGcDACEkDA+EaVUmSJJ8gF2AmgDgRBkWkGQwWlJBA5ViSG3PqOHiTIFIDDwtESkhBqAqRKTgoROJRJAUmRlA8MHoggSEjA16yQKiFiEqMGFgSXaETQcsEKoiSYIlRI0YJdYRMuIkgxYcLCSs0gEVyxcq8K1NhhpQwxCDEgEE3WrQggsPHFCpQcGCNlYKIRUNXyrTA4aIHAigArOAYUrDRhgk0yF1YQQBAChwhGqB6IEbJNCMIpggaAOYKKgwXjAJggSAiAANHbBW6kgMsAN+6q7jWTfxQIAA7AAAAAAAAAAAA"),h.setAttribute("id","rxp-loader-"+m),h.style.left="50%",h.style.position="fixed",h.style.background="#FFFFFF",h.style.borderRadius="50%",h.style.width="30px",h.style.marginLeft="-15px",h.style.zIndex="200",h.style.marginLeft="-15px",h.style.top="120px",document.body.appendChild(h),i=document.createElement("iframe"),i.setAttribute("name","rxp-frame-"+m),i.setAttribute("id","rxp-frame-"+m),i.setAttribute("height","85%"),i.setAttribute("frameBorder","0"),i.setAttribute("width","360px"),i.setAttribute("seamless","seamless"),i.style.top="40px",i.style.left="50%",i.style.marginLeft="-180px",i.style.zIndex="10001",i.style.position="absolute",i.style.transition="transform 0.5s ease-in-out",i.style.transform="scale(0.7)",i.style.opacity="0",g.appendChild(i),i.onload=function(){i.style.opacity="1",i.style.transform="scale(1)",h.parentNode&&h.parentNode.removeChild(h),c(),setTimeout(function(){d()},500)};var a=document.createElement("form");a.setAttribute("method","POST"),a.setAttribute("action",b);for(var e in l){var f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("name",e),f.setAttribute("value",l[e]),a.appendChild(f)}var j=document.createElement("input");j.setAttribute("type","hidden"),j.setAttribute("name","HPP_TEMPLATE_TYPE"),j.setAttribute("value","LIGHTBOX"),a.appendChild(j);var k=document.createElement("a");k.href=window.location.href;var n=k.protocol+"//"+k.host,o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("name","HPP_ORIGIN"),o.setAttribute("value",n),a.appendChild(o),i.contentWindow.document.body?i.contentWindow.document.body.appendChild(a):i.contentWindow.document.appendChild(a),a.submit()}function f(){j.parentNode&&j.parentNode.removeChild(j),i.parentNode&&i.parentNode.removeChild(i),k.parentNode&&k.parentNode.removeChild(k),h.parentNode&&h.parentNode.removeChild(h),g.className="",setTimeout(function(){g.parentNode&&g.parentNode.removeChild(g)},300)}var g,h,i,j,k,l,m=m||Math.random().toString(16).substr(2,8);return{lightbox:function(){a(),e()},close:function(){f()},setToken:function(a){l=a}}}var c;return{getInstance:function(b){return c||(c=a()),c.setToken(b),c}}}(),e=function(c,e,f){function g(c){if(a(c.origin)===a(b)){h.close();var d=c.data,f=document.createElement("form");f.setAttribute("method","POST"),f.setAttribute("action",e);var g=document.createElement("input");g.setAttribute("type","hidden"),g.setAttribute("name","hppResponse"),g.setAttribute("value",d),f.appendChild(g),document.body.appendChild(f),f.submit()}}var h=d.getInstance(f);document.getElementById(c).addEventListener?document.getElementById(c).addEventListener("click",h.lightbox,!0):document.getElementById(c).attachEvent("onclick",h.lightbox),window.addEventListener?window.addEventListener("message",g,!1):window.attachEvent("message",g)};return{init:e,setHppUrl:c}}(),RealexRemote=function(){"use strict";var a=function(a){if(!/^\d{12,19}$/.test(a))return!1;for(var b=0,c=0,d=0,e=!1,f=a.length-1;f>=0;f--)c=parseInt(a.substring(f,f+1),10),e?(d=2*c,d>9&&(d-=9)):d=c,b+=d,e=!e;var g=b%10;return 0!==g?!1:!0},b=function(a){return a&&a.trim()&&/^[\u0020-\u007E\u00A0-\u00FF]{1,100}$/.test(a)?!0:!1},c=function(a){return/^\d{3}$/.test(a)?!0:!1},d=function(a){return/^\d{4}$/.test(a)?!0:!1},e=function(a){if(!/^\d{4}$/.test(a))return!1;var b=parseInt(a.substring(0,2),10);parseInt(a.substring(2,4),10);return 1>b||b>12?!1:!0},f=function(a){if(!e(a))return!1;var b=parseInt(a.substring(0,2),10),c=parseInt(a.substring(2,4),10),d=new Date,f=d.getMonth()+1,g=d.getFullYear();return g%100>c?!1:c===g%100&&f>b?!1:!0};return{validateCardNumber:a,validateCardHolderName:b,validateCvn:c,validateAmexCvn:d,validateExpiryDateFormat:e,validateExpiryDateNotInPast:f}}(); \ No newline at end of file diff --git a/lib/rxp-remote.js b/lib/rxp-remote.js index 525932f..8d22551 100644 --- a/lib/rxp-remote.js +++ b/lib/rxp-remote.js @@ -10,12 +10,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; } diff --git a/specs/rxp-remote_spec.js b/specs/rxp-remote_spec.js index a53dd69..98d127a 100644 --- a/specs/rxp-remote_spec.js +++ b/specs/rxp-remote_spec.js @@ -8,15 +8,15 @@ describe( 'rxp-remote library', function () { */ describe( 'card validation (validateCardNumber)', function () { it('valid card', function () { - expect(RealexRemote.validateCardNumber('42424242424242424242')).toBe(true); + expect(RealexRemote.validateCardNumber('424242424242424242')).toBe(true); }); it('non-numeric card', function () { - expect(RealexRemote.validateCardNumber('a2424242424242424242')).toBe(false); + expect(RealexRemote.validateCardNumber('a24242424242424242')).toBe(false); }); it('card with spaces', function () { - expect(RealexRemote.validateCardNumber('4242 4242424242424242')).toBe(false); + expect(RealexRemote.validateCardNumber('4242 424242424242')).toBe(false); }); it('empty card', function () { @@ -31,24 +31,24 @@ describe( 'rxp-remote library', function () { expect(RealexRemote.validateCardNumber(' ')).toBe(false); }); - it('length < 14', function () { - expect(RealexRemote.validateCardNumber('1111111111112')).toBe(false); + it('length < 12', function () { + expect(RealexRemote.validateCardNumber('42424242420')).toBe(false); }); - it('length > 23', function () { - expect(RealexRemote.validateCardNumber('242424242424242424242402')).toBe(false); + it('length > 19', function () { + expect(RealexRemote.validateCardNumber('42424242424242424242')).toBe(false); }); - it('length = 14', function () { - expect(RealexRemote.validateCardNumber('11111111111110')).toBe(true); + it('length = 12', function () { + expect(RealexRemote.validateCardNumber('424242424242')).toBe(true); }); - it('length = 23', function () { - expect(RealexRemote.validateCardNumber('24242424242424242424240')).toBe(true); + it('length = 19', function () { + expect(RealexRemote.validateCardNumber('4242424242424242428')).toBe(true); }); it('luhn check', function () { - expect(RealexRemote.validateCardNumber('42424242424242424241')).toBe(false); + expect(RealexRemote.validateCardNumber('4242424242424242427')).toBe(false); }); });