LitleOnline 8.13.1 → 8.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,5 +1,10 @@
1
1
  = LitleOnline CHANGELOG
2
2
 
3
+ == Version 8.13.2 (June 28, 2012)
4
+
5
+ * Feature: Most schema validations are now handled by ruby code and throw errors.
6
+ * Bugfix: Remove hardcoded username/password fields
7
+
3
8
  == Version 8.13.1 (May 22, 2012)
4
9
 
5
10
  * Feature: Echeck Void now supported
data/README.md CHANGED
@@ -18,7 +18,7 @@ See LICENSE file for details on using this software.
18
18
 
19
19
  Source Code available from : https://github.com/LitleCo/litle-sdk-for-ruby
20
20
 
21
- Please contact [Litle & Co.](http://www.litle.com) to receive valid merchant credentials in order to run tests successfully or if you require assistance in any way. We are reachable at MerchantSDKSupport@litle.com
21
+ Please contact [Litle & Co.](http://www.litle.com) to receive valid merchant credentials in order to run tests successfully or if you require assistance in any way. We are reachable at sdksupport@litle.com
22
22
 
23
23
  Setup
24
24
  -----
@@ -39,6 +39,7 @@ For more details on setup see our instructions [here](https://github.com/LitleCo
39
39
 
40
40
  ```ruby
41
41
  require 'LitleOnline'
42
+ include LitleOnline
42
43
 
43
44
  # Visa $10 Sale
44
45
  litleSaleTxn = {
data/Rakefile CHANGED
@@ -34,7 +34,7 @@ spec = Gem::Specification.new do |s|
34
34
  s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
35
35
  s.requirements =
36
36
  [ 'Contact sdksupport@litle.com for more information' ]
37
- s.version = "8.13.1"
37
+ s.version = "8.13.2"
38
38
  s.author = "Litle & Co"
39
39
  s.email = "sdksupport@litle.com"
40
40
  s.homepage = "http://www.litle.com/developers"
data/index.html?grep= ADDED
@@ -0,0 +1,18 @@
1
+ <!doctype html><html itemscope itemtype="http://schema.org/WebPage"><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><meta name="description" content="Search the world&#39;s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you&#39;re looking for."><meta name="robots" content="noodp"><meta itemprop="image" content="/images/google_favicon_128.png"><title>Google</title><script>window.google={kEI:"caDoT43yLcrj0QHFrPmgCg",getEI:function(a){var b;while(a&&!(a.getAttribute&&(b=a.getAttribute("eid"))))a=a.parentNode;return b||google.kEI},https:function(){return window.location.protocol=="https:"},kEXPI:"17259,24472,35702,37607,37864,38252,38816,39366,39370,39410,39423,39537,39730,39737",kCSI:{e:"17259,24472,35702,37607,37864,38252,38816,39366,39370,39410,39423,39537,39730,39737",ei:"caDoT43yLcrj0QHFrPmgCg"},authuser:0,ml:function(){},kHL:"en",time:function(){return(new Date).getTime()},log:function(a,
2
+ b,c,e){var d=new Image,h=google,i=h.lc,f=h.li,j="";d.onerror=(d.onload=(d.onabort=function(){delete i[f]}));i[f]=d;if(!c&&b.search("&ei=")==-1)j="&ei="+google.getEI(e);var g=c||"/gen_204?atyp=i&ct="+a+"&cad="+b+j+"&zx="+google.time();var k=/^http:/i;if(k.test(g)&&google.https()){google.ml(new Error("GLMM"),false,{src:g});delete i[f];return}d.src=g;h.li=f+1},lc:[],li:0,Toolbelt:{},y:{},x:function(a,b){google.y[a.id]=[a,b];return false}};
3
+ window.google.sn="webhp";window.google.timers={};window.google.startTick=function(a,b){window.google.timers[a]={t:{start:(new Date).getTime()},bfr:!(!b)}};window.google.tick=function(a,b,c){if(!window.google.timers[a])google.startTick(a);window.google.timers[a].t[b]=c||(new Date).getTime()};google.startTick("load",true);try{}catch(u){}
4
+ var _gjwl=location;function _gjuc(){var e=_gjwl.href.indexOf("#");if(e>=0){var a=_gjwl.href.substring(e);if(a.indexOf("&q=")>0||a.indexOf("#q=")>=0){a=a.substring(1);if(a.indexOf("#")==-1){for(var c=0;c<a.length;){var d=c;if(a.charAt(d)=="&")++d;var b=a.indexOf("&",d);if(b==-1)b=a.length;var f=a.substring(d,b);if(f.indexOf("fp=")==0){a=a.substring(0,c)+a.substring(b,a.length);b=c}else if(f=="cad=h")return 0;c=b}_gjwl.href="/search?"+a+"&cad=h";return 1}}}return 0}function _gjp(){!(window._gjwl.hash&&
5
+ window._gjuc())&&setTimeout(_gjp,500)};
6
+ window._gjp && _gjp()</script><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}</style><style id=gstyle>body{margin:0;overflow-y:scroll}#gog{padding:3px 8px 0}td{line-height:.8em}.gac_m td{line-height:17px}form{margin-bottom:20px}body,td,a,p,.h{font-family:arial,sans-serif}.h{color:#36c;font-size:20px}.q{color:#00c}.ts td{padding:0}.ts{border-collapse:collapse}em{font-weight:bold;font-style:normal}.lst{height:25px;width:496px}.gsfi,.lst{font:18px arial,sans-serif}.gsfs{font:17px arial,sans-serif}.ds{display:-moz-inline-box;display:inline-block;margin:3px 0 4px;margin-left:4px}input{font-family:inherit}a.gb1,a.gb2,a.gb3,a.gb4{color:#11c !important}body{background:#fff;color:black}a{color:#11c;text-decoration:none}a:hover,a:active{text-decoration:underline}.fl a{color:#36c}a:visited{color:#551a8b}a.gb1,a.gb4{text-decoration:underline}a.gb3:hover{text-decoration:none}#ghead a.gb2:hover{color:#fff!important}.sblc{padding-top:5px}.sblc a{display:block;margin:2px 0;margin-left:13px;font-size:11px;}.lsbb{background:#eee;border:solid 1px;border-color:#ccc #999 #999 #ccc;height:30px;display:block}.ftl,#fll a{display:inline-block;margin:0 12px}.lsb{background:url(/images/srpr/nav_logo80.png) 0 -258px repeat-x;border:none;color:#000;cursor:pointer;height:30px;margin:0;outline:0;font:15px arial,sans-serif;vertical-align:top}.lsb:active{background:#ccc}.lst:focus{outline:none}#addlang a{padding:0 3px}.gac_v div{display:none}.gac_v .gac_v2,.gac_bt{display:block!important}table.gssb_c{z-index:986 }.nbcl{background:url(/images/srpr/nav_logo80.png) no-repeat ;height:px;width:px}</style><script>window.rwt=function(a,f,g,l,m,h,c,n,i){try{if(a===window){a=window.event.srcElement;while(a){if(a.href)break;a=a.parentNode}}var b=encodeURIComponent||escape,d;d=a.getAttribute("href");if(c&&c.substring(0,6)!="&sig2=")c="&sig2="+c;var o=["/url?sa=t","","&cd=",b(m),i?"&authuser="+b(i):"",google.j&&google.j.pf?"&sqi=2":"","&ved=",b(n),"&url=",b(d).replace(/\+/g,"%2B"),"&ei=","caDoT43yLcrj0QHFrPmgCg",h?"&usg="+h:"",c].join("");a.href=o;a.onmousedown=""}catch(p){}return true};
7
+ </script></head><body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 onload="document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();if(document.images)new Image().src='/images/srpr/nav_logo80.png'" ><textarea id=csi style=display:none></textarea><div id=mngb><div id=gbar><nobr><b class=gb1>Search</b> <a class=gb1 href="http://www.google.com/imghp?hl=en&tab=wi">Images</a> <a class=gb1 href="http://video.google.com/?hl=en&tab=wv">Videos</a> <a class=gb1 href="http://maps.google.com/maps?hl=en&tab=wl">Maps</a> <a class=gb1 href="http://news.google.com/nwshp?hl=en&tab=wn">News</a> <a class=gb1 href="http://www.google.com/shopping?hl=en&tab=wf">Shopping</a> <a class=gb1 href="https://mail.google.com/mail/?tab=wm">Gmail</a> <a class=gb1 style="text-decoration:none" href="http://www.google.com/intl/en/options/"><u>More</u> &raquo;</a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe><a href="/url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fgrep%3D%26hl%3Den%26source%3Diglk&usg=AFQjCNH79yl80yOtNV3l-pB6DxUyFBANTA" class=gb4>iGoogle</a> | </span><a href="http://www.google.com/history/optout?hl=en" class=gb4>Web History</a> | <a href="/preferences?hl=en" class=gb4>Settings</a> | <a target=_top id=gb_70 href="https://accounts.google.com/ServiceLogin?hl=en&continue=http://www.google.com/%3Fgrep%3D" class=gb4>Sign in</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div></div><iframe name=wgjf style=display:none></iframe><center><br clear=all id=lgpd><div id=lga><img alt="Google" height=95 id=hplogo src="/intl/en_ALL/images/srpr/logo1w.png" width=275 style="padding:28px 0 14px" onload="window.lol&&lol()"><br><br></div><form action="/search" name=f><table cellpadding=0 cellspacing=0><tr valign=top><td width=25%>&nbsp;</td><td align=center nowrap><input type=hidden name=ie value="ISO-8859-1"><input name=hl type=hidden value=en><input name=source type=hidden value=hp><div class=ds style="height:32px;margin:4px 0"><input autocomplete=off maxlength=2048 name=q class="lst" title="Google Search" value="" size=57 style="color:#000;margin:0;padding:5px 8px 0 6px;vertical-align:top"></div><br style="line-height:0"><span class=ds ><span class=lsbb><input name=btnG type=submit value="Google Search" class=lsb></span></span><span class=ds><span class=lsbb><input name=btnI type=submit class=lsb value="I&#39;m Feeling Lucky" onclick="if(this.form.q.value)this.checked=1;else top.location='/doodles/'"></span></span></td><td nowrap width=25% align=left class="fl sblc"><a href="/advanced_search?hl=en">Advanced search</a><a href="/language_tools?hl=en">Language tools</a></td></tr></table><input type=hidden id=gbv name=gbv value="1"></form><div style="font-size:83%;min-height:3.5em"><br></div><span id=footer><center id=fctr><div style="font-size:10pt"><div id=fll style="margin:19px auto;text-align:center"><a href="/intl/en/ads/">Advertising&nbsp;Programs</a><a href="/services/">Business Solutions</a><a href="https://plus.google.com/116899029375914044550" rel="publisher">+Google</a><a href="/intl/en/about.html">About Google</a></div></div><p style="color:#767676;font-size:8pt">&copy; 2012 - <a href="/intl/en/policies/">Privacy & Terms</a></p></center></span> </center><div id=xjsd></div><div id=xjsi><script>if(google.y)google.y.first=[];google.dlj=function(b){window.setTimeout(function(){var a=document.createElement("script");a.src=b;document.getElementById("xjsd").appendChild(a)},0)};
8
+ (function(){
9
+ var c,d,e=false;function f(a){var b={_sn:a?"FAILURE":"FALLBACK",_pu:c,_fu:d},h=google.ml(new Error("pml"),false,b,true);google.log(0,"",h)}function g(){if(!google.pml)f(true)}function i(a){var b=document.createElement("script");b.src=a;document.getElementById("xjsd").appendChild(b)}function j(){if(!e&&!google.pml){e=true;f();i(d,g)}}google.dljp=
10
+ function(a,b){c=a;google.xjsu=a;d=b;if(!google.xjsi)window.setTimeout(function(){i(c,j)},0)};
11
+ })();
12
+ (function(){google.xjsol=function(a){if(google.sc&&(a=google.sc[a])){for(var b=0;b<a.cb.length;b++)a.cb[b]();a.cb=[];a.lc=!0}};google.xjsl=function(a,b){var c=google.sc[a];c&&(b&&(c.lc?b():c.cb.push(b)),!c.ls&&!c.lc&&(google.dlj(c.u),c.ls=!0))};google.register=google.register||function(a,b){google.y.first.push(function(){google.register(a,b)})};})();
13
+ google.y.first=[];if(!google.xjs){google.dstr=[];google.rein=[];window._=window._||{};window._._DumpException=function(e){throw e};if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=new Date().getTime();}google.xjsuo='/xjs/_/js/s/s,st,anim,bbd,sb_he,hv,pj,tbpr,tbui,spp,rsn,ob,mb,lc,du,ada,lu,pcc,csitl/rt\x3dj/ver\x3dcQPWT20rjmA.en_US./d\x3d1/rs\x3dAItRSTMrrebjXekqCRh-6t6eA1DHRj0V7g';if(google.xjsuop)google.xjsuo=google.xjsuo.replace(/xjs\/_\/js/,google.xjsuop);google.dljp(google.xjsuo,'/xjs/_/js/s/s,st,anim,bbd,sb_he,hv,pj,tbpr,tbui,spp,rsn,ob,mb,lc,du,ada,lu,pcc,csitl/rt\x3dj/ver\x3dVhqBgPa68yo.en_US./d\x3d1/rs\x3dAItRSTNVtd_7RGA-1diChwBGjIknyJlDUQ');google.xjs=1}google.pmc={14:{},263:{},60:{},81:{},10:{"client":"hp","dh":true,"ds":"","fl":true,"host":"google.com","jsonp":true,"msgs":{"lcky":"I\u0026#39;m Feeling Lucky","lml":"Learn more","psrc":"This search was removed from your \u003Ca href=\"/history\"\u003EWeb History\u003C/a\u003E","psrl":"Remove","srch":"Google Search"},"ovr":{"l":1,"ms":1,"p":1},"pq":"","rgen":true,"scd":10,"sce":5,"stok":"GeMuz8exdG27fwjKX7r7Pm-tkTc"},152:{},213:{"pberr":"\u003Cfont color=red\u003EError:\u003C/font\u003E The server could not complete your request. Try again in 30 seconds."},114:{"rvu_report_msg":"Report","rvu_reported_msg":"Reported"},78:{},25:{"g":8,"k":false,"m":{"app":true,"bks":true,"blg":true,"dsc":true,"evn":true,"fin":true,"flm":true,"frm":true,"isch":true,"klg":true,"mbl":true,"nws":true,"plcs":true,"ppl":true,"prc":true,"pts":true,"rcp":true,"shop":true,"vid":true},"t":null},216:{},105:{},22:{"db":false,"m_errors":{"32":"Sorry, no more results to show.","default":"\u003Cfont color=red\u003EError:\u003C/font\u003E The server could not complete your request. Try again in 30 seconds."},"m_tip":"Click for more information","nlpm":"-153px -84px","nlpp":"-153px -70px","utp":false},77:{},254:{},146:{},144:{},121:{},63:{"cnfrm":"Reported","prmpt":"Report"},84:{"tt_kft":true},97:{},24:{},38:{}};google.y.first.push(function(){if(google.med){google.med('init');google.initHistory();google.med('history');}google.History&&google.History.initialize('/?grep\x3d')});if(google.j&&google.j.en&&google.j.xi){window.setTimeout(google.j.xi,0);}</script></div><script>(function(){
14
+ var b,d,e,f;function g(a,c){if(a.removeEventListener){a.removeEventListener("load",c,false);a.removeEventListener("error",c,false)}else{a.detachEvent("onload",c);a.detachEvent("onerror",c)}}function h(a){f=(new Date).getTime();++d;a=a||window.event;var c=a.target||a.srcElement;g(c,h)}var i=document.getElementsByTagName("img");b=i.length;d=0;for(var j=0,k;j<b;++j){k=i[j];if(k.complete||typeof k.src!="string"||!k.src)++d;else if(k.addEventListener){k.addEventListener("load",h,false);k.addEventListener("error",
15
+ h,false)}else{k.attachEvent("onload",h);k.attachEvent("onerror",h)}}e=b-d;function l(){if(!google.timers.load.t)return;google.timers.load.t.ol=(new Date).getTime();google.timers.load.t.iml=f;google.kCSI.imc=d;google.kCSI.imn=b;google.kCSI.imp=e;if(google.stt!==undefined)google.kCSI.stt=google.stt;google.timers.load.t.xjs&&google.report&&google.report(google.timers.load,google.kCSI)}if(window.addEventListener)window.addEventListener("load",
16
+ l,false);else if(window.attachEvent)window.attachEvent("onload",l);google.timers.load.t.prt=(f=(new Date).getTime());
17
+ })();
18
+ </script>
@@ -77,8 +77,8 @@ module LitleOnline
77
77
  request.authorization = authorization
78
78
 
79
79
  authentication = Authentication.new
80
- authentication.user = 'PHXMLTEST'
81
- authentication.password = 'password'
80
+ authentication.user = get_user(hash_in)
81
+ authentication.password = get_password(hash_in)
82
82
  request.authentication = authentication
83
83
 
84
84
  request.merchantId = get_merchant_id(hash_in)
@@ -133,8 +133,8 @@ module LitleOnline
133
133
  request.sale = sale
134
134
 
135
135
  authentication = Authentication.new
136
- authentication.user = 'PHXMLTEST'
137
- authentication.password = 'password'
136
+ authentication.user = get_user(hash_in)
137
+ authentication.password = get_password(hash_in)
138
138
  request.authentication = authentication
139
139
 
140
140
  request.merchantId = get_merchant_id(hash_in)
@@ -165,8 +165,8 @@ module LitleOnline
165
165
  request.authReversal = auth_reversal
166
166
 
167
167
  authentication = Authentication.new
168
- authentication.user = 'PHXMLTEST'
169
- authentication.password = 'password'
168
+ authentication.user = get_user(hash_in)
169
+ authentication.password = get_password(hash_in)
170
170
  request.authentication = authentication
171
171
 
172
172
  request.merchantId = get_merchant_id(hash_in)
@@ -211,8 +211,8 @@ module LitleOnline
211
211
  request.credit = credit
212
212
 
213
213
  authentication = Authentication.new
214
- authentication.user = 'PHXMLTEST'
215
- authentication.password = 'password'
214
+ authentication.user = get_user(hash_in)
215
+ authentication.password = get_password(hash_in)
216
216
  request.authentication = authentication
217
217
 
218
218
  request.merchantId = get_merchant_id(hash_in)
@@ -243,8 +243,8 @@ module LitleOnline
243
243
  request.registerTokenRequest = token_request
244
244
 
245
245
  authentication = Authentication.new
246
- authentication.user = 'PHXMLTEST'
247
- authentication.password = 'password'
246
+ authentication.user = get_user(hash_in)
247
+ authentication.password = get_password(hash_in)
248
248
  request.authentication = authentication
249
249
 
250
250
  request.merchantId = get_merchant_id(hash_in)
@@ -284,8 +284,8 @@ module LitleOnline
284
284
  request.forceCapture = force_capture
285
285
 
286
286
  authentication = Authentication.new
287
- authentication.user = 'PHXMLTEST'
288
- authentication.password = 'password'
287
+ authentication.user = get_user(hash_in)
288
+ authentication.password = get_password(hash_in)
289
289
  request.authentication = authentication
290
290
 
291
291
  request.merchantId = get_merchant_id(hash_in)
@@ -319,8 +319,8 @@ module LitleOnline
319
319
  request.captureTxn = capture
320
320
 
321
321
  authentication = Authentication.new
322
- authentication.user = 'PHXMLTEST'
323
- authentication.password = 'password'
322
+ authentication.user = get_user(hash_in)
323
+ authentication.password = get_password(hash_in)
324
324
  request.authentication = authentication
325
325
 
326
326
  request.merchantId = get_merchant_id(hash_in)
@@ -363,8 +363,8 @@ module LitleOnline
363
363
  request.captureGivenAuth = capture_given_auth
364
364
 
365
365
  authentication = Authentication.new
366
- authentication.user = 'PHXMLTEST'
367
- authentication.password = 'password'
366
+ authentication.user = get_user(hash_in)
367
+ authentication.password = get_password(hash_in)
368
368
  request.authentication = authentication
369
369
 
370
370
  request.merchantId = get_merchant_id(hash_in)
@@ -394,8 +394,8 @@ module LitleOnline
394
394
  request.echeckRedeposit = echeck_redeposit
395
395
 
396
396
  authentication = Authentication.new
397
- authentication.user = 'PHXMLTEST'
398
- authentication.password = 'password'
397
+ authentication.user = get_user(hash_in)
398
+ authentication.password = get_password(hash_in)
399
399
  request.authentication = authentication
400
400
 
401
401
  request.merchantId = get_merchant_id(hash_in)
@@ -432,8 +432,8 @@ module LitleOnline
432
432
  request.echeckSale = echeck_sale
433
433
 
434
434
  authentication = Authentication.new
435
- authentication.user = 'PHXMLTEST'
436
- authentication.password = 'password'
435
+ authentication.user = get_user(hash_in)
436
+ authentication.password = get_password(hash_in)
437
437
  request.authentication = authentication
438
438
 
439
439
  request.merchantId = get_merchant_id(hash_in)
@@ -468,8 +468,8 @@ module LitleOnline
468
468
  request.echeckCredit = echeck_credit
469
469
 
470
470
  authentication = Authentication.new
471
- authentication.user = 'PHXMLTEST'
472
- authentication.password = 'password'
471
+ authentication.user = get_user(hash_in)
472
+ authentication.password = get_password(hash_in)
473
473
  request.authentication = authentication
474
474
 
475
475
  request.merchantId = get_merchant_id(hash_in)
@@ -510,8 +510,8 @@ module LitleOnline
510
510
  request.echeckVerification = echeck_verification
511
511
 
512
512
  authentication = Authentication.new
513
- authentication.user = 'PHXMLTEST'
514
- authentication.password = 'password'
513
+ authentication.user = get_user(hash_in)
514
+ authentication.password = get_password(hash_in)
515
515
  request.authentication = authentication
516
516
 
517
517
  request.merchantId = get_merchant_id(hash_in)
@@ -540,8 +540,8 @@ module LitleOnline
540
540
  request.void = void
541
541
 
542
542
  authentication = Authentication.new
543
- authentication.user = 'PHXMLTEST'
544
- authentication.password = 'password'
543
+ authentication.user = get_user(hash_in)
544
+ authentication.password = get_password(hash_in)
545
545
  request.authentication = authentication
546
546
 
547
547
  request.merchantId = get_merchant_id(hash_in)
@@ -569,8 +569,8 @@ module LitleOnline
569
569
  request.echeckVoid = void
570
570
 
571
571
  authentication = Authentication.new
572
- authentication.user = 'PHXMLTEST'
573
- authentication.password = 'password'
572
+ authentication.user = get_user(hash_in)
573
+ authentication.password = get_password(hash_in)
574
574
  request.authentication = authentication
575
575
 
576
576
  request.merchantId = get_merchant_id(hash_in)
@@ -603,7 +603,7 @@ module LitleOnline
603
603
 
604
604
  def get_merchant_sdk(hash_in)
605
605
  if(!hash_in['merchantSdk'])
606
- return 'Ruby;8.13.1'
606
+ return 'Ruby;8.13.2'
607
607
  else
608
608
  return hash_in['merchantSdk']
609
609
  end
@@ -616,5 +616,21 @@ module LitleOnline
616
616
  return hash_in['reportGroup']
617
617
  end
618
618
  end
619
+
620
+ def get_user(hash_in)
621
+ if (hash_in['user'] == nil)
622
+ return @config_hash['user']
623
+ else
624
+ return hash_in['user']
625
+ end
626
+ end
627
+
628
+ def get_password(hash_in)
629
+ if (hash_in['password'] == nil)
630
+ return @config_hash['password']
631
+ else
632
+ return hash_in['password']
633
+ end
634
+ end
619
635
  end
620
636
  end
data/lib/XMLFields.rb CHANGED
@@ -56,6 +56,84 @@ module LitleOnline
56
56
  text_node :password, "password"
57
57
  end
58
58
 
59
+ class SchemaValidation
60
+
61
+ def self.validate_required(value, required, class_name, field_name)
62
+ if(required)
63
+ if(value.nil?)
64
+ raise "If #{class_name} is specified, it must have a #{field_name}"
65
+ end
66
+ end
67
+ end
68
+
69
+ def self.validate_length(value, required, min, max, class_name, field_name)
70
+ validate_required(value, required, class_name, field_name)
71
+ if(value.nil?)
72
+ return
73
+ end
74
+ if(value.length < min || value.length > max)
75
+ raise "If " + class_name + " " + field_name + " is specified, it must be between " + min.to_s + " and " + max.to_s + " characters long"
76
+ end
77
+ end
78
+
79
+ def self.validate_size(value, required, min, max, class_name, field_name)
80
+ validate_required(value, required, class_name, field_name)
81
+ if(value.nil?)
82
+ return
83
+ end
84
+ if(value.to_i < min || value.to_i > max || !(/\A\-?\d+\Z/ =~ value))
85
+ raise "If " + class_name + " " + field_name + " is specified, it must be between " + min.to_s + " and " + max.to_s
86
+ end
87
+ end
88
+
89
+ def self.validate_country(value, class_name, field_name)
90
+ if(value.nil?)
91
+ return
92
+ end
93
+ list = ["USA","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CW","CY","CZ","DK","DJ","DM","DO","TL","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","MS","MA","MZ","MM","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","KN","LC","MF","VC","WS","SM","ST","SA","SN","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","ES","LK","SH","PM","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VA","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","RS","ME"]
94
+ if(!list.include? value)
95
+ raise "If " + class_name + " " + field_name + " is specified, it must be valid. You specified " + value
96
+ end
97
+ end
98
+
99
+ def self.validate_regex(value, required, regex, class_name, field_name)
100
+ validate_required(value, required, class_name, field_name)
101
+ if(value.nil?)
102
+ return
103
+ end
104
+ if(!(regex =~ value))
105
+ raise "If #{class_name} #{field_name} is specified, it must match the regular expression #{regex.inspect}"
106
+ end
107
+ end
108
+
109
+ def self.validate_enum(value, required, list, class_name, field_name)
110
+ validate_required(value, required, class_name, field_name)
111
+ if(value.nil?)
112
+ return
113
+ end
114
+ if(!list.include?(value))
115
+ raise "If #{class_name} #{field_name} is specified, it must be in #{list.to_s}"
116
+ end
117
+ end
118
+
119
+ def self.validate_long(value, required, class_name, field_name)
120
+ validate_size(value, required, -9223372036854775808, 9223372036854775807, class_name, field_name)
121
+ end
122
+
123
+ def self.validate_currency(value, required, class_name, field_name)
124
+ validate_enum(value, required, ['AUD','CAD','CHF','DKK','EUR','GBP','HKD','JPY','NOK','NZD','SEK','SGD','USD'], class_name, field_name)
125
+ end
126
+
127
+ def self.validate_boolean(value, required, class_name, field_name)
128
+ validate_enum(value, required, ['true','false','1','0'], class_name, field_name)
129
+ end
130
+
131
+ def self.validate_date(value, required, class_name, field_name)
132
+ validate_regex(value, required, /\A\d{4}-\d{2}-\d{2}\Z/, class_name, field_name)
133
+ end
134
+
135
+ end
136
+
59
137
  class Contact
60
138
  include XML::Mapping
61
139
  text_node :name, "name", :default_value=>nil
@@ -90,6 +168,21 @@ module LitleOnline
90
168
  this.country = base['country']
91
169
  this.email = base['email']
92
170
  this.phone = base['phone']
171
+ SchemaValidation.validate_length(this.name, false, 1, 100, name, "name")
172
+ SchemaValidation.validate_length(this.firstName, false, 1, 25, name, "firstName")
173
+ SchemaValidation.validate_length(this.middleInitial, false, 1, 1, name, "middleInitial")
174
+ SchemaValidation.validate_length(this.lastName, false, 1, 25, name, "lastName")
175
+ SchemaValidation.validate_length(this.companyName, false, 1, 40, name, "companyName")
176
+ SchemaValidation.validate_length(this.addressLine1, false, 1, 35, name, "addressLine1")
177
+ SchemaValidation.validate_length(this.addressLine2, false, 1, 35, name, "addressLine2")
178
+ SchemaValidation.validate_length(this.addressLine3, false, 1, 35, name, "addressLine3")
179
+ SchemaValidation.validate_length(this.city, false, 1, 35, name, "city")
180
+ SchemaValidation.validate_length(this.state, false, 1, 30, name, "state")
181
+ SchemaValidation.validate_length(this.zip, false, 1, 20, name, "zip")
182
+ SchemaValidation.validate_length(this.country, false, 1, 3, name, "country")
183
+ SchemaValidation.validate_country(this.country, name, "country")
184
+ SchemaValidation.validate_length(this.email, false, 1, 100, name, "email")
185
+ SchemaValidation.validate_length(this.phone, false, 1, 20, name, "phone")
93
186
  this
94
187
  else
95
188
  nil
@@ -107,6 +200,7 @@ module LitleOnline
107
200
  text_node :incomeCurrency, "incomeCurrency", :default_value=>nil
108
201
  text_node :customerCheckingAccount, "customerCheckingAccount", :default_value=>nil
109
202
  text_node :customerSavingAccount, "customerSavingAccount", :default_value=>nil
203
+ text_node :employerName, "employerName", :default_value=>nil
110
204
  text_node :customerWorkTelephone, "customerWorkTelephone", :default_value=>nil
111
205
  text_node :residenceStatus, "residenceStatus", :default_value=>nil
112
206
  text_node :yearsAtResidence, "yearsAtResidence", :default_value=>nil
@@ -123,10 +217,24 @@ module LitleOnline
123
217
  this.incomeCurrency = base['incomeCurrency']
124
218
  this.customerCheckingAccount = base['customerCheckingAccount']
125
219
  this.customerSavingAccount = base['customerSavingAccount']
220
+ this.employerName = base['employerName']
126
221
  this.customerWorkTelephone = base['customerWorkTelephone']
127
222
  this.residenceStatus = base['residenceStatus']
128
223
  this.yearsAtResidence = base['yearsAtResidence']
129
224
  this.yearsAtEmployer = base['yearsAtEmployer']
225
+ SchemaValidation.validate_regex(this.ssn, false, /\A\d{9}\Z/, name, 'ssn')
226
+ SchemaValidation.validate_date(this.dob, false, name, 'dob')
227
+ SchemaValidation.validate_regex(this.customerRegistrationDate, false, /\A\d{4}-\d{2}-\d{2}/, name, 'customerRegistrationDate')
228
+ SchemaValidation.validate_enum(this.customerType, false, ['New','Existing'], name, 'customerType')
229
+ SchemaValidation.validate_long(this.incomeAmount, false, name, 'incomeAmount')
230
+ SchemaValidation.validate_currency(this.incomeCurrency, false, name, 'incomeCurrency')
231
+ SchemaValidation.validate_boolean(this.customerCheckingAccount, false, name, 'customerCheckingAccount')
232
+ SchemaValidation.validate_boolean(this.customerSavingAccount, false, name, 'customerSavingAccount')
233
+ SchemaValidation.validate_length(this.employerName, false, 1, 20, name, "employerName")
234
+ SchemaValidation.validate_length(this.customerWorkTelephone, false, 1, 20, name, "customerWorkTelephone")
235
+ SchemaValidation.validate_enum(this.residenceStatus, false, ['Own','Rent','Other'], name, 'residenceStatus')
236
+ SchemaValidation.validate_size(this.yearsAtResidence, false, 0, 99, name, 'yearsAtResidence')
237
+ SchemaValidation.validate_size(this.yearsAtEmployer, false, 0, 99, name, 'yearsAtEmployer')
130
238
  this
131
239
  else
132
240
  nil
@@ -137,10 +245,12 @@ module LitleOnline
137
245
  class BillMeLaterRequest
138
246
  include XML::Mapping
139
247
  text_node :bmlMerchantId, "bmlMerchantId", :default_value=>nil
248
+ text_node :bmlProductType, "bmlProductType", :default_value=>nil
140
249
  text_node :termsAndConditions, "termsAndConditions", :default_value=>nil
141
250
  text_node :preapprovalNumber, "preapprovalNumber", :default_value=>nil
142
251
  text_node :merchantPromotionalCode, "merchantPromotionalCode", :default_value=>nil
143
252
  text_node :customerPasswordChanged, "customerPasswordChanged", :default_value=>nil
253
+ text_node :customerBillingAddressChanged, "customerBillingAddressChanged", :default_value=>nil
144
254
  text_node :customerEmailChanged, "customerEmailChanged", :default_value=>nil
145
255
  text_node :customerPhoneChanged, "customerPhoneChanged", :default_value=>nil
146
256
  text_node :secretQuestionCode, "secretQuestionCode", :default_value=>nil
@@ -154,9 +264,12 @@ module LitleOnline
154
264
  if(base)
155
265
  this = BillMeLaterRequest.new
156
266
  this.bmlMerchantId = base['bmlMerchantId']
267
+ this.bmlProductType = base['bmlProductType']
157
268
  this.termsAndConditions = base['termsAndConditions']
269
+ this.preapprovalNumber = base['preapprovalNumber']
158
270
  this.merchantPromotionalCode = base['merchantPromotionalCode']
159
271
  this.customerPasswordChanged = base['customerPasswordChanged']
272
+ this.customerBillingAddressChanged = base['customerBillingAddressChanged']
160
273
  this.customerEmailChanged = base['customerEmailChanged']
161
274
  this.customerPhoneChanged = base['customerPhoneChanged']
162
275
  this.secretQuestionCode = base['secretQuestionCode']
@@ -165,6 +278,20 @@ module LitleOnline
165
278
  this.virtualAuthenticationKeyData = base['virtualAuthenticationKeyData']
166
279
  this.itemCategoryCode = base['itemCategoryCode']
167
280
  this.authorizationSourcePlatform = base['authorizationSourcePlatform']
281
+ SchemaValidation.validate_long(this.bmlMerchantId, false, name, 'bmlMerchantId')
282
+ SchemaValidation.validate_length(this.bmlProductType, false, 1, 2, name, "bmlProductType")
283
+ SchemaValidation.validate_size(this.termsAndConditions, false, -99999, 99999, name, 'termsAndConditions')
284
+ SchemaValidation.validate_length(this.preapprovalNumber, false, 13, 25, name, "preapprovalNumber")
285
+ SchemaValidation.validate_size(this.merchantPromotionalCode, false, -9999, 9999, name, 'merchantPromotionalCode')
286
+ SchemaValidation.validate_boolean(this.customerPasswordChanged, false, name, 'customerPasswordChanged')
287
+ SchemaValidation.validate_boolean(this.customerBillingAddressChanged, false, name, 'customerBillingAddressChanged')
288
+ SchemaValidation.validate_boolean(this.customerEmailChanged, false, name, 'customerEmailChanged')
289
+ SchemaValidation.validate_boolean(this.customerPhoneChanged, false, name, 'customerPhoneChanged')
290
+ SchemaValidation.validate_length(this.secretQuestionCode, false, 1, 2, name, "secretQuestionCode")
291
+ SchemaValidation.validate_length(this.secretQuestionAnswer, false, 1, 25, name, "secretQuestionAnswer")
292
+ SchemaValidation.validate_length(this.virtualAuthenticationKeyPresenceIndicator, false, 1, 1, name, "virtualAuthenticationKeyPresenceIndicator")
293
+ SchemaValidation.validate_length(this.virtualAuthenticationKeyData, false, 1, 4, name, "virtualAuthenticationKeyData")
294
+ SchemaValidation.validate_size(this.itemCategoryCode, false, -9999, 9999, name, 'itemCategoryCode')
168
295
  this
169
296
  else
170
297
  nil
@@ -186,6 +313,10 @@ module LitleOnline
186
313
  this.authenticationTransactionId = base['authenticationTransactionId']
187
314
  this.customerIpAddress = base['customerIpAddress']
188
315
  this.authenticatedByMerchant = base['authenticatedByMerchant']
316
+ SchemaValidation.validate_length(this.authenticationValue, false, 1, 32, name, "authenticationValue")
317
+ SchemaValidation.validate_length(this.authenticationTransactionId, false, 1, 28, name, "authenticationTransactionId")
318
+ SchemaValidation.validate_regex(this.customerIpAddress, false, /\A(\d{1,3}.){3}\d{1,3}\Z/, name, 'customerIpAddress')
319
+ SchemaValidation.validate_boolean(this.authenticatedByMerchant, false, name, 'authenticatedByMerchant')
189
320
  this
190
321
  else
191
322
  nil
@@ -207,6 +338,9 @@ module LitleOnline
207
338
  this.cardValidationResult = base['cardValidationResult']
208
339
  this.authenticationResult = base['authenticationResult']
209
340
  this.advancedAVSResult = base['advancedAVSResult']
341
+ SchemaValidation.validate_length(this.avsResult, false, 1, 2, name, "avsResult")
342
+ SchemaValidation.validate_length(this.authenticationResult, false, 1, 1, name, "authenticationResult")
343
+ SchemaValidation.validate_length(this.advancedAVSResult, false, 1, 3, name, "advancedAVSResult")
210
344
  this
211
345
  else
212
346
  nil
@@ -228,6 +362,9 @@ module LitleOnline
228
362
  this.authCode = base['authCode']
229
363
  this.fraudResult = FraudResult.from_hash(base)
230
364
  this.authAmount = base['authAmount']
365
+ SchemaValidation.validate_date(this.authDate, false, name, 'authDate')
366
+ SchemaValidation.validate_length(this.authCode, false, 1, 6, name, "authCode")
367
+ SchemaValidation.validate_size(this.authAmount, false, -999999999999, 999999999999, name, 'authAmount')
231
368
  this
232
369
  else
233
370
  nil
@@ -251,6 +388,11 @@ module LitleOnline
251
388
  this.visionAmount = base['visionAmount']
252
389
  this.clinicOtherAmount = base['clinicOtherAmount']
253
390
  this.dentalAmount = base['dentalAmount']
391
+ SchemaValidation.validate_size(this.totalHealthcareAmount, true, -999999999999, 999999999999, name, 'totalHealthcareAmount')
392
+ SchemaValidation.validate_size(this.rxAmount, false, -999999999999, 999999999999, name, 'RxAmount')
393
+ SchemaValidation.validate_size(this.visionAmount, false, -999999999999, 999999999999, name, 'visionAmount')
394
+ SchemaValidation.validate_size(this.clinicOtherAmount, false, -999999999999, 999999999999, name, 'clinicOtherAmount')
395
+ SchemaValidation.validate_size(this.dentalAmount, false, -999999999999, 999999999999, name, 'dentalAmount')
254
396
  this
255
397
  else
256
398
  nil
@@ -268,6 +410,7 @@ module LitleOnline
268
410
  this = HealthcareIIAS.new
269
411
  this.healthcareAmounts = HealthcareAmounts.from_hash(base)
270
412
  this.iiasFlag = base['IIASFlag']
413
+ SchemaValidation.validate_enum(this.iiasFlag, true, ['Y'], name, 'IIASFlag')
271
414
  this
272
415
  else
273
416
  nil
@@ -287,6 +430,9 @@ module LitleOnline
287
430
  this.capability = base['capability']
288
431
  this.entryMode = base['entryMode']
289
432
  this.cardholderId = base['cardholderId']
433
+ SchemaValidation.validate_enum(this.capability, true, ['notused','magstripe','keyedonly'], name, 'capability')
434
+ SchemaValidation.validate_enum(this.entryMode, true, ['notused','keyed','track1','track2','completeread'], name, 'entryMode')
435
+ SchemaValidation.validate_enum(this.cardholderId, true, ['signature','pin','nopin','directmarket'], name, 'cardholderId')
290
436
  this
291
437
  else
292
438
  nil
@@ -310,6 +456,11 @@ module LitleOnline
310
456
  this.taxRate = base['taxRate']
311
457
  this.taxTypeIdentifier = base['taxTypeIdentifier']
312
458
  this.cardAcceptorTaxId = base['cardAcceptorTaxId']
459
+ SchemaValidation.validate_boolean(this.taxIncludedInTotal, false, name, 'taxIncludedInTotal')
460
+ SchemaValidation.validate_size(this.taxAmount, true, -999999999999, 999999999999, name, 'taxAmount')
461
+ SchemaValidation.validate_regex(this.taxRate, false, /\A(\+|\-)?\d*\.?\d*\Z/, name, 'taxRate')
462
+ SchemaValidation.validate_enum(this.taxTypeIdentifier, false, ['00','01','02','03','04','05','06','10','11','12','13','14','20','21','22'], name, 'taxTypeIdentifier')
463
+ SchemaValidation.validate_length(this.cardAcceptorTaxId, false, 1, 20, name, 'cardAcceptorTaxId')
313
464
  this
314
465
  else
315
466
  nil
@@ -349,6 +500,17 @@ module LitleOnline
349
500
  if(base['detailTax'])
350
501
  base['detailTax'].each_index {|index| this.detailTax << DetailTax.from_hash(base,index)}
351
502
  end
503
+ SchemaValidation.validate_size(this.itemSequenceNumber, false, 1, 99, name, 'itemSequenceNumber')
504
+ SchemaValidation.validate_length(this.itemDescription, true, 1, 26, name, 'itemDescription')
505
+ SchemaValidation.validate_length(this.productCode, false, 1, 12, name, 'productCode')
506
+ SchemaValidation.validate_regex(this.quantity, false, /\A(\+|\-)?\d*\.?\d*\Z/, name, 'quantity')
507
+ SchemaValidation.validate_length(this.unitOfMeasure, false, 1, 12, name, 'unitOfMeasure')
508
+ SchemaValidation.validate_size(this.taxAmount, false, -999999999999, 999999999999, name, 'taxAmount')
509
+ SchemaValidation.validate_size(this.lineItemTotal, false, -999999999999, 999999999999, name, 'lineItemTotal')
510
+ SchemaValidation.validate_size(this.lineItemTotalWithTax, false, -999999999999, 999999999999, name, 'lineItemTotalWithTax')
511
+ SchemaValidation.validate_size(this.itemDiscountAmount, false, -999999999999, 999999999999, name, 'itemDiscountAmount')
512
+ SchemaValidation.validate_length(this.commodityCode, false, 1, 12, name, 'commodityCode')
513
+ SchemaValidation.validate_regex(this.unitCost, false, /\A(\+|\-)?\d*\.?\d*\Z/, name, 'unitCost')
352
514
  this
353
515
  else
354
516
  nil
@@ -394,6 +556,18 @@ module LitleOnline
394
556
  if(base['lineItemData'])
395
557
  base['lineItemData'].each_index {|index| this.lineItemData << LineItemData.from_hash(base,index)}
396
558
  end
559
+ SchemaValidation.validate_length(this.customerReference, false, 1, 17, name, 'customerReference')
560
+ SchemaValidation.validate_size(this.salesTax, false, -999999999999, 999999999999, name, 'salesTax')
561
+ SchemaValidation.validate_enum(this.deliveryType, false, ['CNC','DIG','PHY','SVC','TBD'], name, 'deliveryType')
562
+ SchemaValidation.validate_boolean(this.taxExempt, false, name, 'taxExempt')
563
+ SchemaValidation.validate_size(this.discountAmount, false, -999999999999, 999999999999, name, 'discountAmount')
564
+ SchemaValidation.validate_size(this.shippingAmount, false, -999999999999, 999999999999, name, 'shippingAmount')
565
+ SchemaValidation.validate_size(this.dutyAmount, false, -999999999999, 999999999999, name, 'dutyAmount')
566
+ SchemaValidation.validate_length(this.shipFromPostalCode, false, 1, 20, name, 'shipFromPostalCode')
567
+ SchemaValidation.validate_length(this.destinationPostalCode, false, 1, 20, name, 'destinationPostalCode')
568
+ SchemaValidation.validate_country(this.destinationCountryCode, name, 'destinationCountryCode')
569
+ SchemaValidation.validate_length(this.invoiceReferenceNumber, false, 1, 15, name, 'invoiceReferenceNumber')
570
+ SchemaValidation.validate_date(this.orderDate, false, name, 'orderDate')
397
571
  this
398
572
  else
399
573
  nil
@@ -411,6 +585,8 @@ module LitleOnline
411
585
  this = AmexAggregatorData.new
412
586
  this.sellerId = base['sellerId']
413
587
  this.sellerMerchantCategoryCode = base['sellerMerchantCategoryCode']
588
+ SchemaValidation.validate_length(this.sellerId, false, 1, 16, name, 'sellerId')
589
+ SchemaValidation.validate_length(this.sellerMerchantCategoryCode, false, 1, 4, name, 'sellerMerchantCategoryCode')
414
590
  this
415
591
  else
416
592
  nil
@@ -435,6 +611,11 @@ module LitleOnline
435
611
  this.number = base['number']
436
612
  this.expDate = base['expDate']
437
613
  this.cardValidationNum = base['cardValidationNum']
614
+ SchemaValidation.validate_enum(this.mop, false, ['','MC','VI','AX','DC','DI','PP','JC','BL','EC'], name, 'type')
615
+ SchemaValidation.validate_length(this.track, false, 1, 256, name, 'track')
616
+ SchemaValidation.validate_length(this.number, false, 13, 25, name, 'number')
617
+ SchemaValidation.validate_length(this.expDate, false, 4, 4, name, 'expDate')
618
+ SchemaValidation.validate_length(this.cardValidationNum, false, 1, 4, name, 'cardValidationNum')
438
619
  this
439
620
  else
440
621
  nil
@@ -456,6 +637,10 @@ module LitleOnline
456
637
  this.expDate = base['expDate']
457
638
  this.cardValidationNum = base['cardValidationNum']
458
639
  this.mop = base['type']
640
+ SchemaValidation.validate_length(this.litleToken, true, 13, 25, name, 'litleToken')
641
+ SchemaValidation.validate_length(this.expDate, false, 4, 4, name, 'expDate')
642
+ SchemaValidation.validate_length(this.cardValidationNum, false, 1, 4, name, 'cardValidationNum')
643
+ SchemaValidation.validate_enum(this.mop, false, ['','MC','VI','AX','DC','DI','PP','JC','BL','EC'], name, 'type')
459
644
  this
460
645
  else
461
646
  nil
@@ -477,6 +662,10 @@ module LitleOnline
477
662
  this.expDate = base['expDate']
478
663
  this.cardValidationNum = base['cardValidationNum']
479
664
  this.mop = base['type']
665
+ SchemaValidation.validate_length(this.paypageRegistrationId, true, 1, 512, name, 'paypageRegistrationId')
666
+ SchemaValidation.validate_length(this.expDate, false, 4, 4, name, 'expDate')
667
+ SchemaValidation.validate_length(this.cardValidationNum, false, 1, 4, name, 'cardValidationNum')
668
+ SchemaValidation.validate_enum(this.mop, false, ['','MC','VI','AX','DC','DI','PP','JC','BL','EC'], name, 'type')
480
669
  this
481
670
  else
482
671
  nil
@@ -496,6 +685,8 @@ module LitleOnline
496
685
  this.payerId = base['payerId']
497
686
  this.token = base['token']
498
687
  this.transactionId = base['transactionId']
688
+ SchemaValidation.validate_required(this.payerId, true, name, 'payerId')
689
+ SchemaValidation.validate_required(this.transactionId, true, name, 'transactionId')
499
690
  this
500
691
  else
501
692
  nil
@@ -513,6 +704,8 @@ module LitleOnline
513
704
  this = CreditPayPal.new
514
705
  this.payerId = base['payerId']
515
706
  this.payerEmail = base['payerEmail']
707
+ SchemaValidation.validate_length(this.payerId, false, 1, 17, name, 'payerId')
708
+ SchemaValidation.validate_length(this.payerEmail, false, 1, 127, name, 'payerEmail')
516
709
  this
517
710
  else
518
711
  nil
@@ -534,25 +727,10 @@ module LitleOnline
534
727
  this.city = base['city']
535
728
  this.url = base['url']
536
729
  this.descriptor = base['descriptor']
537
- this
538
- else
539
- nil
540
- end
541
- end
542
- end
543
-
544
- class TaxBilling
545
- include XML::Mapping
546
- text_node :taxAuthority, "taxAuthority", :default_value=>nil
547
- text_node :state, "state", :default_value=>nil
548
- text_node :govtTxnType, "govtTxnType", :default_value=>nil
549
- def self.from_hash(hash, name='taxBilling')
550
- base = hash[name]
551
- if(base)
552
- this = TaxBilling.new
553
- this.taxAuthority = base['taxAuthority']
554
- this.state = base['state']
555
- this.govtTxnType = base['govtTxnType']
730
+ SchemaValidation.validate_regex(this.phone, false, /\A\d{1,13}\Z/, name, 'phone')
731
+ SchemaValidation.validate_length(this.city, false, 1, 35, name, 'city')
732
+ SchemaValidation.validate_regex(this.url, false, /\A([A-Z,a-z,0-9,\/,\-,_,.]){1,13}\Z/, name, 'url')
733
+ SchemaValidation.validate_regex(this.descriptor, false, /\A([A-Z,a-z,0-9, ,\*,,,\-,',#,&,.]){4,25}\Z/, name, 'descriptor')
556
734
  this
557
735
  else
558
736
  nil
@@ -568,6 +746,7 @@ module LitleOnline
568
746
  if(base)
569
747
  this = ProcessingInstructions.new
570
748
  this.bypassVelocityCheck = base['bypassVelocityCheck']
749
+ SchemaValidation.validate_boolean(this.bypassVelocityCheck, false, name, 'bypassVelocityCheck')
571
750
  this
572
751
  else
573
752
  nil
@@ -585,6 +764,8 @@ module LitleOnline
585
764
  this = EcheckForToken.new
586
765
  this.accNum = base['accNum']
587
766
  this.routingNum = base['routingNum']
767
+ SchemaValidation.validate_length(this.accNum, true, 1, 17, name, 'accNum')
768
+ SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
588
769
  this
589
770
  else
590
771
  nil
@@ -604,6 +785,9 @@ module LitleOnline
604
785
  this.prepaid = base['prepaid']
605
786
  this.international = base['international']
606
787
  this.chargeback = base['chargeback']
788
+ SchemaValidation.validate_boolean(this.prepaid, false, name, 'prepaid')
789
+ SchemaValidation.validate_boolean(this.international, false, name, 'international')
790
+ SchemaValidation.validate_boolean(this.chargeback, false, name, 'chargeback')
607
791
  this
608
792
  else
609
793
  nil
@@ -623,6 +807,9 @@ module LitleOnline
623
807
  this.campaign = base['campaign']
624
808
  this.affiliate = base['affiliate']
625
809
  this.merchantGroupingId = base['merchantGroupingId']
810
+ SchemaValidation.validate_length(this.campaign, false, 1, 25, name, 'campaign')
811
+ SchemaValidation.validate_length(this.affiliate, false, 1, 25, name, 'affiliate')
812
+ SchemaValidation.validate_length(this.merchantGroupingId, false, 1, 25, name, 'merchantGroupingId')
626
813
  this
627
814
  else
628
815
  nil
@@ -644,6 +831,10 @@ module LitleOnline
644
831
  this.accNum = base['accNum']
645
832
  this.routingNum = base['routingNum']
646
833
  this.checkNum = base['checkNum']
834
+ SchemaValidation.validate_enum(this.accType, true, ['Checking','Savings','Corporate','Corp Savings'], name, 'accType')
835
+ SchemaValidation.validate_length(this.accNum, true, 1, 17, name, 'accNum')
836
+ SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
837
+ SchemaValidation.validate_length(this.checkNum, false, 1, 15, name, 'checkNum')
647
838
  this
648
839
  else
649
840
  nil
@@ -665,6 +856,10 @@ module LitleOnline
665
856
  this.routingNum = base['routingNum']
666
857
  this.accType = base['accType']
667
858
  this.checkNum = base['checkNum']
859
+ SchemaValidation.validate_length(this.litleToken, true, 13, 25, name, 'litleToken')
860
+ SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
861
+ SchemaValidation.validate_enum(this.accType, true, ['Checking','Savings','Corporate','Corp Savings'], name, 'accType')
862
+ SchemaValidation.validate_length(this.checkNum, false, 1, 15, name, 'checkNum')
668
863
  this
669
864
  else
670
865
  nil
@@ -674,12 +869,16 @@ module LitleOnline
674
869
 
675
870
  class RecyclingRequest
676
871
  include XML::Mapping
677
- text_node :recyleBy, "recyleBy", :default_value=>nil
872
+ text_node :recycleBy, "recycleBy", :default_value=>nil
873
+ text_node :recycleId, "recycleId", :default_value=>nil
678
874
  def self.from_hash(hash, name='recyclingRequest')
679
875
  base = hash[name]
680
876
  if(base)
681
877
  this = RecyclingRequest.new
682
- this.recyleBy = base['recyleBy']
878
+ this.recycleBy = base['recycleBy']
879
+ this.recycleId = base['recycleId']
880
+ SchemaValidation.validate_enum(this.recycleBy, false, ['Merchant','Litle','None'], name, 'recycleBy')
881
+ SchemaValidation.validate_length(this.recycleId, false, 1, 25, name, 'recycleId')
683
882
  this
684
883
  else
685
884
  nil