LitleOnline 10.1.1 → 11.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +13 -6
  3. data/DESCRIPTION +2 -2
  4. data/LICENSE +1 -1
  5. data/README.md +8 -8
  6. data/Rakefile +6 -7
  7. data/SETUP.md +4 -4
  8. data/bin/Setup.rb +4 -4
  9. data/bin/sample_batch_driver.rb +1 -1
  10. data/bin/sample_driver.rb +1 -1
  11. data/lib/Communications.rb +5 -5
  12. data/lib/Configuration.rb +1 -1
  13. data/lib/LitleBatchRequest.rb +39 -1
  14. data/lib/LitleListeners.rb +2 -2
  15. data/lib/LitleOnline.rb +1 -1
  16. data/lib/LitleOnlineRequest.rb +22 -3
  17. data/lib/LitleRequest.rb +4 -4
  18. data/lib/LitleTransaction.rb +156 -47
  19. data/lib/LitleXmlMapper.rb +8 -1
  20. data/lib/XMLFields.rb +252 -51
  21. data/temp.xml +21 -0
  22. data/test/certification/certTest1_base.rb +52 -52
  23. data/test/certification/certTest2_authenhanced.rb +20 -20
  24. data/test/certification/certTest3_authreversal.rb +16 -16
  25. data/test/certification/certTest4_echeck.rb +18 -12
  26. data/test/certification/certTest5_token.rb +3 -3
  27. data/test/certification/certTest_batchAll.rb +9 -1
  28. data/test/certification/ts_all.rb +1 -1
  29. data/test/functional/test_activate.rb +34 -5
  30. data/test/functional/test_activateReversal.rb +23 -7
  31. data/test/functional/test_auth.rb +126 -17
  32. data/test/functional/test_authReversal.rb +5 -3
  33. data/test/functional/test_balanceInquiry.rb +30 -5
  34. data/test/functional/test_batch.rb +1 -1
  35. data/test/functional/test_batchStream.rb +1 -1
  36. data/test/functional/test_cancelSubscription.rb +5 -3
  37. data/test/functional/test_capture.rb +37 -2
  38. data/test/functional/test_captureGivenAuth.rb +54 -3
  39. data/test/functional/test_configuration.rb +1 -1
  40. data/test/functional/test_createPlan.rb +5 -3
  41. data/test/functional/test_credit.rb +17 -1
  42. data/test/functional/test_deactivate.rb +28 -5
  43. data/test/functional/test_deactivateReversal.rb +21 -7
  44. data/test/functional/test_depositReversal.rb +30 -18
  45. data/test/functional/test_echeckCredit.rb +29 -5
  46. data/test/functional/test_echeckRedeposit.rb +28 -3
  47. data/test/functional/test_echeckSale.rb +43 -7
  48. data/test/functional/test_echeckVerification.rb +34 -8
  49. data/test/functional/test_echeckVoid.rb +2 -2
  50. data/test/functional/test_forceCapture.rb +36 -8
  51. data/test/functional/test_fraudCheck.rb +12 -14
  52. data/test/functional/test_giftCardAuthReversal.rb +72 -0
  53. data/test/functional/test_giftCardCapture.rb +72 -0
  54. data/test/functional/test_giftCardCredit.rb +69 -0
  55. data/test/functional/test_litle_requests.rb +1 -1
  56. data/test/functional/test_load.rb +29 -5
  57. data/test/functional/test_loadReversal.rb +21 -7
  58. data/test/functional/test_override.rb +4 -3
  59. data/test/functional/test_queryTransaction.rb +24 -18
  60. data/test/functional/test_refundReversal.rb +21 -7
  61. data/test/functional/test_sale.rb +86 -9
  62. data/test/functional/test_token.rb +26 -11
  63. data/test/functional/test_unload.rb +29 -5
  64. data/test/functional/test_unloadReversal.rb +21 -7
  65. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
  66. data/test/functional/test_updatePlan.rb +5 -3
  67. data/test/functional/test_updateSubscription.rb +5 -3
  68. data/test/functional/test_wallet.rb +1 -1
  69. data/test/functional/test_xmlfields.rb +9 -5
  70. data/test/functional/ts_all.rb +1 -1
  71. data/test/unit/test_LitleAUBatch.rb +1 -1
  72. data/test/unit/test_LitleBatchRequest.rb +1 -1
  73. data/test/unit/test_LitleOnlineRequest.rb +15 -57
  74. data/test/unit/test_LitleRequest.rb +1 -1
  75. data/test/unit/test_LitleTransaction.rb +3 -3
  76. data/test/unit/test_LitleXmlMapper.rb +139 -0
  77. data/test/unit/test_activate.rb +5 -5
  78. data/test/unit/test_activateReversal.rb +16 -4
  79. data/test/unit/test_auth.rb +50 -9
  80. data/test/unit/test_authReversal.rb +1 -1
  81. data/test/unit/test_balanceInquiry.rb +3 -3
  82. data/test/unit/test_cancelSubscription.rb +1 -1
  83. data/test/unit/test_capture.rb +27 -1
  84. data/test/unit/test_captureGivenAuth.rb +47 -1
  85. data/test/unit/test_createPlan.rb +1 -1
  86. data/test/unit/test_credit.rb +16 -3
  87. data/test/unit/test_deactivate.rb +20 -1
  88. data/test/unit/test_deactivateReversal.rb +16 -4
  89. data/test/unit/test_depositReversal.rb +18 -6
  90. data/test/unit/test_echeckCredit.rb +20 -1
  91. data/test/unit/test_echeckRedeposit.rb +16 -1
  92. data/test/unit/test_echeckSale.rb +20 -1
  93. data/test/unit/test_echeckVerification.rb +7 -4
  94. data/test/unit/test_echeckVoid.rb +1 -1
  95. data/test/unit/test_forceCapture.rb +19 -1
  96. data/test/unit/test_fraudCheck.rb +1 -1
  97. data/test/unit/test_giftCardAuthReversal.rb +58 -0
  98. data/test/unit/test_giftCardCapture.rb +57 -0
  99. data/test/unit/test_giftCardCredit.rb +57 -0
  100. data/test/unit/test_load.rb +3 -3
  101. data/test/unit/test_loadReversal.rb +16 -4
  102. data/test/unit/test_queryTransaction.rb +5 -22
  103. data/test/unit/test_refundReversal.rb +16 -4
  104. data/test/unit/test_sale.rb +90 -5
  105. data/test/unit/test_token.rb +35 -24
  106. data/test/unit/test_unload.rb +3 -3
  107. data/test/unit/test_unloadReversal.rb +16 -4
  108. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  109. data/test/unit/test_updatePlan.rb +1 -1
  110. data/test/unit/test_updateSubscription.rb +1 -1
  111. data/test/unit/test_wallet.rb +1 -1
  112. data/test/unit/test_xmlfields.rb +1 -1
  113. data/test/unit/ts_unit.rb +1 -1
  114. metadata +18 -10
@@ -0,0 +1,139 @@
1
+ =begin
2
+ Copyright (c) 2017 Vantiv eCommerce
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated documentation
6
+ files (the "Software"), to deal in the Software without
7
+ restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the
10
+ Software is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
+ OTHER DEALINGS IN THE SOFTWARE.
24
+ =end
25
+
26
+
27
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
28
+ require 'test/unit'
29
+ require 'mocha/setup'
30
+
31
+ module LitleOnline
32
+ class TestLitleXmlMapper < Test::Unit::TestCase
33
+
34
+ def test_LitleXmlMapper_request_xml_response_0
35
+ hash =
36
+ {
37
+ 'merchantId' => '101',
38
+ 'id' => 'test',
39
+ 'version'=>'8.8',
40
+ 'reportGroup'=>'Planets',
41
+ 'litleTxnId'=>'123456',
42
+ }
43
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"0\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
44
+ response = LitleXmlMapper.request("","")
45
+ assert_equal('0',response.response)
46
+ end
47
+
48
+ def test_LitleXmlMapper_request_xml_response_1
49
+ hash =
50
+ {
51
+ 'merchantId' => '101',
52
+ 'id' => 'test',
53
+ 'version'=>'8.8',
54
+ 'reportGroup'=>'Planets',
55
+ 'litleTxnId'=>'123456',
56
+ }
57
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"1\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
58
+ #Get exceptions
59
+ exception = assert_raise(RuntimeError){
60
+ LitleXmlMapper.request("","")
61
+ }
62
+ #Test
63
+ assert(exception.message =~ /Error with http response, code: 1/)
64
+ end
65
+
66
+ def test_LitleXmlMapper_request_xml_response_2
67
+ hash =
68
+ {
69
+ 'merchantId' => '101',
70
+ 'id' => 'test',
71
+ 'version'=>'8.8',
72
+ 'reportGroup'=>'Planets',
73
+ 'litleTxnId'=>'123456',
74
+ }
75
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"2\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
76
+ #Get exceptions
77
+ exception = assert_raise(RuntimeError){
78
+ LitleXmlMapper.request("","")
79
+ }
80
+ #Test
81
+ assert(exception.message =~ /Error with http response, code: 2/)
82
+ end
83
+
84
+ def test_LitleXmlMapper_request_xml_response_3
85
+ hash =
86
+ {
87
+ 'merchantId' => '101',
88
+ 'id' => 'test',
89
+ 'version'=>'8.8',
90
+ 'reportGroup'=>'Planets',
91
+ 'litleTxnId'=>'123456',
92
+ }
93
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"3\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
94
+ #Get exceptions
95
+ exception = assert_raise(RuntimeError){
96
+ LitleXmlMapper.request("","")
97
+ }
98
+ #Test
99
+ assert(exception.message =~ /Error with http response, code: 3/)
100
+ end
101
+
102
+ def test_LitleXmlMapper_request_xml_response_4
103
+ hash =
104
+ {
105
+ 'merchantId' => '101',
106
+ 'id' => 'test',
107
+ 'version'=>'8.8',
108
+ 'reportGroup'=>'Planets',
109
+ 'litleTxnId'=>'123456',
110
+ }
111
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"4\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
112
+ #Get exceptions
113
+ exception = assert_raise(RuntimeError){
114
+ LitleXmlMapper.request("","")
115
+ }
116
+ #Test
117
+ assert(exception.message =~ /Error with http response, code: 4/)
118
+ end
119
+
120
+ def test_LitleXmlMapper_request_xml_response_5
121
+ hash =
122
+ {
123
+ 'merchantId' => '101',
124
+ 'id' => 'test',
125
+ 'version'=>'8.8',
126
+ 'reportGroup'=>'Planets',
127
+ 'litleTxnId'=>'123456',
128
+ }
129
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"5\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
130
+ #Get exceptions
131
+ exception = assert_raise(RuntimeError){
132
+ LitleXmlMapper.request("","")
133
+ }
134
+ #Test
135
+ assert(exception.message =~ /Error with http response, code: 5/)
136
+ end
137
+
138
+ end
139
+ end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -38,13 +38,13 @@ module LitleOnline
38
38
  'orderSource'=>'ecommerce',
39
39
  'card'=>
40
40
  {
41
- 'type'=>'VI',
41
+ 'type'=>'GC',
42
42
  'number' =>'4100000000000001',
43
43
  'expDate' =>'1210'
44
44
  }
45
45
  }
46
46
 
47
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
47
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
48
48
  LitleOnlineRequest.new.activate(hash)
49
49
  end
50
50
 
@@ -58,13 +58,13 @@ module LitleOnline
58
58
  'orderSource'=>'ecommerce',
59
59
  'card'=>
60
60
  {
61
- 'type'=>'VI',
61
+ 'type'=>'GC',
62
62
  'number' =>'4100000000000001',
63
63
  'expDate' =>'1210'
64
64
  }
65
65
  }
66
66
 
67
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
67
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
68
68
  LitleOnlineRequest.new.activate(hash)
69
69
  end
70
70
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -33,11 +33,23 @@ module LitleOnline
33
33
  'merchantId' => '101',
34
34
  'version'=>'8.8',
35
35
  'reportGroup'=>'Planets',
36
- 'litleTxnId' => '5000'
36
+ 'litleTxnId' => '5000',
37
+ 'card'=>{
38
+ 'type'=>'GC',
39
+ 'number' =>'400000000000001',
40
+ 'expDate' =>'0150',
41
+ 'pin' => '1234',
42
+ 'cardValidationNum' => '411'
43
+ },
44
+ 'originalRefCode' => '101',
45
+ 'originalAmount' => '34561',
46
+ 'originalTxnTime' => '2017-01-24T09:00:00',
47
+ 'originalSystemTraceId' => '33',
48
+ 'originalSequenceNumber' => '111111',
37
49
  }
38
50
 
39
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activateReversal reportGroup="Planets"><litleTxnId>5000<\/litleTxnId><\/activateReversal>.*/m), is_a(Hash))
40
- LitleOnlineRequest.new.activate_reversal(hash)
51
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>5000<\/litleTxnId><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
52
+ LitleOnlineRequest.new.deposit_reversal(hash)
41
53
  end
42
54
  end
43
55
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -193,8 +193,7 @@ module LitleOnline
193
193
  }
194
194
  }
195
195
 
196
- XMLObject.expects(:new)
197
- Communications.expects(:http_post).with(regexp_matches(/.*<merchantData>.*?<campaign>foo<\/campaign>.*?<\/merchantData>.*/m),kind_of(Hash))
196
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<merchantData>.*?<campaign>foo<\/campaign>.*?<\/merchantData>.*/m), is_a(Hash))
198
197
  LitleOnlineRequest.new.authorization(hash)
199
198
  end
200
199
 
@@ -209,8 +208,7 @@ module LitleOnline
209
208
  'fraudFilterOverride'=> 'true'
210
209
  }
211
210
 
212
- XMLObject.expects(:new)
213
- Communications.expects(:http_post).with(regexp_matches(/.*<authorization.*?<fraudFilterOverride>true<\/fraudFilterOverride>.*?<\/authorization>.*/m),kind_of(Hash))
211
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authorization.*?<fraudFilterOverride>true<\/fraudFilterOverride>.*?<\/authorization>.*/m), is_a(Hash))
214
212
  LitleOnlineRequest.new.authorization(hash)
215
213
  end
216
214
 
@@ -298,8 +296,7 @@ module LitleOnline
298
296
  'fraudFilterOverride'=> 'true'
299
297
  }
300
298
 
301
- XMLObject.expects(:new)
302
- Communications.expects(:http_post).with(regexp_matches(/.*<authentication.*?<user>UNIT<\/user>.*?<\/authentication>.*/m),kind_of(Hash))
299
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authentication.*?<user>UNIT<\/user>.*?<\/authentication>.*/m), is_a(Hash))
303
300
  LitleOnlineRequest.new.authorization(hash)
304
301
  end
305
302
 
@@ -316,8 +313,7 @@ module LitleOnline
316
313
  'fraudFilterOverride'=> 'true'
317
314
  }
318
315
 
319
- XMLObject.expects(:new)
320
- Communications.expects(:http_post).with(regexp_matches(/.*<authentication.*?<password>TEST<\/password>.*?<\/authentication>.*/m),kind_of(Hash))
316
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authentication.*?<password>TEST<\/password>.*?<\/authentication>.*/m), is_a(Hash))
321
317
  LitleOnlineRequest.new.authorization(hash)
322
318
  end
323
319
 
@@ -418,5 +414,50 @@ module LitleOnline
418
414
  LitleXmlMapper.expects(:request).with(regexp_matches(/.*<mpos><ksn>ksnString<\/ksn><formatId>30<\/formatId><encryptedTrack>encryptedTrackString<\/encryptedTrack><track1Status>0<\/track1Status><track2Status>0<\/track2Status><\/mpos>.*/m), is_a(Hash))
419
415
  LitleOnlineRequest.new.authorization(hash)
420
416
  end
417
+
418
+ def test_processingType_originalNetworkTransactionId_originalTransactionAmount
419
+ hash = {
420
+ 'orderId' => '12344',
421
+ 'amount' => '2',
422
+ 'orderSource' => 'ecommerce',
423
+ 'card' => {
424
+ 'number' => '4141000000000000',
425
+ 'expDate' => '1210',
426
+ 'type' => 'GC'
427
+ },
428
+ 'processingType' => 'initialInstallment',
429
+ 'originalNetworkTransactionId' => '9876543210',
430
+ 'originalTransactionAmount' => '536981'
431
+ }
432
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>initialInstallment<\/processingType><originalNetworkTransactionId>9876543210<\/originalNetworkTransactionId><originalTransactionAmount>536981<\/originalTransactionAmount>.*/m), is_a(Hash))
433
+ LitleOnlineRequest.new.authorization(hash)
434
+ end
435
+
436
+ def test_processingType_wallet
437
+ hash = {
438
+ 'merchantId' => '101',
439
+ 'version'=>'8.8',
440
+ 'reportGroup'=>'Planets',
441
+ 'id'=>'12345',
442
+ 'orderId'=>'67890',
443
+ 'amount'=>'10000',
444
+ 'orderSource'=>'ecommerce',
445
+ 'processingType' => 'initialInstallment',
446
+ 'originalNetworkTransactionId' => '9876543210',
447
+ 'originalTransactionAmount' => '536981',
448
+ 'card'=>{
449
+ 'type'=>'VI',
450
+ 'number' =>'4100000000000000',
451
+ 'expDate' =>'1215'
452
+ },
453
+ 'wallet'=>{
454
+ 'walletSourceType'=>'VisaCheckout',
455
+ 'walletSourceTypeId' => 'VCIND'
456
+ }
457
+ }
458
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<wallet><walletSourceType>VisaCheckout<\/walletSourceType><walletSourceTypeId>VCIND<\/walletSourceTypeId><\/wallet>.*/m), is_a(Hash))
459
+ LitleOnlineRequest.new.authorization(hash)
460
+ end
461
+
421
462
  end
422
463
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -37,13 +37,13 @@ module LitleOnline
37
37
  'orderSource'=>'ecommerce',
38
38
  'card'=>
39
39
  {
40
- 'type'=>'VI',
40
+ 'type'=>'GC',
41
41
  'number' =>'4100000000000001',
42
42
  'expDate' =>'1210'
43
43
  }
44
44
  }
45
45
 
46
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<balanceInquiry reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/balanceInquiry>.*/m), is_a(Hash))
46
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<balanceInquiry reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/balanceInquiry>.*/m), is_a(Hash))
47
47
  LitleOnlineRequest.new.balance_inquiry(hash)
48
48
  end
49
49
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -68,6 +68,32 @@ module LitleOnline
68
68
  LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><payPalNotes>note<\/payPalNotes>.*/m), is_a(Hash))
69
69
  LitleOnlineRequest.new.capture(hash)
70
70
  end
71
+
72
+ def test_pin
73
+ hash = {
74
+ 'litleTxnId' => '123456000',
75
+ 'amount' => '2',
76
+ 'payPalNotes' => 'note',
77
+ 'pin' => '1234'
78
+ }
79
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<pin>1234<\/pin>.*/m), is_a(Hash))
80
+ LitleOnlineRequest.new.capture(hash)
81
+ end
82
+
83
+ def test_custom_billing
84
+ hash = {
85
+ 'payPalNotes'=>'Notes',
86
+ 'litleTxnId'=>'123456000',
87
+ 'amount'=>'106',
88
+ 'customBilling'=>{
89
+ 'city' =>'boston',
90
+ 'descriptor' => 'card was present',
91
+ }
92
+ }
93
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customBilling><city>boston<\/city><descriptor>card was present<\/descriptor><\/customBilling>.*/m), is_a(Hash))
94
+ LitleOnlineRequest.new.capture(hash)
95
+ end
96
+
71
97
  end
72
98
  end
73
99
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation
@@ -183,6 +183,52 @@ module LitleOnline
183
183
  LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudResults><deviceReviewStatus>deviceReviewStatusString<\/deviceReviewStatus><deviceReputationScore>100<\/deviceReputationScore><triggeredRule>rule1<\/triggeredRule><triggeredRule>rule2<\/triggeredRule><\/advancedFraudResults>.*/m), is_a(Hash))
184
184
  LitleOnlineRequest.new.capture_given_auth(hash)
185
185
  end
186
+
187
+ def test_processingType
188
+ hash = {
189
+ 'merchantId' => '101',
190
+ 'version'=>'8.8',
191
+ 'reportGroup'=>'Planets',
192
+ 'orderId'=>'12344',
193
+ 'amount'=>'106',
194
+ 'orderSource'=>'ecommerce',
195
+ 'authInformation' => {
196
+ 'authDate'=>'2002-10-09','authCode'=>'543216',
197
+ 'authAmount'=>'12345'
198
+ },
199
+ 'processingType'=>'initialRecurring',
200
+ 'card'=>{
201
+ 'type'=>'VI',
202
+ 'number' =>'4100000000000001',
203
+ 'expDate' =>'1210'
204
+ }}
205
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>initialRecurring<\/processingType>.*/m), is_a(Hash))
206
+ LitleOnlineRequest.new.capture_given_auth(hash)
207
+ end
208
+
209
+ def test_originalNetworkTransactionId_originalTransactionAmount
210
+ hash = {
211
+ 'merchantId' => '101',
212
+ 'version'=>'8.8',
213
+ 'reportGroup'=>'Planets',
214
+ 'orderId'=>'12344',
215
+ 'amount'=>'106',
216
+ 'orderSource'=>'ecommerce',
217
+ 'authInformation' => {
218
+ 'authDate'=>'2002-10-09','authCode'=>'543216',
219
+ 'authAmount'=>'12345'
220
+ },
221
+ 'card'=>{
222
+ 'type'=>'VI',
223
+ 'number' =>'4100000000000001',
224
+ 'expDate' =>'1210'
225
+ },
226
+ 'originalNetworkTransactionId'=>'987654321098765432109876543210',
227
+ 'originalTransactionAmount'=>'10661'
228
+ }
229
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<originalNetworkTransactionId>987654321098765432109876543210<\/originalNetworkTransactionId><originalTransactionAmount>10661<\/originalTransactionAmount>.*/m), is_a(Hash))
230
+ LitleOnlineRequest.new.capture_given_auth(hash)
231
+ end
186
232
 
187
233
  end
188
234
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
2
+ Copyright (c) 2017 Vantiv eCommerce
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person
5
5
  obtaining a copy of this software and associated documentation