LitleOnline 8.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/DESCRIPTION +5 -0
  2. data/LICENSE +22 -0
  3. data/README.md +69 -0
  4. data/Rakefile +92 -0
  5. data/SETUP.md +47 -0
  6. data/bin/Setup.rb +103 -0
  7. data/bin/sample_driver.rb +49 -0
  8. data/index.html +176 -0
  9. data/index.html.1 +176 -0
  10. data/lib/Checker.rb +56 -0
  11. data/lib/Communications.rb +85 -0
  12. data/lib/Configuration.rb +45 -0
  13. data/lib/LitleOnline.rb +52 -0
  14. data/lib/LitleOnlineRequest.rb +399 -0
  15. data/lib/LitleXmlMapper.rb +48 -0
  16. data/lib/Obj2xml.rb +37 -0
  17. data/lib/XMLFields.rb +378 -0
  18. data/test/certification/certTest1_base.rb +948 -0
  19. data/test/certification/certTest2_authenhanced.rb +571 -0
  20. data/test/certification/certTest3_authreversal.rb +184 -0
  21. data/test/certification/certTest4_echeck.rb +279 -0
  22. data/test/certification/certTest5_token.rb +222 -0
  23. data/test/certification/ts_all.rb +31 -0
  24. data/test/functional/test_auth.rb +135 -0
  25. data/test/functional/test_authReversal.rb +68 -0
  26. data/test/functional/test_capture.rb +71 -0
  27. data/test/functional/test_captureGivenAuth.rb +161 -0
  28. data/test/functional/test_credit.rb +154 -0
  29. data/test/functional/test_echeckCredit.rb +116 -0
  30. data/test/functional/test_echeckRedeposit.rb +78 -0
  31. data/test/functional/test_echeckSale.rb +157 -0
  32. data/test/functional/test_echeckVerification.rb +92 -0
  33. data/test/functional/test_forceCapture.rb +105 -0
  34. data/test/functional/test_sale.rb +198 -0
  35. data/test/functional/test_token.rb +102 -0
  36. data/test/functional/test_xmlfields.rb +403 -0
  37. data/test/functional/ts_all.rb +39 -0
  38. data/test/unit/test_Checker.rb +58 -0
  39. data/test/unit/test_LitleOnlineRequest.rb +288 -0
  40. data/test/unit/test_auth.rb +168 -0
  41. data/test/unit/test_authReversal.rb +41 -0
  42. data/test/unit/test_capture.rb +40 -0
  43. data/test/unit/test_captureGivenAuth.rb +108 -0
  44. data/test/unit/test_credit.rb +117 -0
  45. data/test/unit/test_echeckCredit.rb +45 -0
  46. data/test/unit/test_echeckRedeposit.rb +76 -0
  47. data/test/unit/test_echeckSale.rb +45 -0
  48. data/test/unit/test_echeckVerification.rb +75 -0
  49. data/test/unit/test_forceCapture.rb +122 -0
  50. data/test/unit/test_sale.rb +249 -0
  51. data/test/unit/test_token.rb +70 -0
  52. data/test/unit/test_xmlfields.rb +173 -0
  53. data/test/unit/ts_unit.rb +41 -0
  54. metadata +166 -0
@@ -0,0 +1,571 @@
1
+ require 'lib/LitleOnline'
2
+ require 'test/unit'
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
+ }
21
+ }
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)
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'
41
+ }
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'
62
+ }
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'
83
+ }
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'
104
+ }
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'
125
+ }
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'
146
+ }
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_2118698
159
+ customer_hash = {
160
+ 'orderId' => '21',
161
+ 'amount' => '5000',
162
+ 'orderSource'=>'ecommerce',
163
+ 'card'=>{
164
+ 'number' =>'4457010201000246',
165
+ 'expDate' => '0912',
166
+ 'type' => 'VI'
167
+ }
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'
185
+ }
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'
203
+ }
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'
221
+ }
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'
263
+ }
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'
287
+ }
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'
311
+ }
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'
338
+ }
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'
365
+ }
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'
390
+ }
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.authReversal(hash1b)
435
+ assert_equal('111', authReversal_response.authReversalResponse.response)
436
+ assert_equal('Authorization amount has already been depleted', authReversal_response.authReversalResponse.message)
437
+ end
438
+
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.authReversal(hash1b)
471
+ assert_equal('000', authReversal_response.authReversalResponse.response)
472
+ assert_equal('Approved', authReversal_response.authReversalResponse.message)
473
+ end
474
+
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.authReversal(hash1b)
505
+ assert_equal('000', authReversal_response.authReversalResponse.response)
506
+ assert_equal('Approved', authReversal_response.authReversalResponse.message)
507
+ end
508
+
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.authReversal(hash1b)
544
+ assert_equal('000', authReversal_response.authReversalResponse.response)
545
+ assert_equal('Approved', authReversal_response.authReversalResponse.message)
546
+ end
547
+
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.authReversal(hash1b)
567
+ assert_equal('336', authReversal_response.authReversalResponse.response)
568
+ assert_equal('Reversal Amount does not match Authorization amount', authReversal_response.authReversalResponse.message)
569
+ end
570
+
571
+ end