LitleOnline 9.12.0 → 10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +7 -16
  3. data/CONTRIBUTORS +0 -0
  4. data/DESCRIPTION +2 -2
  5. data/LICENSE +1 -1
  6. data/README.md +9 -9
  7. data/Rakefile +9 -8
  8. data/SETUP.md +3 -3
  9. data/bin/Setup.rb +4 -4
  10. data/bin/sample_batch_driver.rb +1 -1
  11. data/bin/sample_driver.rb +1 -1
  12. data/lib/Communications.rb +7 -7
  13. data/lib/Configuration.rb +1 -1
  14. data/lib/EnvironmentVariables.rb +0 -0
  15. data/lib/LitleBatchRequest.rb +22 -8
  16. data/lib/LitleListeners.rb +9 -9
  17. data/lib/LitleOnline.rb +2 -2
  18. data/lib/LitleOnlineRequest.rb +16 -10
  19. data/lib/LitleRequest.rb +10 -10
  20. data/lib/LitleTransaction.rb +66 -64
  21. data/lib/LitleXmlMapper.rb +4 -9
  22. data/lib/XMLFields.rb +129 -116
  23. data/lib/cacert.pem +0 -0
  24. data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
  25. data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
  26. data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
  27. data/samples/Batch/AccountUpdate.rb +1 -0
  28. data/samples/Batch/SampleBatchDriver.rb +2 -1
  29. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
  30. data/samples/Capture/LitleCaptureTransaction.rb +2 -2
  31. data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
  32. data/samples/Capture/LitlePartialCapture.rb +3 -3
  33. data/samples/Credit/LitleCreditTransaction.rb +2 -2
  34. data/samples/Credit/LitleRefundTransaction.rb +2 -1
  35. data/samples/Other/LitleAvsTransaction.rb +2 -1
  36. data/samples/Other/LitleVoidTransaction.rb +2 -1
  37. data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
  38. data/samples/Run_all.rb +0 -0
  39. data/samples/Sale/LitleSaleTransaction.rb +2 -1
  40. data/samples/Sale/SampleSaleTransaction.rb +2 -1
  41. data/test/certification/certTest1_base.rb +53 -52
  42. data/test/certification/certTest2_authenhanced.rb +16 -15
  43. data/test/certification/certTest3_authreversal.rb +16 -15
  44. data/test/certification/certTest4_echeck.rb +11 -10
  45. data/test/certification/certTest5_token.rb +2 -1
  46. data/test/certification/certTest_batchAll.rb +40 -16
  47. data/test/certification/ts_all.rb +1 -1
  48. data/test/functional/test_activate.rb +8 -9
  49. data/test/functional/test_activateReversal.rb +4 -7
  50. data/test/functional/test_auth.rb +50 -113
  51. data/test/functional/test_authReversal.rb +6 -5
  52. data/test/functional/test_balanceInquiry.rb +5 -5
  53. data/test/functional/test_batch.rb +1 -1
  54. data/test/functional/test_batchStream.rb +3 -5
  55. data/test/functional/test_cancelSubscription.rb +3 -5
  56. data/test/functional/test_capture.rb +6 -34
  57. data/test/functional/test_captureGivenAuth.rb +13 -55
  58. data/test/functional/test_configuration.rb +1 -1
  59. data/test/functional/test_createPlan.rb +3 -5
  60. data/test/functional/test_credit.rb +10 -17
  61. data/test/functional/test_deactivate.rb +5 -5
  62. data/test/functional/test_deactivateReversal.rb +4 -5
  63. data/test/functional/test_depositReversal.rb +5 -5
  64. data/test/functional/test_echeckCredit.rb +17 -13
  65. data/test/functional/test_echeckRedeposit.rb +7 -5
  66. data/test/functional/test_echeckSale.rb +42 -21
  67. data/test/functional/test_echeckVerification.rb +19 -20
  68. data/test/functional/test_echeckVoid.rb +3 -2
  69. data/test/functional/test_forceCapture.rb +16 -30
  70. data/test/functional/test_litle_requests.rb +5 -9
  71. data/test/functional/test_load.rb +5 -5
  72. data/test/functional/test_loadReversal.rb +4 -5
  73. data/test/functional/test_override.rb +3 -0
  74. data/test/functional/test_queryTransaction.rb +146 -0
  75. data/test/functional/test_refundReversal.rb +4 -5
  76. data/test/functional/test_sale.rb +94 -170
  77. data/test/functional/test_token.rb +9 -18
  78. data/test/functional/test_unload.rb +5 -5
  79. data/test/functional/test_unloadReversal.rb +5 -6
  80. data/test/functional/test_updateCardValidationNumOnToken.rb +2 -1
  81. data/test/functional/test_updatePlan.rb +4 -5
  82. data/test/functional/test_updateSubscription.rb +5 -5
  83. data/test/functional/test_wallet.rb +74 -0
  84. data/test/functional/test_xmlfields.rb +25 -10
  85. data/test/functional/ts_all.rb +4 -2
  86. data/test/unit/test_LitleAUBatch.rb +1 -1
  87. data/test/unit/test_LitleBatchRequest.rb +4 -4
  88. data/test/unit/test_LitleOnlineRequest.rb +54 -37
  89. data/test/unit/test_LitleRequest.rb +3 -4
  90. data/test/unit/test_LitleTransaction.rb +35 -6
  91. data/test/unit/test_activate.rb +21 -1
  92. data/test/unit/test_activateReversal.rb +1 -1
  93. data/test/unit/test_auth.rb +16 -55
  94. data/test/unit/test_authReversal.rb +1 -1
  95. data/test/unit/test_balanceInquiry.rb +1 -1
  96. data/test/unit/test_cancelSubscription.rb +1 -1
  97. data/test/unit/test_capture.rb +1 -27
  98. data/test/unit/test_captureGivenAuth.rb +18 -44
  99. data/test/unit/test_createPlan.rb +1 -1
  100. data/test/unit/test_credit.rb +3 -16
  101. data/test/unit/test_deactivate.rb +1 -1
  102. data/test/unit/test_deactivateReversal.rb +1 -1
  103. data/test/unit/test_depositReversal.rb +1 -1
  104. data/test/unit/test_echeckCredit.rb +1 -1
  105. data/test/unit/test_echeckRedeposit.rb +1 -1
  106. data/test/unit/test_echeckSale.rb +2 -2
  107. data/test/unit/test_echeckVerification.rb +1 -1
  108. data/test/unit/test_echeckVoid.rb +1 -1
  109. data/test/unit/test_forceCapture.rb +2 -20
  110. data/test/unit/test_load.rb +1 -1
  111. data/test/unit/test_loadReversal.rb +1 -1
  112. data/test/unit/test_queryTransaction.rb +122 -0
  113. data/test/unit/test_refundReversal.rb +1 -1
  114. data/test/unit/test_sale.rb +8 -73
  115. data/test/unit/test_token.rb +8 -15
  116. data/test/unit/test_unload.rb +1 -1
  117. data/test/unit/test_unloadReversal.rb +1 -1
  118. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  119. data/test/unit/test_updatePlan.rb +1 -1
  120. data/test/unit/test_updateSubscription.rb +1 -1
  121. data/test/unit/test_wallet.rb +262 -0
  122. data/test/unit/test_xmlfields.rb +1 -1
  123. data/test/unit/ts_unit.rb +3 -3
  124. metadata +15 -16
  125. data/temp.xml +0 -21
  126. data/test/functional/test_fraudCheck.rb +0 -77
  127. data/test/functional/test_utf8.rb +0 -44
  128. data/test/unit/test_LitleXmlMapper.rb +0 -136
  129. data/test/unit/test_fraudCheck.rb +0 -45
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -30,12 +30,13 @@ module LitleOnline
30
30
  def test_simple_echeck_void
31
31
  hash = {
32
32
  'merchantId' => '101',
33
+ 'id' => 'test',
33
34
  'version'=>'8.8',
34
35
  'reportGroup'=>'Planets',
35
36
  'litleTxnId'=>'12345678000',
36
37
  }
37
38
  response= LitleOnlineRequest.new.echeck_void(hash)
38
- assert_equal('Approved', response.echeckVoidResponse.message)
39
+ assert_equal('Transaction Received', response.echeckVoidResponse.message)
39
40
  end
40
41
  end
41
42
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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
@@ -30,6 +30,7 @@ module LitleOnline
30
30
  def test_simple_force_capture_with_card
31
31
  hash = {
32
32
  'merchantId' => '101',
33
+ 'id' => 'test',
33
34
  'version'=>'8.8',
34
35
  'reportGroup'=>'Planets',
35
36
  'litleTxnId'=>'123456',
@@ -42,12 +43,13 @@ module LitleOnline
42
43
  'expDate' =>'1210'
43
44
  }}
44
45
  response= LitleOnlineRequest.new.force_capture(hash)
45
- assert_equal('000', response.forceCaptureResponse.response)
46
+ assert_equal('001', response.forceCaptureResponse.response)
46
47
  end
47
48
 
48
49
  def test_simple_force_capture_with_token
49
50
  hash = {
50
51
  'merchantId' => '101',
52
+ 'id' => 'test',
51
53
  'version'=>'8.8',
52
54
  'reportGroup'=>'Planets',
53
55
  'litleTxnId'=>'123456',
@@ -67,6 +69,7 @@ module LitleOnline
67
69
  def test_fields_out_of_order
68
70
  hash = {
69
71
  'merchantId' => '101',
72
+ 'id' => 'test',
70
73
  'version'=>'8.8',
71
74
  'orderSource'=>'ecommerce',
72
75
  'litleTxnId'=>'123456',
@@ -86,6 +89,7 @@ module LitleOnline
86
89
  def test_invalid_field
87
90
  hash = {
88
91
  'merchantId' => '101',
92
+ 'id' => 'test',
89
93
  'version'=>'8.8',
90
94
  'reportGroup'=>'Planets',
91
95
  'litleTxnId'=>'123456',
@@ -105,6 +109,7 @@ module LitleOnline
105
109
  def test_no_order_id
106
110
  hash = {
107
111
  'merchantId' => '101',
112
+ 'id' => 'test',
108
113
  'version'=>'8.8',
109
114
  'reportGroup'=>'Planets',
110
115
  'litleTxnId'=>'123456',
@@ -116,15 +121,14 @@ module LitleOnline
116
121
  'cardValidationNum'=>'555',
117
122
  'type'=>'VI'
118
123
  }}
119
- #Get exceptions
120
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.force_capture(hash)}
121
- #Test
122
- assert(exception.message =~ /Error validating xml data against the schema/)
124
+ response= LitleOnlineRequest.new.force_capture(hash)
125
+ assert(response.message =~ /Error validating xml data against the schema/)
123
126
  end
124
127
 
125
128
  def test_no_order_source
126
129
  hash = {
127
130
  'merchantId' => '101',
131
+ 'id' => 'test',
128
132
  'version'=>'8.8',
129
133
  'reportGroup'=>'Planets',
130
134
  'litleTxnId'=>'123456',
@@ -135,15 +139,14 @@ module LitleOnline
135
139
  'number' =>'4100000000000001',
136
140
  'expDate' =>'1210'
137
141
  }}
138
- #Get exceptions
139
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.force_capture(hash)}
140
- #Test
141
- assert(exception.message =~ /Error validating xml data against the schema/)
142
+ response= LitleOnlineRequest.new.force_capture(hash)
143
+ assert(response.message =~ /Error validating xml data against the schema/)
142
144
  end
143
145
 
144
146
  def test_simple_forceCapture_with_mpos
145
147
  hash = {
146
148
  'merchantId' => '101',
149
+ 'id' => 'test',
147
150
  'version'=>'8.8',
148
151
  'reportGroup'=>'Planets',
149
152
  'litleTxnId'=>'123456',
@@ -160,12 +163,13 @@ module LitleOnline
160
163
  }
161
164
  }
162
165
  response= LitleOnlineRequest.new.force_capture(hash)
163
- assert_equal('000', response.forceCaptureResponse.response)
166
+ assert_equal('001', response.forceCaptureResponse.response)
164
167
  end
165
168
 
166
169
  def test_simple_force_capture_with_secondaryAmount
167
170
  hash = {
168
171
  'merchantId' => '101',
172
+ 'id' => 'test',
169
173
  'version'=>'8.8',
170
174
  'reportGroup'=>'Planets',
171
175
  'litleTxnId'=>'123456',
@@ -179,25 +183,7 @@ module LitleOnline
179
183
  'expDate' =>'1210'
180
184
  }}
181
185
  response= LitleOnlineRequest.new.force_capture(hash)
182
- assert_equal('000', response.forceCaptureResponse.response)
183
- end
184
-
185
- def test_simple_force_capture_with_processing_type
186
- hash = {
187
- 'merchantId' => '101',
188
- 'version'=>'8.8',
189
- 'reportGroup'=>'Planets',
190
- 'orderId'=>'12344',
191
- 'amount'=>'106',
192
- 'orderSource'=>'ecommerce',
193
- 'processingType'=>'accountFunding',
194
- 'card'=>{
195
- 'type'=>'VI',
196
- 'number' =>'4100000000000001',
197
- 'expDate' =>'1210'
198
- }}
199
- response= LitleOnlineRequest.new.force_capture(hash)
200
- assert_equal('000', response.forceCaptureResponse.response)
186
+ assert_equal('001', response.forceCaptureResponse.response)
201
187
  end
202
188
 
203
189
  end
@@ -1,6 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
3
-
2
+ Copyright (c) 2012 Litle & Co.
4
3
  Permission is hereby granted, free of charge, to any person
5
4
  obtaining a copy of this software and associated documentation
6
5
  files (the "Software"), to deal in the Software without
@@ -9,10 +8,8 @@ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
8
  copies of the Software, and to permit persons to whom the
10
9
  Software is furnished to do so, subject to the following
11
10
  conditions:
12
-
13
11
  The above copyright notice and this permission notice shall be
14
12
  included in all copies or substantial portions of the Software.
15
-
16
13
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
14
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
15
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -198,7 +195,6 @@ module LitleOnline
198
195
 
199
196
  entries = Dir.entries(dir + '/litle-sdk-for-ruby-test')
200
197
  entries.sort!
201
-
202
198
  assert_equal 3, entries.size
203
199
  assert_not_nil entries[2] =~ /request_\d+.complete.sent\z/
204
200
 
@@ -216,9 +212,9 @@ module LitleOnline
216
212
  handle = sftp.opendir!('/inbound/')
217
213
  files_on_srv = sftp.readdir!(handle)
218
214
  files_on_srv.each {|file|
219
- ents.push(file.name)
215
+ ents.push(file.name)
220
216
  }
221
- assert_equal 3,ents.size
217
+ assert_equal 4,ents.size
222
218
  ents.sort!
223
219
  assert_equal ents[2], uploaded_file.gsub('sent', 'asc')
224
220
  sftp.remove('/inbound/' + ents[2])
@@ -247,6 +243,7 @@ module LitleOnline
247
243
 
248
244
  assert_equal 3, entries.size
249
245
  assert_not_nil entries[2] =~ /response_\d+.complete.asc.received\z/
246
+
250
247
  end
251
248
 
252
249
  def test_full_flow
@@ -340,7 +337,6 @@ module LitleOnline
340
337
  entries.sort!
341
338
  assert_equal 3, entries.length
342
339
  assert_not_nil entries[2] =~ /response_\d+.complete.asc.received.processed\z/
343
-
344
340
  end
345
341
 
346
342
  def get_config(field, options)
@@ -353,4 +349,4 @@ module LitleOnline
353
349
  end
354
350
  end
355
351
  end
356
- end
352
+ end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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,6 +33,7 @@ def test_simple_happy
33
33
  hash = {
34
34
  'merchantId' => '101',
35
35
  'version'=>'8.8',
36
+ 'id'=>'test',
36
37
  'reportGroup'=>'Planets',
37
38
  'orderId' =>'1001',
38
39
  'amount' =>'500',
@@ -52,6 +53,7 @@ def test_simple_happy
52
53
  hash = {
53
54
  'merchantId' => '101',
54
55
  'version'=>'8.8',
56
+ 'id'=>'test',
55
57
  'reportGroup'=>'Planets',
56
58
  'amount' =>'500',
57
59
  'orderId' =>'1001',
@@ -75,10 +77,8 @@ def test_simple_happy
75
77
  'amount' =>'500',
76
78
  }
77
79
 
78
- #Get exceptions
79
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.load_request(hash)}
80
- #Test
81
- assert(exception.message =~ /Error validating xml data against the schema/)
80
+ response= LitleOnlineRequest.new.load_request(hash)
81
+ assert(response.message =~ /Error validating xml data against the schema/)
82
82
  end
83
83
  end
84
84
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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,6 +33,7 @@ def test_simple
33
33
  hash = {
34
34
  'merchantId' => '101',
35
35
  'version'=>'8.8',
36
+ 'id'=>'test',
36
37
  'reportGroup'=>'Planets',
37
38
  'litleTxnId' =>'5000'
38
39
  }
@@ -49,10 +50,8 @@ def test_simple
49
50
  'reportGroup'=>'Planets',
50
51
  }
51
52
 
52
- #Get exceptions
53
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.load_reversal(hash)}
54
- #Test
55
- assert(exception.message =~ /Error validating xml data against the schema/)
53
+ response= LitleOnlineRequest.new.load_reversal(hash)
54
+ assert(response.message =~ /Error validating xml data against the schema/)
56
55
  end
57
56
  end
58
57
  end
@@ -7,6 +7,7 @@ module LitleOnline
7
7
  def test_override_withoutLocalAndEnv
8
8
  hash = {
9
9
  'merchantId' => '101',
10
+ 'id' => 'test',
10
11
  'version'=>'8.8',
11
12
  'orderId' =>'1001',
12
13
  'amount' =>'500',
@@ -23,6 +24,7 @@ module LitleOnline
23
24
  def test_override_withoutLocal
24
25
  hash = {
25
26
  'merchantId' => '101',
27
+ 'id' => 'test',
26
28
  'version'=>'8.8',
27
29
  'orderId' =>'1001',
28
30
  'amount' =>'500',
@@ -42,6 +44,7 @@ module LitleOnline
42
44
  def test_override
43
45
  hash = {
44
46
  'merchantId' => '101',
47
+ 'id' => 'test',
45
48
  'version'=>'8.8',
46
49
  'reportGroup'=>'Planets',
47
50
  'orderId' =>'1001',
@@ -0,0 +1,146 @@
1
+ =begin
2
+ Copyright (c) 2012 Litle & Co.
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
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
27
+ require 'test/unit'
28
+ module LitleOnline
29
+ class TestqueryTransaction < Test::Unit::TestCase
30
+ def test_queryTransaction
31
+ hash = {
32
+ 'merchantId' => '101',
33
+ 'id' => 'test',
34
+ 'version'=>'10.0',
35
+ 'reportGroup'=>'Some RG',
36
+ 'customerId' => '038945',
37
+ 'origId' => '834262',
38
+ 'origActionType' => 'A',
39
+ 'transactionId'=>'123456',
40
+ 'orderId'=>'65347567',
41
+ 'origAccountNumber' => '4000000000000001'
42
+ }
43
+ response= LitleOnlineRequest.new.query_Transaction(hash)
44
+ assert_equal('000', response.queryTransactionResponse.response)
45
+ end
46
+
47
+ def test_queryTransaction_valid_enum
48
+ hash = {
49
+ 'merchantId' => '101',
50
+ 'id' => 'test',
51
+ 'version'=>'10.0',
52
+ 'reportGroup'=>'Some RG',
53
+ 'customerId' => '038945',
54
+ 'origId' => '834262',
55
+ 'origId' => '834262',
56
+ 'origActionType' => '',
57
+ 'transactionId'=>'123456',
58
+ 'orderId'=>'65347567',
59
+ 'origAccountNumber' => '4000000000000001'
60
+ }
61
+ response= LitleOnlineRequest.new.query_Transaction(hash)
62
+ assert('000', response.queryTransactionResponse.response)
63
+ end
64
+
65
+ def test_queryTransaction_no_origid
66
+ hash = {
67
+ 'merchantId' => '101',
68
+ 'id' => 'test',
69
+ 'version'=>'10.0',
70
+ 'reportGroup'=>'Some RG',
71
+ 'customerId' => '038945',
72
+ 'origActionType' => 'A',
73
+ 'transactionId'=>'123456',
74
+ 'orderId'=>'65347567',
75
+ 'origAccountNumber' => '4000000000000001'
76
+ }
77
+ response= LitleOnlineRequest.new.query_Transaction(hash)
78
+ assert(response.message =~ /Error validating xml data against the schema/)
79
+ end
80
+
81
+ def test_queryTransaction_no_accttype
82
+ hash = {
83
+ 'merchantId' => '101',
84
+ 'id' => 'test',
85
+ 'version'=>'10.0',
86
+ 'reportGroup'=>'Some RG',
87
+ 'customerId' => '038945',
88
+ 'origId' => '834262',
89
+ 'transactionId'=>'123456',
90
+ 'orderId'=>'65347567',
91
+ 'origAccountNumber' => '4000000000000001'
92
+ }
93
+ response= LitleOnlineRequest.new.query_Transaction(hash)
94
+ assert(response.message =~ /Error validating xml data against the schema/)
95
+ end
96
+
97
+ def test_queryTransaction_invalid_values
98
+ hash = {
99
+ 'merchantId' => '101',
100
+ 'id' => 'test',
101
+ 'version'=>'10.0',
102
+ 'reportGroup'=>'Some RG',
103
+ 'customerId' => '038945',
104
+ 'origId' => '834262',
105
+ 'origId' => '834262',
106
+ 'origActionType' => 'AAA',
107
+ 'transactionId'=>'123456',
108
+ 'orderId'=>'65347567',
109
+ 'origAccountNumber' => '4000000000000001'
110
+ }
111
+ response= LitleOnlineRequest.new.query_Transaction(hash)
112
+ assert(response.message =~ /Error validating xml data against the schema/)
113
+ end
114
+
115
+ def test_queryTransaction_missing_attributes
116
+ hash = {
117
+ 'merchantId' => '101',
118
+ 'id' => 'test',
119
+ 'version'=>'10.0',
120
+ 'customerId' => '038945',
121
+ 'origActionType' => 'A',
122
+ 'transactionId'=>'123456',
123
+ 'origAccountNumber' => '4000000000000001'
124
+ }
125
+ response= LitleOnlineRequest.new.query_Transaction(hash)
126
+ assert(response.message =~ /Error validating xml data against the schema/)
127
+ end
128
+
129
+ def test_queryTransaction_unavailable_response
130
+ hash = {
131
+ 'merchantId' => '101',
132
+ 'id' => 'test',
133
+ 'version'=>'10.0',
134
+ 'reportGroup'=>'Some RG',
135
+ 'customerId' => '038945',
136
+ 'origId' => 'aaa',
137
+ 'origActionType' => 'A',
138
+ 'transactionId'=>'123456',
139
+ 'orderId'=>'65347567',
140
+ 'origAccountNumber' => '4000000000000001'
141
+ }
142
+ response= LitleOnlineRequest.new.query_Transaction(hash)
143
+ assert_equal('152', response.queryTransactionUnavailableResponse.response)
144
+ end
145
+ end
146
+ end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2017 Vantiv eCommerce
2
+ Copyright (c) 2012 Litle & Co.
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,6 +33,7 @@ def test_simple
33
33
  hash = {
34
34
  'merchantId' => '101',
35
35
  'version'=>'8.8',
36
+ 'id'=>'test',
36
37
  'reportGroup'=>'Planets',
37
38
  'litleTxnId' =>'5000'
38
39
  }
@@ -49,10 +50,8 @@ def test_simple
49
50
  'reportGroup'=>'Planets',
50
51
  }
51
52
 
52
- #Get exceptions
53
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.refund_reversal(hash)}
54
- #Test
55
- assert(exception.message =~ /Error validating xml data against the schema/)
53
+ response= LitleOnlineRequest.new.refund_reversal(hash)
54
+ assert(response.message =~ /Error validating xml data against the schema/)
56
55
  end
57
56
  end
58
57
  end