LitleOnline 8.12.3 → 8.12.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/CHANGELOG +4 -0
  2. data/Rakefile +1 -1
  3. data/lib/Communications.rb +34 -32
  4. data/lib/Configuration.rb +13 -11
  5. data/lib/LitleOnline.rb +0 -1
  6. data/lib/LitleOnlineRequest.rb +546 -543
  7. data/lib/LitleXmlMapper.rb +17 -15
  8. data/lib/XMLFields.rb +903 -901
  9. data/test/certification/certTest1_base.rb +935 -933
  10. data/test/certification/certTest2_authenhanced.rb +548 -546
  11. data/test/certification/certTest3_authreversal.rb +179 -177
  12. data/test/certification/certTest4_echeck.rb +245 -243
  13. data/test/certification/certTest5_token.rb +198 -196
  14. data/test/functional/test_auth.rb +205 -204
  15. data/test/functional/test_authReversal.rb +41 -39
  16. data/test/functional/test_capture.rb +54 -52
  17. data/test/functional/test_captureGivenAuth.rb +153 -152
  18. data/test/functional/test_credit.rb +126 -126
  19. data/test/functional/test_echeckCredit.rb +88 -87
  20. data/test/functional/test_echeckRedeposit.rb +85 -84
  21. data/test/functional/test_echeckSale.rb +132 -131
  22. data/test/functional/test_echeckVerification.rb +97 -95
  23. data/test/functional/test_forceCapture.rb +113 -111
  24. data/test/functional/test_sale.rb +200 -198
  25. data/test/functional/test_token.rb +75 -73
  26. data/test/functional/test_xmlfields.rb +558 -558
  27. data/test/unit/test_LitleOnlineRequest.rb +210 -207
  28. data/test/unit/test_auth.rb +119 -116
  29. data/test/unit/test_authReversal.rb +16 -16
  30. data/test/unit/test_capture.rb +10 -8
  31. data/test/unit/test_captureGivenAuth.rb +62 -59
  32. data/test/unit/test_credit.rb +103 -100
  33. data/test/unit/test_echeckCredit.rb +15 -14
  34. data/test/unit/test_echeckRedeposit.rb +14 -13
  35. data/test/unit/test_echeckSale.rb +16 -15
  36. data/test/unit/test_echeckVerification.rb +14 -13
  37. data/test/unit/test_forceCapture.rb +61 -58
  38. data/test/unit/test_sale.rb +206 -205
  39. data/test/unit/test_token.rb +43 -41
  40. data/test/unit/test_xmlfields.rb +101 -99
  41. metadata +58 -77
  42. data/lib/Obj2xml.rb +0 -37
@@ -1,571 +1,573 @@
1
1
  require 'lib/LitleOnline'
2
2
  require 'test/unit'
3
3
 
4
- class Litle_certTest2 < Test::Unit::TestCase
5
- #test enhanced data on auth response
6
- @@merchant_hash = {'reportGroup'=>'Planets',
7
- 'merchantId'=>'101'
8
- }
9
-
10
- #test 14-31 enhanced data need merchant with smart authorization features.
11
- def test_14
12
- customer_hash = {
13
- 'orderId' => '14',
14
- 'amount' => '3000',
15
- 'orderSource'=>'ecommerce',
16
- 'card'=>{
17
- 'number' =>'4457010200000247',
18
- 'expDate' => '0812',
19
- 'type' => 'VI'
20
- }
4
+ module LitleOnline
5
+ class Litle_certTest2 < Test::Unit::TestCase
6
+ #test enhanced data on auth response
7
+ @@merchant_hash = {'reportGroup'=>'Planets',
8
+ 'merchantId'=>'101'
21
9
  }
22
- hash = customer_hash.merge(@@merchant_hash)
23
- auth_response = LitleOnlineRequest.new.authorization(hash)
24
- assert_equal('000', auth_response.authorizationResponse.response)
25
- assert_equal('Approved', auth_response.authorizationResponse.message)
26
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type']) #Ruby 1.8.7 has type as an attribute of Object
27
- assert_equal('2000', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
28
- assert_equal('NO', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
29
- assert_equal('GIFT', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
30
- end
31
-
32
- def test_15
33
- customer_hash = {
34
- 'orderId' => '15',
35
- 'amount' => '3000',
36
- 'orderSource'=>'ecommerce',
37
- 'card'=>{
38
- 'number' =>'5500000254444445',
39
- 'expDate' => '0312',
40
- 'type' => 'MC'
10
+
11
+ #test 14-31 enhanced data need merchant with smart authorization features.
12
+ def test_14
13
+ customer_hash = {
14
+ 'orderId' => '14',
15
+ 'amount' => '3000',
16
+ 'orderSource'=>'ecommerce',
17
+ 'card'=>{
18
+ 'number' =>'4457010200000247',
19
+ 'expDate' => '0812',
20
+ 'type' => 'VI'
21
+ }
41
22
  }
42
- }
43
- hash = customer_hash.merge(@@merchant_hash)
44
- auth_response = LitleOnlineRequest.new.authorization(hash)
45
- assert_equal('000', auth_response.authorizationResponse.response)
46
- assert_equal('Approved', auth_response.authorizationResponse.message)
47
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
48
- assert_equal('2000', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
49
- assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
50
- assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
51
- end
52
-
53
- def test_16
54
- customer_hash = {
55
- 'orderId' => '16',
56
- 'amount' => '3000',
57
- 'orderSource'=>'ecommerce',
58
- 'card'=>{
59
- 'number' =>'5592106621450897',
60
- 'expDate' => '0312',
61
- 'type' => 'MC'
23
+ hash = customer_hash.merge(@@merchant_hash)
24
+ auth_response = LitleOnlineRequest.new.authorization(hash)
25
+ assert_equal('000', auth_response.authorizationResponse.response)
26
+ assert_equal('Approved', auth_response.authorizationResponse.message)
27
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type']) #Ruby 1.8.7 has type as an attribute of Object
28
+ assert_equal('2000', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
29
+ assert_equal('NO', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
30
+ assert_equal('GIFT', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
31
+ end
32
+
33
+ def test_15
34
+ customer_hash = {
35
+ 'orderId' => '15',
36
+ 'amount' => '3000',
37
+ 'orderSource'=>'ecommerce',
38
+ 'card'=>{
39
+ 'number' =>'5500000254444445',
40
+ 'expDate' => '0312',
41
+ 'type' => 'MC'
42
+ }
62
43
  }
63
- }
64
- hash = customer_hash.merge(@@merchant_hash)
65
- auth_response = LitleOnlineRequest.new.authorization(hash)
66
- assert_equal('000', auth_response.authorizationResponse.response)
67
- assert_equal('Approved', auth_response.authorizationResponse.message)
68
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
69
- assert_equal('0', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
70
- assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
71
- assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
72
- end
73
-
74
- def test_17
75
- customer_hash = {
76
- 'orderId' => '17',
77
- 'amount' => '3000',
78
- 'orderSource'=>'ecommerce',
79
- 'card'=>{
80
- 'number' =>'5590409551104142',
81
- 'expDate' => '0312',
82
- 'type' => 'MC'
44
+ hash = customer_hash.merge(@@merchant_hash)
45
+ auth_response = LitleOnlineRequest.new.authorization(hash)
46
+ assert_equal('000', auth_response.authorizationResponse.response)
47
+ assert_equal('Approved', auth_response.authorizationResponse.message)
48
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
49
+ assert_equal('2000', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
50
+ assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
51
+ assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
52
+ end
53
+
54
+ def test_16
55
+ customer_hash = {
56
+ 'orderId' => '16',
57
+ 'amount' => '3000',
58
+ 'orderSource'=>'ecommerce',
59
+ 'card'=>{
60
+ 'number' =>'5592106621450897',
61
+ 'expDate' => '0312',
62
+ 'type' => 'MC'
63
+ }
83
64
  }
84
- }
85
- hash = customer_hash.merge(@@merchant_hash)
86
- auth_response = LitleOnlineRequest.new.authorization(hash)
87
- assert_equal('000', auth_response.authorizationResponse.response)
88
- assert_equal('Approved', auth_response.authorizationResponse.message)
89
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
90
- assert_equal('6500', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
91
- assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
92
- assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
93
- end
94
-
95
- def test_18
96
- customer_hash = {
97
- 'orderId' => '18',
98
- 'amount' => '3000',
99
- 'orderSource'=>'ecommerce',
100
- 'card'=>{
101
- 'number' =>'5587755665222179',
102
- 'expDate' => '0312',
103
- 'type' => 'MC'
65
+ hash = customer_hash.merge(@@merchant_hash)
66
+ auth_response = LitleOnlineRequest.new.authorization(hash)
67
+ assert_equal('000', auth_response.authorizationResponse.response)
68
+ assert_equal('Approved', auth_response.authorizationResponse.message)
69
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
70
+ assert_equal('0', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
71
+ assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
72
+ assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
73
+ end
74
+
75
+ def test_17
76
+ customer_hash = {
77
+ 'orderId' => '17',
78
+ 'amount' => '3000',
79
+ 'orderSource'=>'ecommerce',
80
+ 'card'=>{
81
+ 'number' =>'5590409551104142',
82
+ 'expDate' => '0312',
83
+ 'type' => 'MC'
84
+ }
104
85
  }
105
- }
106
- hash = customer_hash.merge(@@merchant_hash)
107
- auth_response = LitleOnlineRequest.new.authorization(hash)
108
- assert_equal('000', auth_response.authorizationResponse.response)
109
- assert_equal('Approved', auth_response.authorizationResponse.message)
110
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
111
- assert_equal('12200', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
112
- assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
113
- assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
114
- end
115
-
116
- def test_19
117
- customer_hash = {
118
- 'orderId' => '19',
119
- 'amount' => '3000',
120
- 'orderSource'=>'ecommerce',
121
- 'card'=>{
122
- 'number' =>'5445840176552850',
123
- 'expDate' => '0312',
124
- 'type' => 'MC'
86
+ hash = customer_hash.merge(@@merchant_hash)
87
+ auth_response = LitleOnlineRequest.new.authorization(hash)
88
+ assert_equal('000', auth_response.authorizationResponse.response)
89
+ assert_equal('Approved', auth_response.authorizationResponse.message)
90
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
91
+ assert_equal('6500', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
92
+ assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
93
+ assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
94
+ end
95
+
96
+ def test_18
97
+ customer_hash = {
98
+ 'orderId' => '18',
99
+ 'amount' => '3000',
100
+ 'orderSource'=>'ecommerce',
101
+ 'card'=>{
102
+ 'number' =>'5587755665222179',
103
+ 'expDate' => '0312',
104
+ 'type' => 'MC'
105
+ }
125
106
  }
126
- }
127
- hash = customer_hash.merge(@@merchant_hash)
128
- auth_response = LitleOnlineRequest.new.authorization(hash)
129
- assert_equal('000', auth_response.authorizationResponse.response)
130
- assert_equal('Approved', auth_response.authorizationResponse.message)
131
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
132
- assert_equal('20000', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
133
- assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
134
- assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
135
- end
136
-
137
- def test_20
138
- customer_hash = {
139
- 'orderId' => '20',
140
- 'amount' => '3000',
141
- 'orderSource'=>'ecommerce',
142
- 'card'=>{
143
- 'number' =>'5390016478904678',
144
- 'expDate' => '0312',
145
- 'type' => 'MC'
107
+ hash = customer_hash.merge(@@merchant_hash)
108
+ auth_response = LitleOnlineRequest.new.authorization(hash)
109
+ assert_equal('000', auth_response.authorizationResponse.response)
110
+ assert_equal('Approved', auth_response.authorizationResponse.message)
111
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
112
+ assert_equal('12200', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
113
+ assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
114
+ assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
115
+ end
116
+
117
+ def test_19
118
+ customer_hash = {
119
+ 'orderId' => '19',
120
+ 'amount' => '3000',
121
+ 'orderSource'=>'ecommerce',
122
+ 'card'=>{
123
+ 'number' =>'5445840176552850',
124
+ 'expDate' => '0312',
125
+ 'type' => 'MC'
126
+ }
146
127
  }
147
- }
148
- hash = customer_hash.merge(@@merchant_hash)
149
- auth_response = LitleOnlineRequest.new.authorization(hash)
150
- assert_equal('000', auth_response.authorizationResponse.response)
151
- assert_equal('Approved', auth_response.authorizationResponse.message)
152
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
153
- assert_equal('10050', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
154
- assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
155
- assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
156
- end
157
-
158
- def test_21
159
- customer_hash = {
160
- 'orderId' => '21',
161
- 'amount' => '5000',
162
- 'orderSource'=>'ecommerce',
163
- 'card'=>{
164
- 'number' =>'4457010201000246',
165
- 'expDate' => '0912',
166
- 'type' => 'VI'
128
+ hash = customer_hash.merge(@@merchant_hash)
129
+ auth_response = LitleOnlineRequest.new.authorization(hash)
130
+ assert_equal('000', auth_response.authorizationResponse.response)
131
+ assert_equal('Approved', auth_response.authorizationResponse.message)
132
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
133
+ assert_equal('20000', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
134
+ assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
135
+ assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
136
+ end
137
+
138
+ def test_20
139
+ customer_hash = {
140
+ 'orderId' => '20',
141
+ 'amount' => '3000',
142
+ 'orderSource'=>'ecommerce',
143
+ 'card'=>{
144
+ 'number' =>'5390016478904678',
145
+ 'expDate' => '0312',
146
+ 'type' => 'MC'
147
+ }
167
148
  }
168
- }
169
- hash = customer_hash.merge(@@merchant_hash)
170
- auth_response = LitleOnlineRequest.new.authorization(hash)
171
- assert_equal('000', auth_response.authorizationResponse.response)
172
- assert_equal('Approved', auth_response.authorizationResponse.message)
173
- assert_equal('AFFLUENT', auth_response.authorizationResponse.enhancedAuthResponse.affluence)
174
- end
175
-
176
- def test_22
177
- customer_hash = {
178
- 'orderId' => '22',
179
- 'amount' => '5000',
180
- 'orderSource'=>'ecommerce',
181
- 'card'=>{
182
- 'number' =>'4457010202000245',
183
- 'expDate' => '1111',
184
- 'type' => 'VI'
149
+ hash = customer_hash.merge(@@merchant_hash)
150
+ auth_response = LitleOnlineRequest.new.authorization(hash)
151
+ assert_equal('000', auth_response.authorizationResponse.response)
152
+ assert_equal('Approved', auth_response.authorizationResponse.message)
153
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
154
+ assert_equal('10050', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
155
+ assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
156
+ assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
157
+ end
158
+
159
+ def test_21
160
+ customer_hash = {
161
+ 'orderId' => '21',
162
+ 'amount' => '5000',
163
+ 'orderSource'=>'ecommerce',
164
+ 'card'=>{
165
+ 'number' =>'4457010201000246',
166
+ 'expDate' => '0912',
167
+ 'type' => 'VI'
168
+ }
185
169
  }
186
- }
187
- hash = customer_hash.merge(@@merchant_hash)
188
- auth_response = LitleOnlineRequest.new.authorization(hash)
189
- assert_equal('000', auth_response.authorizationResponse.response)
190
- assert_equal('Approved', auth_response.authorizationResponse.message)
191
- assert_equal('MASS AFFLUENT', auth_response.authorizationResponse.enhancedAuthResponse.affluence)
192
- end
193
-
194
- def test_23
195
- customer_hash = {
196
- 'orderId' => '23',
197
- 'amount' => '5000',
198
- 'orderSource'=>'ecommerce',
199
- 'card'=>{
200
- 'number' =>'5112010201000109',
201
- 'expDate' => '0412',
202
- 'type' => 'MC'
170
+ hash = customer_hash.merge(@@merchant_hash)
171
+ auth_response = LitleOnlineRequest.new.authorization(hash)
172
+ assert_equal('000', auth_response.authorizationResponse.response)
173
+ assert_equal('Approved', auth_response.authorizationResponse.message)
174
+ assert_equal('AFFLUENT', auth_response.authorizationResponse.enhancedAuthResponse.affluence)
175
+ end
176
+
177
+ def test_22
178
+ customer_hash = {
179
+ 'orderId' => '22',
180
+ 'amount' => '5000',
181
+ 'orderSource'=>'ecommerce',
182
+ 'card'=>{
183
+ 'number' =>'4457010202000245',
184
+ 'expDate' => '1111',
185
+ 'type' => 'VI'
186
+ }
203
187
  }
204
- }
205
- hash = customer_hash.merge(@@merchant_hash)
206
- auth_response = LitleOnlineRequest.new.authorization(hash)
207
- assert_equal('000', auth_response.authorizationResponse.response)
208
- assert_equal('Approved', auth_response.authorizationResponse.message)
209
- assert_equal('AFFLUENT', auth_response.authorizationResponse.enhancedAuthResponse.affluence)
210
- end
211
-
212
- def test_24
213
- customer_hash = {
214
- 'orderId' => '24',
215
- 'amount' => '5000',
216
- 'orderSource'=>'ecommerce',
217
- 'card'=>{
218
- 'number' =>'5112010202000108',
219
- 'expDate' => '0812',
220
- 'type' => 'MC'
188
+ hash = customer_hash.merge(@@merchant_hash)
189
+ auth_response = LitleOnlineRequest.new.authorization(hash)
190
+ assert_equal('000', auth_response.authorizationResponse.response)
191
+ assert_equal('Approved', auth_response.authorizationResponse.message)
192
+ assert_equal('MASS AFFLUENT', auth_response.authorizationResponse.enhancedAuthResponse.affluence)
193
+ end
194
+
195
+ def test_23
196
+ customer_hash = {
197
+ 'orderId' => '23',
198
+ 'amount' => '5000',
199
+ 'orderSource'=>'ecommerce',
200
+ 'card'=>{
201
+ 'number' =>'5112010201000109',
202
+ 'expDate' => '0412',
203
+ 'type' => 'MC'
204
+ }
221
205
  }
222
- }
223
- hash = customer_hash.merge(@@merchant_hash)
224
- auth_response = LitleOnlineRequest.new.authorization(hash)
225
- assert_equal('000', auth_response.authorizationResponse.response)
226
- assert_equal('Approved', auth_response.authorizationResponse.message)
227
- assert_equal('MASS AFFLUENT', auth_response.authorizationResponse.enhancedAuthResponse.affluence)
228
- end
229
-
230
- def test_25
231
- customer_hash = {
232
- 'orderId' => '25',
233
- 'amount' => '5000',
234
- 'orderSource'=>'ecommerce',
235
- 'card'=>{
236
- 'number' =>'4100204446270000',
237
- 'expDate' => '1112',
238
- 'type' => 'VI'}
239
- }
240
- hash = customer_hash.merge(@@merchant_hash)
241
- auth_response = LitleOnlineRequest.new.authorization(hash)
242
- assert_equal('000', auth_response.authorizationResponse.response)
243
- assert_equal('Approved', auth_response.authorizationResponse.message)
244
- assert_equal('BRA', auth_response.authorizationResponse.enhancedAuthResponse.issuerCountry)
245
- end
246
-
247
- # test 26-31 healthcare iias
248
- def test_26
249
- customer_hash = {
250
- 'orderId' => '26',
251
- 'amount' => '18698',
252
- 'orderSource'=>'ecommerce',
253
- 'card'=>{
254
- 'number' =>'5194560012341234',
255
- 'expDate' => '1212',
256
- 'type' => 'MC'},
257
- 'allowPartialAuth' => 'true',
258
- 'healthcareIIAS' => {
259
- 'healthcareAmounts' => {
260
- 'totalHealthcareAmount' =>'20000'
261
- },
262
- 'IIASFlag' => 'Y'
206
+ hash = customer_hash.merge(@@merchant_hash)
207
+ auth_response = LitleOnlineRequest.new.authorization(hash)
208
+ assert_equal('000', auth_response.authorizationResponse.response)
209
+ assert_equal('Approved', auth_response.authorizationResponse.message)
210
+ assert_equal('AFFLUENT', auth_response.authorizationResponse.enhancedAuthResponse.affluence)
211
+ end
212
+
213
+ def test_24
214
+ customer_hash = {
215
+ 'orderId' => '24',
216
+ 'amount' => '5000',
217
+ 'orderSource'=>'ecommerce',
218
+ 'card'=>{
219
+ 'number' =>'5112010202000108',
220
+ 'expDate' => '0812',
221
+ 'type' => 'MC'
222
+ }
263
223
  }
264
- }
265
- hash = customer_hash.merge(@@merchant_hash)
266
- auth_response = LitleOnlineRequest.new.authorization(hash)
267
- assert_equal('341', auth_response.authorizationResponse.response)
268
- assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
269
- end
270
-
271
- def test_27
272
- customer_hash = {
273
- 'orderId' => '27',
274
- 'amount' => '18698',
275
- 'orderSource'=>'ecommerce',
276
- 'card'=>{
277
- 'number' =>'5194560012341234',
278
- 'expDate' => '1212',
279
- 'type' => 'MC'},
280
- 'allowPartialAuth' => 'true',
281
- 'healthcareIIAS' => {
282
- 'healthcareAmounts' => {
283
- 'totalHealthcareAmount' =>'15000',
284
- 'RxAmount' => '16000'
285
- },
286
- 'IIASFlag' => 'Y'
224
+ hash = customer_hash.merge(@@merchant_hash)
225
+ auth_response = LitleOnlineRequest.new.authorization(hash)
226
+ assert_equal('000', auth_response.authorizationResponse.response)
227
+ assert_equal('Approved', auth_response.authorizationResponse.message)
228
+ assert_equal('MASS AFFLUENT', auth_response.authorizationResponse.enhancedAuthResponse.affluence)
229
+ end
230
+
231
+ def test_25
232
+ customer_hash = {
233
+ 'orderId' => '25',
234
+ 'amount' => '5000',
235
+ 'orderSource'=>'ecommerce',
236
+ 'card'=>{
237
+ 'number' =>'4100204446270000',
238
+ 'expDate' => '1112',
239
+ 'type' => 'VI'}
287
240
  }
288
- }
289
- hash = customer_hash.merge(@@merchant_hash)
290
- auth_response = LitleOnlineRequest.new.authorization(hash)
291
- assert_equal('341', auth_response.authorizationResponse.response)
292
- assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
293
- end
294
-
295
- def test_28
296
- customer_hash = {
297
- 'orderId' => '28',
298
- 'amount' => '15000',
299
- 'orderSource'=>'ecommerce',
300
- 'card'=>{
301
- 'number' =>'5194560012341234',
302
- 'expDate' => '1212',
303
- 'type' => 'MC'},
304
- 'allowPartialAuth' => 'true',
305
- 'healthcareIIAS' => {
306
- 'healthcareAmounts' => {
307
- 'totalHealthcareAmount' =>'15000',
308
- 'RxAmount' => '3698'
309
- },
310
- 'IIASFlag' => 'Y'
241
+ hash = customer_hash.merge(@@merchant_hash)
242
+ auth_response = LitleOnlineRequest.new.authorization(hash)
243
+ assert_equal('000', auth_response.authorizationResponse.response)
244
+ assert_equal('Approved', auth_response.authorizationResponse.message)
245
+ assert_equal('BRA', auth_response.authorizationResponse.enhancedAuthResponse.issuerCountry)
246
+ end
247
+
248
+ # test 26-31 healthcare iias
249
+ def test_26
250
+ customer_hash = {
251
+ 'orderId' => '26',
252
+ 'amount' => '18698',
253
+ 'orderSource'=>'ecommerce',
254
+ 'card'=>{
255
+ 'number' =>'5194560012341234',
256
+ 'expDate' => '1212',
257
+ 'type' => 'MC'},
258
+ 'allowPartialAuth' => 'true',
259
+ 'healthcareIIAS' => {
260
+ 'healthcareAmounts' => {
261
+ 'totalHealthcareAmount' =>'20000'
262
+ },
263
+ 'IIASFlag' => 'Y'
264
+ }
311
265
  }
312
- }
313
- hash = customer_hash.merge(@@merchant_hash)
314
- auth_response = LitleOnlineRequest.new.authorization(hash)
315
- assert_equal('000', auth_response.authorizationResponse.response)
316
- assert_equal('Approved', auth_response.authorizationResponse.message)
317
- end
318
-
319
- def test_29
320
- customer_hash = {
321
- 'orderId' => '29',
322
- 'amount' => '18699',
323
- 'orderSource'=>'ecommerce',
324
- 'card'=>{
325
- 'number' =>'4024720001231239',
326
- 'expDate' => '1212',
327
- 'type' => 'VI'},
328
- 'allowPartialAuth' => 'true',
329
- 'healthcareIIAS' => {
330
- 'healthcareAmounts' => {
331
- 'totalHealthcareAmount' =>'31000',
332
- 'RxAmount' => '1000',
333
- 'visionAmount' => '19901',
334
- 'clinicOtherAmount' => '9050',
335
- 'dentalAmount' => '1049'
336
- },
337
- 'IIASFlag' => 'Y'
266
+ hash = customer_hash.merge(@@merchant_hash)
267
+ auth_response = LitleOnlineRequest.new.authorization(hash)
268
+ assert_equal('341', auth_response.authorizationResponse.response)
269
+ assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
270
+ end
271
+
272
+ def test_27
273
+ customer_hash = {
274
+ 'orderId' => '27',
275
+ 'amount' => '18698',
276
+ 'orderSource'=>'ecommerce',
277
+ 'card'=>{
278
+ 'number' =>'5194560012341234',
279
+ 'expDate' => '1212',
280
+ 'type' => 'MC'},
281
+ 'allowPartialAuth' => 'true',
282
+ 'healthcareIIAS' => {
283
+ 'healthcareAmounts' => {
284
+ 'totalHealthcareAmount' =>'15000',
285
+ 'RxAmount' => '16000'
286
+ },
287
+ 'IIASFlag' => 'Y'
288
+ }
338
289
  }
339
- }
340
- hash = customer_hash.merge(@@merchant_hash)
341
- auth_response = LitleOnlineRequest.new.authorization(hash)
342
- assert_equal('341', auth_response.authorizationResponse.response)
343
- assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
344
- end
345
-
346
- def test_30
347
- customer_hash = {
348
- 'orderId' => '30',
349
- 'amount' => '20000',
350
- 'orderSource'=>'ecommerce',
351
- 'card'=>{
352
- 'number' =>'4024720001231239',
353
- 'expDate' => '1212',
354
- 'type' => 'VI'},
355
- 'allowPartialAuth' => 'true',
356
- 'healthcareIIAS' => {
357
- 'healthcareAmounts' => {
358
- 'totalHealthcareAmount' =>'20000',
359
- 'RxAmount' => '1000',
360
- 'visionAmount' => '19901',
361
- 'clinicOtherAmount' => '9050',
362
- 'dentalAmount' => '1049'
363
- },
364
- 'IIASFlag' => 'Y'
290
+ hash = customer_hash.merge(@@merchant_hash)
291
+ auth_response = LitleOnlineRequest.new.authorization(hash)
292
+ assert_equal('341', auth_response.authorizationResponse.response)
293
+ assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
294
+ end
295
+
296
+ def test_28
297
+ customer_hash = {
298
+ 'orderId' => '28',
299
+ 'amount' => '15000',
300
+ 'orderSource'=>'ecommerce',
301
+ 'card'=>{
302
+ 'number' =>'5194560012341234',
303
+ 'expDate' => '1212',
304
+ 'type' => 'MC'},
305
+ 'allowPartialAuth' => 'true',
306
+ 'healthcareIIAS' => {
307
+ 'healthcareAmounts' => {
308
+ 'totalHealthcareAmount' =>'15000',
309
+ 'RxAmount' => '3698'
310
+ },
311
+ 'IIASFlag' => 'Y'
312
+ }
365
313
  }
366
- }
367
- hash = customer_hash.merge(@@merchant_hash)
368
- auth_response = LitleOnlineRequest.new.authorization(hash)
369
- assert_equal('341', auth_response.authorizationResponse.response)
370
- assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
371
- end
372
-
373
- def test_31
374
- customer_hash = {
375
- 'orderId' => '31',
376
- 'amount' => '25000',
377
- 'orderSource'=>'ecommerce',
378
- 'card'=>{
379
- 'number' =>'4024720001231239',
380
- 'expDate' => '1212',
381
- 'type' => 'VI'},
382
- 'allowPartialAuth' => 'true',
383
- 'healthcareIIAS' => {
384
- 'healthcareAmounts' => {
385
- 'totalHealthcareAmount' =>'18699',
386
- 'RxAmount' => '1000',
387
- 'visionAmount' => '15099'
388
- },
389
- 'IIASFlag' => 'Y'
314
+ hash = customer_hash.merge(@@merchant_hash)
315
+ auth_response = LitleOnlineRequest.new.authorization(hash)
316
+ assert_equal('000', auth_response.authorizationResponse.response)
317
+ assert_equal('Approved', auth_response.authorizationResponse.message)
318
+ end
319
+
320
+ def test_29
321
+ customer_hash = {
322
+ 'orderId' => '29',
323
+ 'amount' => '18699',
324
+ 'orderSource'=>'ecommerce',
325
+ 'card'=>{
326
+ 'number' =>'4024720001231239',
327
+ 'expDate' => '1212',
328
+ 'type' => 'VI'},
329
+ 'allowPartialAuth' => 'true',
330
+ 'healthcareIIAS' => {
331
+ 'healthcareAmounts' => {
332
+ 'totalHealthcareAmount' =>'31000',
333
+ 'RxAmount' => '1000',
334
+ 'visionAmount' => '19901',
335
+ 'clinicOtherAmount' => '9050',
336
+ 'dentalAmount' => '1049'
337
+ },
338
+ 'IIASFlag' => 'Y'
339
+ }
390
340
  }
391
- }
392
- hash = customer_hash.merge(@@merchant_hash)
393
- auth_response = LitleOnlineRequest.new.authorization(hash)
394
- assert_equal('010', auth_response.authorizationResponse.response)
395
- assert_equal('Partially Approved', auth_response.authorizationResponse.message)
396
- assert_equal('18699', auth_response.authorizationResponse.approvedAmount)
397
- end
398
-
399
- def test_32
400
- customer_hash = {
401
- 'orderId' => '32',
402
- 'amount' => '10010',
403
- 'orderSource'=>'ecommerce',
404
- 'billToAddress'=>{
405
- 'name' => 'John Smith',
406
- 'addressLine1' => '1 Main St.',
407
- 'city' => 'Burlington',
408
- 'state' => 'MA',
409
- 'zip' => '01803-3747',
410
- 'country' => 'US'},
411
- 'card'=>{
412
- 'number' =>'4457010000000009',
413
- 'expDate' => '0112',
414
- 'cardValidationNum' => '349',
415
- 'type' => 'VI'}
416
- }
417
- hash = customer_hash.merge(@@merchant_hash)
418
- authorization_response = LitleOnlineRequest.new.authorization(hash)
419
- assert_equal('000', authorization_response.authorizationResponse.response)
420
- assert_equal('Approved', authorization_response.authorizationResponse.message)
421
- assert_equal('01', authorization_response.authorizationResponse.fraudResult.avsResult)
422
- assert_equal('M', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
423
-
424
- #test 32A
425
- capture_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '5005'}
426
- hash32a = capture_hash.merge(@@merchant_hash)
427
- capture_response = LitleOnlineRequest.new.capture(hash32a)
428
- assert_equal('000', capture_response.captureResponse.response)
429
- assert_equal('Approved', capture_response.captureResponse.message)
430
-
431
- #test 32B
432
- authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId}
433
- hash1b = authReversal_hash.merge(@@merchant_hash)
434
- authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
435
- assert_equal('111', authReversal_response.authReversalResponse.response)
436
- assert_equal('Authorization amount has already been depleted', authReversal_response.authReversalResponse.message)
437
- end
341
+ hash = customer_hash.merge(@@merchant_hash)
342
+ auth_response = LitleOnlineRequest.new.authorization(hash)
343
+ assert_equal('341', auth_response.authorizationResponse.response)
344
+ assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
345
+ end
438
346
 
439
- def test_33
440
- customer_hash = {
441
- 'orderId' => '33',
442
- 'amount' => '20020',
443
- 'orderSource'=>'ecommerce',
444
- 'billToAddress'=>{
445
- 'name' => 'Mike J. Hammer',
446
- 'addressLine1' => '2 Main St.',
447
- 'addressLine2' => 'Apt. 222',
448
- 'city' => 'Riverside',
449
- 'state' => 'RI',
450
- 'zip' => '02915',
451
- 'country' => 'US'},
452
- 'card'=>{
453
- 'number' =>'5112010000000003',
454
- 'expDate' => '0212',
455
- 'cardValidationNum' => '261',
456
- 'type' => 'MC'},
457
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
458
- }
459
- hash = customer_hash.merge(@@merchant_hash)
460
- authorization_response = LitleOnlineRequest.new.authorization(hash)
461
- assert_equal('000', authorization_response.authorizationResponse.response)
462
- assert_equal('Approved', authorization_response.authorizationResponse.message)
463
- assert_equal('22222', authorization_response.authorizationResponse.authCode)
464
- assert_equal('10', authorization_response.authorizationResponse.fraudResult.avsResult)
465
- assert_equal('M', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
466
-
467
- #test 33A
468
- authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId}
469
- hash1b = authReversal_hash.merge(@@merchant_hash)
470
- authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
471
- assert_equal('000', authReversal_response.authReversalResponse.response)
472
- assert_equal('Approved', authReversal_response.authReversalResponse.message)
473
- end
347
+ def test_30
348
+ customer_hash = {
349
+ 'orderId' => '30',
350
+ 'amount' => '20000',
351
+ 'orderSource'=>'ecommerce',
352
+ 'card'=>{
353
+ 'number' =>'4024720001231239',
354
+ 'expDate' => '1212',
355
+ 'type' => 'VI'},
356
+ 'allowPartialAuth' => 'true',
357
+ 'healthcareIIAS' => {
358
+ 'healthcareAmounts' => {
359
+ 'totalHealthcareAmount' =>'20000',
360
+ 'RxAmount' => '1000',
361
+ 'visionAmount' => '19901',
362
+ 'clinicOtherAmount' => '9050',
363
+ 'dentalAmount' => '1049'
364
+ },
365
+ 'IIASFlag' => 'Y'
366
+ }
367
+ }
368
+ hash = customer_hash.merge(@@merchant_hash)
369
+ auth_response = LitleOnlineRequest.new.authorization(hash)
370
+ assert_equal('341', auth_response.authorizationResponse.response)
371
+ assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
372
+ end
474
373
 
475
- def test_34
476
- customer_hash = {
477
- 'orderId' => '34',
478
- 'amount' => '30030',
479
- 'orderSource'=>'ecommerce',
480
- 'billToAddress'=>{
481
- 'name' => 'Eileen Jones',
482
- 'addressLine1' => '3 Main St.',
483
- 'city' => 'Bloomfield',
484
- 'state' => 'CT',
485
- 'zip' => '06002',
486
- 'country' => 'US'},
487
- 'card'=>{
488
- 'number' =>'6011010000000003',
489
- 'expDate' => '0312',
490
- 'cardValidationNum' => '758',
491
- 'type' => 'DI'},
492
- }
493
- hash = customer_hash.merge(@@merchant_hash)
494
- authorization_response = LitleOnlineRequest.new.authorization(hash)
495
- assert_equal('000', authorization_response.authorizationResponse.response)
496
- assert_equal('Approved', authorization_response.authorizationResponse.message)
497
- assert_equal('33333', authorization_response.authorizationResponse.authCode)
498
- assert_equal('10', authorization_response.authorizationResponse.fraudResult.avsResult)
499
- assert_equal('M', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
500
-
501
- #test 34A
502
- authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId}
503
- hash1b = authReversal_hash.merge(@@merchant_hash)
504
- authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
505
- assert_equal('000', authReversal_response.authReversalResponse.response)
506
- assert_equal('Approved', authReversal_response.authReversalResponse.message)
507
- end
374
+ def test_31
375
+ customer_hash = {
376
+ 'orderId' => '31',
377
+ 'amount' => '25000',
378
+ 'orderSource'=>'ecommerce',
379
+ 'card'=>{
380
+ 'number' =>'4024720001231239',
381
+ 'expDate' => '1212',
382
+ 'type' => 'VI'},
383
+ 'allowPartialAuth' => 'true',
384
+ 'healthcareIIAS' => {
385
+ 'healthcareAmounts' => {
386
+ 'totalHealthcareAmount' =>'18699',
387
+ 'RxAmount' => '1000',
388
+ 'visionAmount' => '15099'
389
+ },
390
+ 'IIASFlag' => 'Y'
391
+ }
392
+ }
393
+ hash = customer_hash.merge(@@merchant_hash)
394
+ auth_response = LitleOnlineRequest.new.authorization(hash)
395
+ assert_equal('010', auth_response.authorizationResponse.response)
396
+ assert_equal('Partially Approved', auth_response.authorizationResponse.message)
397
+ assert_equal('18699', auth_response.authorizationResponse.approvedAmount)
398
+ end
508
399
 
509
- def test_35
510
- customer_hash = {
511
- 'orderId' => '35',
512
- 'amount' => '40040',
513
- 'orderSource'=>'ecommerce',
514
- 'billToAddress'=>{
515
- 'name' => 'Bob Black',
516
- 'addressLine1' => '4 Main St.',
517
- 'city' => 'Laurel',
518
- 'state' => 'MD',
519
- 'zip' => '20708',
520
- 'country' => 'US'},
521
- 'card'=>{
522
- 'number' =>'375001000000005',
523
- 'expDate' => '0412',
524
- 'type' => 'AX'}
525
- }
526
- hash = customer_hash.merge(@@merchant_hash)
527
- authorization_response = LitleOnlineRequest.new.authorization(hash)
528
- assert_equal('000', authorization_response.authorizationResponse.response)
529
- assert_equal('Approved', authorization_response.authorizationResponse.message)
530
- assert_equal('44444', authorization_response.authorizationResponse.authCode)
531
- assert_equal('12', authorization_response.authorizationResponse.fraudResult.avsResult)
532
-
533
- #test 35A
534
- capture_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
535
- hash32a = capture_hash.merge(@@merchant_hash)
536
- capture_response = LitleOnlineRequest.new.capture(hash32a)
537
- assert_equal('000', capture_response.captureResponse.response)
538
- assert_equal('Approved', capture_response.captureResponse.message)
539
-
540
- #test 35B
541
- authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
542
- hash1b = authReversal_hash.merge(@@merchant_hash)
543
- authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
544
- assert_equal('000', authReversal_response.authReversalResponse.response)
545
- assert_equal('Approved', authReversal_response.authReversalResponse.message)
546
- end
400
+ def test_32
401
+ customer_hash = {
402
+ 'orderId' => '32',
403
+ 'amount' => '10010',
404
+ 'orderSource'=>'ecommerce',
405
+ 'billToAddress'=>{
406
+ 'name' => 'John Smith',
407
+ 'addressLine1' => '1 Main St.',
408
+ 'city' => 'Burlington',
409
+ 'state' => 'MA',
410
+ 'zip' => '01803-3747',
411
+ 'country' => 'US'},
412
+ 'card'=>{
413
+ 'number' =>'4457010000000009',
414
+ 'expDate' => '0112',
415
+ 'cardValidationNum' => '349',
416
+ 'type' => 'VI'}
417
+ }
418
+ hash = customer_hash.merge(@@merchant_hash)
419
+ authorization_response = LitleOnlineRequest.new.authorization(hash)
420
+ assert_equal('000', authorization_response.authorizationResponse.response)
421
+ assert_equal('Approved', authorization_response.authorizationResponse.message)
422
+ assert_equal('01', authorization_response.authorizationResponse.fraudResult.avsResult)
423
+ assert_equal('M', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
424
+
425
+ #test 32A
426
+ capture_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '5005'}
427
+ hash32a = capture_hash.merge(@@merchant_hash)
428
+ capture_response = LitleOnlineRequest.new.capture(hash32a)
429
+ assert_equal('000', capture_response.captureResponse.response)
430
+ assert_equal('Approved', capture_response.captureResponse.message)
431
+
432
+ #test 32B
433
+ authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId}
434
+ hash1b = authReversal_hash.merge(@@merchant_hash)
435
+ authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
436
+ assert_equal('111', authReversal_response.authReversalResponse.response)
437
+ assert_equal('Authorization amount has already been depleted', authReversal_response.authReversalResponse.message)
438
+ end
439
+
440
+ def test_33
441
+ customer_hash = {
442
+ 'orderId' => '33',
443
+ 'amount' => '20020',
444
+ 'orderSource'=>'ecommerce',
445
+ 'billToAddress'=>{
446
+ 'name' => 'Mike J. Hammer',
447
+ 'addressLine1' => '2 Main St.',
448
+ 'addressLine2' => 'Apt. 222',
449
+ 'city' => 'Riverside',
450
+ 'state' => 'RI',
451
+ 'zip' => '02915',
452
+ 'country' => 'US'},
453
+ 'card'=>{
454
+ 'number' =>'5112010000000003',
455
+ 'expDate' => '0212',
456
+ 'cardValidationNum' => '261',
457
+ 'type' => 'MC'},
458
+ 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
459
+ }
460
+ hash = customer_hash.merge(@@merchant_hash)
461
+ authorization_response = LitleOnlineRequest.new.authorization(hash)
462
+ assert_equal('000', authorization_response.authorizationResponse.response)
463
+ assert_equal('Approved', authorization_response.authorizationResponse.message)
464
+ assert_equal('22222', authorization_response.authorizationResponse.authCode)
465
+ assert_equal('10', authorization_response.authorizationResponse.fraudResult.avsResult)
466
+ assert_equal('M', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
467
+
468
+ #test 33A
469
+ authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId}
470
+ hash1b = authReversal_hash.merge(@@merchant_hash)
471
+ authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
472
+ assert_equal('000', authReversal_response.authReversalResponse.response)
473
+ assert_equal('Approved', authReversal_response.authReversalResponse.message)
474
+ end
475
+
476
+ def test_34
477
+ customer_hash = {
478
+ 'orderId' => '34',
479
+ 'amount' => '30030',
480
+ 'orderSource'=>'ecommerce',
481
+ 'billToAddress'=>{
482
+ 'name' => 'Eileen Jones',
483
+ 'addressLine1' => '3 Main St.',
484
+ 'city' => 'Bloomfield',
485
+ 'state' => 'CT',
486
+ 'zip' => '06002',
487
+ 'country' => 'US'},
488
+ 'card'=>{
489
+ 'number' =>'6011010000000003',
490
+ 'expDate' => '0312',
491
+ 'cardValidationNum' => '758',
492
+ 'type' => 'DI'},
493
+ }
494
+ hash = customer_hash.merge(@@merchant_hash)
495
+ authorization_response = LitleOnlineRequest.new.authorization(hash)
496
+ assert_equal('000', authorization_response.authorizationResponse.response)
497
+ assert_equal('Approved', authorization_response.authorizationResponse.message)
498
+ assert_equal('33333', authorization_response.authorizationResponse.authCode)
499
+ assert_equal('10', authorization_response.authorizationResponse.fraudResult.avsResult)
500
+ assert_equal('M', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
501
+
502
+ #test 34A
503
+ authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId}
504
+ hash1b = authReversal_hash.merge(@@merchant_hash)
505
+ authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
506
+ assert_equal('000', authReversal_response.authReversalResponse.response)
507
+ assert_equal('Approved', authReversal_response.authReversalResponse.message)
508
+ end
509
+
510
+ def test_35
511
+ customer_hash = {
512
+ 'orderId' => '35',
513
+ 'amount' => '40040',
514
+ 'orderSource'=>'ecommerce',
515
+ 'billToAddress'=>{
516
+ 'name' => 'Bob Black',
517
+ 'addressLine1' => '4 Main St.',
518
+ 'city' => 'Laurel',
519
+ 'state' => 'MD',
520
+ 'zip' => '20708',
521
+ 'country' => 'US'},
522
+ 'card'=>{
523
+ 'number' =>'375001000000005',
524
+ 'expDate' => '0412',
525
+ 'type' => 'AX'}
526
+ }
527
+ hash = customer_hash.merge(@@merchant_hash)
528
+ authorization_response = LitleOnlineRequest.new.authorization(hash)
529
+ assert_equal('000', authorization_response.authorizationResponse.response)
530
+ assert_equal('Approved', authorization_response.authorizationResponse.message)
531
+ assert_equal('44444', authorization_response.authorizationResponse.authCode)
532
+ assert_equal('12', authorization_response.authorizationResponse.fraudResult.avsResult)
533
+
534
+ #test 35A
535
+ capture_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
536
+ hash32a = capture_hash.merge(@@merchant_hash)
537
+ capture_response = LitleOnlineRequest.new.capture(hash32a)
538
+ assert_equal('000', capture_response.captureResponse.response)
539
+ assert_equal('Approved', capture_response.captureResponse.message)
540
+
541
+ #test 35B
542
+ authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
543
+ hash1b = authReversal_hash.merge(@@merchant_hash)
544
+ authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
545
+ assert_equal('000', authReversal_response.authReversalResponse.response)
546
+ assert_equal('Approved', authReversal_response.authReversalResponse.message)
547
+ end
548
+
549
+ def test_36
550
+ customer_hash = {
551
+ 'orderId' => '36',
552
+ 'amount' => '20500',
553
+ 'orderSource'=>'ecommerce',
554
+ 'card'=>{
555
+ 'number' =>'375000026600004',
556
+ 'expDate' => '0512',
557
+ 'type' => 'AX'},
558
+ }
559
+ hash = customer_hash.merge(@@merchant_hash)
560
+ authorization_response = LitleOnlineRequest.new.authorization(hash)
561
+ assert_equal('000', authorization_response.authorizationResponse.response)
562
+ assert_equal('Approved', authorization_response.authorizationResponse.message)
563
+
564
+ #test 36A
565
+ authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '10000'}
566
+ hash1b = authReversal_hash.merge(@@merchant_hash)
567
+ authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
568
+ assert_equal('336', authReversal_response.authReversalResponse.response)
569
+ assert_equal('Reversal Amount does not match Authorization amount', authReversal_response.authReversalResponse.message)
570
+ end
547
571
 
548
- def test_36
549
- customer_hash = {
550
- 'orderId' => '36',
551
- 'amount' => '20500',
552
- 'orderSource'=>'ecommerce',
553
- 'card'=>{
554
- 'number' =>'375000026600004',
555
- 'expDate' => '0512',
556
- 'type' => 'AX'},
557
- }
558
- hash = customer_hash.merge(@@merchant_hash)
559
- authorization_response = LitleOnlineRequest.new.authorization(hash)
560
- assert_equal('000', authorization_response.authorizationResponse.response)
561
- assert_equal('Approved', authorization_response.authorizationResponse.message)
562
-
563
- #test 36A
564
- authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '10000'}
565
- hash1b = authReversal_hash.merge(@@merchant_hash)
566
- authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
567
- assert_equal('336', authReversal_response.authReversalResponse.response)
568
- assert_equal('Reversal Amount does not match Authorization amount', authReversal_response.authReversalResponse.message)
569
572
  end
570
-
571
- end
573
+ end