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
@@ -3,942 +3,944 @@ require 'lib/LitleOnline'
3
3
  #require 'Litle_activemerchant'
4
4
  require 'test/unit'
5
5
 
6
- class Litle_certTest < Test::Unit::TestCase
7
- @@merchant_hash = {'reportGroup'=>'Planets',
8
- 'merchantId'=>'101'
9
- }
10
-
11
- def test_1_auth
12
- customer_hash = {
13
- 'orderId' => '1',
14
- 'amount' => '10010',
15
- 'orderSource'=>'ecommerce',
16
- 'billToAddress'=>{
17
- 'name' => 'John Smith',
18
- 'addressLine1' => '1 Main St.',
19
- 'city' => 'Burlington',
20
- 'state' => 'MA',
21
- 'zip' => '01803-3747',
22
- 'country' => 'US'},
23
- 'card'=>{
24
- 'number' =>'4457010000000009',
25
- 'expDate' => '0112',
26
- 'cardValidationNum' => '349',
27
- 'type' => 'VI'}
28
- }
29
- hash = customer_hash.merge(@@merchant_hash)
30
- auth_response = LitleOnlineRequest.new.authorization(hash)
31
- assert_equal('000', auth_response.authorizationResponse.response)
32
- assert_equal('Approved', auth_response.authorizationResponse.message)
33
- assert_equal('11111 ', auth_response.authorizationResponse.authCode)
34
- assert_equal('01', auth_response.authorizationResponse.fraudResult.avsResult)
35
- assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
36
-
37
- #test 1A
38
- capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
39
- hash1a = capture_hash.merge(@@merchant_hash)
40
- capture_response = LitleOnlineRequest.new.capture(hash1a)
41
- assert_equal('000', capture_response.captureResponse.response)
42
- assert_equal('Approved', capture_response.captureResponse.message)
43
-
44
- #test 1B
45
- credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
46
- hash1b = credit_hash.merge(@@merchant_hash)
47
- credit_response = LitleOnlineRequest.new.credit(hash1b)
48
- assert_equal('000', credit_response.creditResponse.response)
49
- assert_equal('Approved', credit_response.creditResponse.message)
50
-
51
- #test1C
52
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
53
- hash1c = void_hash.merge(@@merchant_hash)
54
- void_response = LitleOnlineRequest.new.void(hash1c)
55
- assert_equal('000', void_response.voidResponse.response)
56
- assert_equal('Approved', void_response.voidResponse.message)
57
- end
58
-
59
- def test_1_AVS
60
- customer_hash = {
61
- 'orderId' => '1',
62
- 'amount' => '0',
63
- 'orderSource'=>'ecommerce',
64
- 'billToAddress'=>{
65
- 'name' => 'John Smith',
66
- 'addressLine1' => '1 Main St.',
67
- 'city' => 'Burlington',
68
- 'state' => 'MA',
69
- 'zip' => '01803-3747',
70
- 'country' => 'US'},
71
- 'card'=>{
72
- 'number' =>'4457010000000009',
73
- 'expDate' => '0112',
74
- 'cardValidationNum' => '349',
75
- 'type' => 'VI'}
76
- }
77
- hash = customer_hash.merge(@@merchant_hash)
78
- auth_response = LitleOnlineRequest.new.authorization(hash)
79
- assert_equal('000', auth_response.authorizationResponse.response)
80
- assert_equal('Approved', auth_response.authorizationResponse.message)
81
- assert_equal('11111 ', auth_response.authorizationResponse.authCode)
82
- assert_equal('01', auth_response.authorizationResponse.fraudResult.avsResult)
83
- assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
84
- end
85
-
86
- def test_1_sale
87
- customer_hash = {
88
- 'orderId' => '1',
89
- 'amount' => '10010',
90
- 'orderSource'=>'ecommerce',
91
- 'billToAddress'=>{
92
- 'name' => 'John Smith',
93
- 'addressLine1' => '1 Main St.',
94
- 'city' => 'Burlington',
95
- 'state' => 'MA',
96
- 'zip' => '01803-3747',
97
- 'country' => 'US'},
98
- 'card'=>{
99
- 'number' =>'4457010000000009',
100
- 'expDate' => '0112',
101
- 'cardValidationNum' => '349',
102
- 'type' => 'VI'}
103
- }
104
- hash = customer_hash.merge(@@merchant_hash)
105
- sale_response = LitleOnlineRequest.new.sale(hash)
106
- assert_equal('000', sale_response.saleResponse.response)
107
- assert_equal('Approved', sale_response.saleResponse.message)
108
- assert_equal('11111 ', sale_response.saleResponse.authCode)
109
- assert_equal('01', sale_response.saleResponse.fraudResult.avsResult)
110
- assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
111
-
112
- #test 1B
113
- credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
114
- hash1b = credit_hash.merge(@@merchant_hash)
115
- credit_response = LitleOnlineRequest.new.credit(hash1b)
116
- assert_equal('000', credit_response.creditResponse.response)
117
- assert_equal('Approved', credit_response.creditResponse.message)
118
-
119
- #test1C
120
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
121
- hash1c = void_hash.merge(@@merchant_hash)
122
- void_response = LitleOnlineRequest.new.void(hash1c)
123
- assert_equal('000', void_response.voidResponse.response)
124
- assert_equal('Approved', void_response.voidResponse.message)
125
- end
126
-
127
- def test_2_auth
128
- customer_hash = {
129
- 'orderId' => '2',
130
- 'amount' => '20020',
131
- 'orderSource'=>'ecommerce',
132
- 'billToAddress'=>{
133
- 'name' => 'Mike J. Hammer',
134
- 'addressLine1' => '2 Main St.',
135
- 'addressLine2' => 'Apt. 222',
136
- 'city' => 'Riverside',
137
- 'state' => 'RI',
138
- 'zip' => '02915',
139
- 'country' => 'US'},
140
- 'card'=>{
141
- 'number' =>'5112010000000003',
142
- 'expDate' => '0212',
143
- 'cardValidationNum' => '261',
144
- 'type' => 'MC'
145
- },
146
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
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('22222', auth_response.authorizationResponse.authCode)
153
- assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
154
- assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
155
-
156
- #test 2A
157
- capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
158
- hash2a = capture_hash.merge(@@merchant_hash)
159
- capture_response = LitleOnlineRequest.new.capture(hash2a)
160
- assert_equal('000', capture_response.captureResponse.response)
161
- assert_equal('Approved', capture_response.captureResponse.message)
162
-
163
- #test 2B
164
- credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
165
- hash2b = credit_hash.merge(@@merchant_hash)
166
- credit_response = LitleOnlineRequest.new.credit(hash2b)
167
- assert_equal('000', credit_response.creditResponse.response)
168
- assert_equal('Approved', credit_response.creditResponse.message)
169
-
170
- #test 2C
171
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
172
- hash2c = void_hash.merge(@@merchant_hash)
173
- void_response = LitleOnlineRequest.new.void(hash2c)
174
- assert_equal('000', void_response.voidResponse.response)
175
- assert_equal('Approved', void_response.voidResponse.message)
176
- end
177
-
178
- def test_2_avs
179
- customer_hash = {
180
- 'orderId' => '2',
181
- 'amount' => '0',
182
- 'orderSource'=>'ecommerce',
183
- 'billToAddress'=>{
184
- 'name' => 'Mike J. Hammer',
185
- 'addressLine1' => '2 Main St.',
186
- 'addressLine2' => 'Apt. 222',
187
- 'city' => 'Riverside',
188
- 'state' => 'RI',
189
- 'zip' => '02915',
190
- 'country' => 'US'},
191
- 'card'=>{
192
- 'number' =>'5112010000000003',
193
- 'expDate' => '0212',
194
- 'cardValidationNum' => '261',
195
- 'type' => 'MC'
196
- },
197
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
198
- }
199
- hash = customer_hash.merge(@@merchant_hash)
200
- auth_response = LitleOnlineRequest.new.authorization(hash)
201
- assert_equal('000', auth_response.authorizationResponse.response)
202
- assert_equal('Approved', auth_response.authorizationResponse.message)
203
- assert_equal('22222', auth_response.authorizationResponse.authCode)
204
- assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
205
- assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
206
- end
207
-
208
- def test_2_sale
209
- customer_hash = {
210
- 'orderId' => '2',
211
- 'amount' => '20020',
212
- 'orderSource'=>'ecommerce',
213
- 'billToAddress'=>{
214
- 'name' => 'Mike J. Hammer',
215
- 'addressLine1' => '2 Main St.',
216
- 'addressLine2' => 'Apt. 222',
217
- 'city' => 'Riverside',
218
- 'state' => 'RI',
219
- 'zip' => '02915',
220
- 'country' => 'US'},
221
- 'card'=>{
222
- 'number' =>'5112010000000003',
223
- 'expDate' => '0212',
224
- 'cardValidationNum' => '261',
225
- 'type' => 'MC'
226
- },
227
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
228
- }
229
- hash = customer_hash.merge(@@merchant_hash)
230
- sale_response = LitleOnlineRequest.new.sale(hash)
231
- assert_equal('000', sale_response.saleResponse.response)
232
- assert_equal('Approved', sale_response.saleResponse.message)
233
- assert_equal('22222', sale_response.saleResponse.authCode)
234
- assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
235
- assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
236
-
237
- #test 2B
238
- credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
239
- hash2b = credit_hash.merge(@@merchant_hash)
240
- credit_response = LitleOnlineRequest.new.credit(hash2b)
241
- assert_equal('000', credit_response.creditResponse.response)
242
- assert_equal('Approved', credit_response.creditResponse.message)
243
-
244
- #test 2C
245
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
246
- hash2c = void_hash.merge(@@merchant_hash)
247
- void_response = LitleOnlineRequest.new.void(hash2c)
248
- assert_equal('000', void_response.voidResponse.response)
249
- assert_equal('Approved', void_response.voidResponse.message)
250
- end
251
-
252
- def test_3_auth
253
- customer_hash = {
254
- 'orderId' => '3',
255
- 'amount' => '30030',
256
- 'orderSource'=>'ecommerce',
257
- 'billToAddress'=>{
258
- 'name' => 'Eileen Jones',
259
- 'addressLine1' => '3 Main St.',
260
- 'city' => 'Bloomfield',
261
- 'state' => 'CT',
262
- 'zip' => '06002',
263
- 'country' => 'US'},
264
- 'card'=>{
265
- 'number' =>'6011010000000003',
266
- 'expDate' => '0312',
267
- 'type' => 'DI',
268
- 'cardValidationNum' => '758'},
269
- }
270
- hash = customer_hash.merge(@@merchant_hash)
271
- auth_response = LitleOnlineRequest.new.authorization(hash)
272
- assert_equal('000', auth_response.authorizationResponse.response)
273
- assert_equal('Approved', auth_response.authorizationResponse.message)
274
- assert_equal('33333', auth_response.authorizationResponse.authCode)
275
- assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
276
- assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
277
-
278
- #test 3A
279
- capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
280
- hash2a = capture_hash.merge(@@merchant_hash)
281
- capture_response = LitleOnlineRequest.new.capture(hash2a)
282
- assert_equal('000', capture_response.captureResponse.response)
283
- assert_equal('Approved', capture_response.captureResponse.message)
284
-
285
- #test 3B
286
- credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
287
- hash2b = credit_hash.merge(@@merchant_hash)
288
- credit_response = LitleOnlineRequest.new.credit(hash2b)
289
- assert_equal('000', credit_response.creditResponse.response)
290
- assert_equal('Approved', credit_response.creditResponse.message)
291
-
292
- #test 3C
293
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
294
- hash2c = void_hash.merge(@@merchant_hash)
295
- void_response = LitleOnlineRequest.new.void(hash2c)
296
- assert_equal('000', void_response.voidResponse.response)
297
- assert_equal('Approved', void_response.voidResponse.message)
298
- end
299
-
300
- def test_3_avs
301
- customer_hash = {
302
- 'orderId' => '3',
303
- 'amount' => '0',
304
- 'orderSource'=>'ecommerce',
305
- 'billToAddress'=>{
306
- 'name' => 'Eileen Jones',
307
- 'addressLine1' => '3 Main St.',
308
- 'city' => 'Bloomfield',
309
- 'state' => 'CT',
310
- 'zip' => '06002',
311
- 'country' => 'US'},
312
- 'card'=>{
313
- 'number' =>'6011010000000003',
314
- 'expDate' => '0312',
315
- 'type' => 'DI',
316
- 'cardValidationNum' => '758'},
317
- }
318
- hash = customer_hash.merge(@@merchant_hash)
319
- auth_response = LitleOnlineRequest.new.authorization(hash)
320
- assert_equal('000', auth_response.authorizationResponse.response)
321
- assert_equal('Approved', auth_response.authorizationResponse.message)
322
- assert_equal('33333', auth_response.authorizationResponse.authCode)
323
- assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
324
- assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
325
- end
326
-
327
- def test_3_sale
328
- customer_hash = {
329
- 'orderId' => '3',
330
- 'amount' => '30030',
331
- 'orderSource'=>'ecommerce',
332
- 'billToAddress'=>{
333
- 'name' => 'Eileen Jones',
334
- 'addressLine1' => '3 Main St.',
335
- 'city' => 'Bloomfield',
336
- 'state' => 'CT',
337
- 'zip' => '06002',
338
- 'country' => 'US'},
339
- 'card'=>{
340
- 'number' =>'6011010000000003',
341
- 'expDate' => '0312',
342
- 'type' => 'DI',
343
- 'cardValidationNum' => '758'},
344
- }
345
- hash = customer_hash.merge(@@merchant_hash)
346
- sale_response = LitleOnlineRequest.new.sale(hash)
347
- assert_equal('000', sale_response.saleResponse.response)
348
- assert_equal('Approved', sale_response.saleResponse.message)
349
- assert_equal('33333', sale_response.saleResponse.authCode)
350
- assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
351
- assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
352
-
353
- #test 3B
354
- credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
355
- hash2b = credit_hash.merge(@@merchant_hash)
356
- credit_response = LitleOnlineRequest.new.credit(hash2b)
357
- assert_equal('000', credit_response.creditResponse.response)
358
- assert_equal('Approved', credit_response.creditResponse.message)
359
-
360
- #test 3C
361
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
362
- hash2c = void_hash.merge(@@merchant_hash)
363
- void_response = LitleOnlineRequest.new.void(hash2c)
364
- assert_equal('000', void_response.voidResponse.response)
365
- assert_equal('Approved', void_response.voidResponse.message)
366
- end
367
-
368
- def test_4_auth
369
- customer_hash = {
370
- 'orderId' => '4',
371
- 'amount' => '40040',
372
- 'orderSource'=>'ecommerce',
373
- 'billToAddress'=>{
374
- 'name' => 'Bob Black',
375
- 'addressLine1' => '4 Main St.',
376
- 'city' => 'Laurel',
377
- 'state' => 'MD',
378
- 'zip' => '20708',
379
- 'country' => 'US'},
380
- 'card'=>{
381
- 'number' =>'375001000000005',
382
- 'expDate' => '0412',
383
- 'type' => 'AX'
384
- },
385
- }
386
- hash = customer_hash.merge(@@merchant_hash)
387
- auth_response = LitleOnlineRequest.new.authorization(hash)
388
- assert_equal('000', auth_response.authorizationResponse.response)
389
- assert_equal('Approved', auth_response.authorizationResponse.message)
390
- assert_equal('44444', auth_response.authorizationResponse.authCode)
391
- assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
392
-
393
- #test 4A
394
- capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
395
- hash2a = capture_hash.merge(@@merchant_hash)
396
- capture_response = LitleOnlineRequest.new.capture(hash2a)
397
- assert_equal('Approved', capture_response.captureResponse.message)
398
-
399
- #test 4B
400
- credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
401
- hash2b = credit_hash.merge(@@merchant_hash)
402
- credit_response = LitleOnlineRequest.new.credit(hash2b)
403
- assert_equal('000', credit_response.creditResponse.response)
404
- assert_equal('Approved', credit_response.creditResponse.message)
405
-
406
- #test 4C
407
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
408
- hash2c = void_hash.merge(@@merchant_hash)
409
- void_response = LitleOnlineRequest.new.void(hash2c)
410
- assert_equal('000', void_response.voidResponse.response)
411
- assert_equal('Approved', void_response.voidResponse.message)
412
- end
413
-
414
- def test_4_avs
415
- customer_hash = {
416
- 'orderId' => '4',
417
- 'amount' => '0',
418
- 'orderSource'=>'ecommerce',
419
- 'billToAddress'=>{
420
- 'name' => 'Bob Black',
421
- 'addressLine1' => '4 Main St.',
422
- 'city' => 'Laurel',
423
- 'state' => 'MD',
424
- 'zip' => '20708',
425
- 'country' => 'US'},
426
- 'card'=>{
427
- 'number' =>'375001000000005',
428
- 'expDate' => '0412',
429
- 'type' => 'AX'
430
- },
431
- }
432
- hash = customer_hash.merge(@@merchant_hash)
433
- auth_response = LitleOnlineRequest.new.authorization(hash)
434
- assert_equal('000', auth_response.authorizationResponse.response)
435
- assert_equal('Approved', auth_response.authorizationResponse.message)
436
- assert_equal('44444', auth_response.authorizationResponse.authCode)
437
- assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
438
- end
439
-
440
- def test_4_sale
441
- customer_hash = {
442
- 'orderId' => '4',
443
- 'amount' => '40040',
444
- 'orderSource'=>'ecommerce',
445
- 'billToAddress'=>{
446
- 'name' => 'Bob Black',
447
- 'addressLine1' => '4 Main St.',
448
- 'city' => 'Laurel',
449
- 'state' => 'MD',
450
- 'zip' => '20708',
451
- 'country' => 'US'},
452
- 'card'=>{
453
- 'number' =>'375001000000005',
454
- 'expDate' => '0412',
455
- 'type' => 'AX'
456
- },
457
- }
458
- hash = customer_hash.merge(@@merchant_hash)
459
- sale_response = LitleOnlineRequest.new.sale(hash)
460
- assert_equal('000', sale_response.saleResponse.response)
461
- assert_equal('Approved', sale_response.saleResponse.message)
462
- assert_equal('44444', sale_response.saleResponse.authCode)
463
- assert_equal('12', sale_response.saleResponse.fraudResult.avsResult)
464
-
465
- #test 4B
466
- credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
467
- hash2b = credit_hash.merge(@@merchant_hash)
468
- credit_response = LitleOnlineRequest.new.credit(hash2b)
469
- assert_equal('000', credit_response.creditResponse.response)
470
- assert_equal('Approved', credit_response.creditResponse.message)
471
-
472
- #test 4C
473
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
474
- hash2c = void_hash.merge(@@merchant_hash)
475
- void_response = LitleOnlineRequest.new.void(hash2c)
476
- assert_equal('000', void_response.voidResponse.response)
477
- assert_equal('Approved', void_response.voidResponse.message)
478
- end
479
-
480
- def test_5_auth
481
- customer_hash = {
482
- 'orderId' => '5',
483
- 'amount' => '50050',
484
- 'orderSource'=>'ecommerce',
485
- 'card'=>{
486
- 'number' =>'4457010200000007',
487
- 'expDate' => '0512',
488
- 'cardValidationNum' => '463',
489
- 'type' => 'VI'},
490
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
491
- }
492
- hash = customer_hash.merge(@@merchant_hash)
493
- auth_response = LitleOnlineRequest.new.authorization(hash)
494
- assert_equal('000', auth_response.authorizationResponse.response)
495
- assert_equal('Approved', auth_response.authorizationResponse.message)
496
- assert_equal('55555 ', auth_response.authorizationResponse.authCode)
497
- assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
498
- assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
499
-
500
- #test 5A
501
- capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
502
- hash2a = capture_hash.merge(@@merchant_hash)
503
- capture_response = LitleOnlineRequest.new.capture(hash2a)
504
- assert_equal('000', capture_response.captureResponse.response)
505
- assert_equal('Approved', capture_response.captureResponse.message)
506
-
507
- #test 5B
508
- credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
509
- hash2b = credit_hash.merge(@@merchant_hash)
510
- credit_response = LitleOnlineRequest.new.credit(hash2b)
511
- assert_equal('000', credit_response.creditResponse.response)
512
- assert_equal('Approved', credit_response.creditResponse.message)
513
-
514
- #test 5C
515
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
516
- hash2c = void_hash.merge(@@merchant_hash)
517
- void_response = LitleOnlineRequest.new.void(hash2c)
518
- assert_equal('000', void_response.voidResponse.response)
519
- assert_equal('Approved', void_response.voidResponse.message)
520
- end
521
-
522
- def test_5_avs
523
- customer_hash = {
524
- 'orderId' => '5',
525
- 'amount' => '0',
526
- 'orderSource'=>'ecommerce',
527
- 'card'=>{
528
- 'number' =>'4457010200000007',
529
- 'expDate' => '0512',
530
- 'cardValidationNum' => '463',
531
- 'type' => 'VI'},
532
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
533
- }
534
- hash = customer_hash.merge(@@merchant_hash)
535
- auth_response = LitleOnlineRequest.new.authorization(hash)
536
- assert_equal('000', auth_response.authorizationResponse.response)
537
- assert_equal('Approved', auth_response.authorizationResponse.message)
538
- assert_equal('55555 ', auth_response.authorizationResponse.authCode)
539
- assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
540
- assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
541
- end
542
-
543
- def test_5_sale
544
- customer_hash = {
545
- 'orderId' => '5',
546
- 'amount' => '50050',
547
- 'orderSource'=>'ecommerce',
548
- 'card'=>{
549
- 'number' =>'4457010200000007',
550
- 'expDate' => '0512',
551
- 'cardValidationNum' => '463',
552
- 'type' => 'VI'},
553
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
554
- }
555
- hash = customer_hash.merge(@@merchant_hash)
556
- sale_response = LitleOnlineRequest.new.sale(hash)
557
- assert_equal('000', sale_response.saleResponse.response)
558
- assert_equal('Approved', sale_response.saleResponse.message)
559
- assert_equal('55555 ', sale_response.saleResponse.authCode)
560
- assert_equal('32', sale_response.saleResponse.fraudResult.avsResult)
561
- assert_equal('N', sale_response.saleResponse.fraudResult.cardValidationResult)
562
-
563
- #test 5B
564
- credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
565
- hash2b = credit_hash.merge(@@merchant_hash)
566
- credit_response = LitleOnlineRequest.new.credit(hash2b)
567
- assert_equal('000', credit_response.creditResponse.response)
568
- assert_equal('Approved', credit_response.creditResponse.message)
569
-
570
- #test 5C
571
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
572
- hash2c = void_hash.merge(@@merchant_hash)
573
- void_response = LitleOnlineRequest.new.void(hash2c)
574
- assert_equal('000', void_response.voidResponse.response)
575
- assert_equal('Approved', void_response.voidResponse.message)
576
- end
577
-
578
- def test_6_auth
579
- customer_hash = {
580
- 'orderId' => '6',
581
- 'amount' => '60060',
582
- 'orderSource'=>'ecommerce',
583
- 'billToAddress'=>{
584
- 'name' => 'Joe Green',
585
- 'addressLine1' => '6 Main St.',
586
- 'city' => 'Derry',
587
- 'state' => 'NH',
588
- 'zip' => '03038',
589
- 'country' => 'US'},
590
- 'card'=>{
591
- 'number' =>'4457010100000008',
592
- 'expDate' => '0612',
593
- 'type' => 'VI',
594
- 'cardValidationNum' => '992'}
6
+ module LitleOnline
7
+ class Litle_certTest < Test::Unit::TestCase
8
+ @@merchant_hash = {'reportGroup'=>'Planets',
9
+ 'merchantId'=>'101'
595
10
  }
596
- hash = customer_hash.merge(@@merchant_hash)
597
- auth_response = LitleOnlineRequest.new.authorization(hash)
598
- assert_equal('110', auth_response.authorizationResponse.response)
599
- assert_equal('Insufficient Funds', auth_response.authorizationResponse.message)
600
- assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
601
- assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
602
- end
603
-
604
- def test_6_sale
605
- customer_hash = {
606
- 'orderId' => '6',
607
- 'amount' => '60060',
608
- 'orderSource'=>'ecommerce',
609
- 'billToAddress'=>{
610
- 'name' => 'Joe Green',
611
- 'addressLine1' => '6 Main St.',
612
- 'city' => 'Derry',
613
- 'state' => 'NH',
614
- 'zip' => '03038',
615
- 'country' => 'US'},
616
- 'card'=>{
617
- 'number' =>'4457010100000008',
618
- 'expDate' => '0612',
619
- 'type' => 'VI',
620
- 'cardValidationNum' => '992'}
621
- }
622
- hash = customer_hash.merge(@@merchant_hash)
623
- sale_response = LitleOnlineRequest.new.sale(hash)
624
- assert_equal('110', sale_response.saleResponse.response)
625
- assert_equal('Insufficient Funds', sale_response.saleResponse.message)
626
- assert_equal('34', sale_response.saleResponse.fraudResult.avsResult)
627
- assert_equal('P', sale_response.saleResponse.fraudResult.cardValidationResult)
628
-
629
- #test 6A
630
- void_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId }
631
- hash6A = void_hash.merge(@@merchant_hash)
632
- void_response = LitleOnlineRequest.new.void(hash6A)
633
- assert_equal('360', void_response.voidResponse.response)
634
- assert_equal('No transaction found with specified litleTxnId', void_response.voidResponse.message)
635
- end
636
-
637
- def test_7_auth
638
- customer_hash = {
639
- 'orderId' => '7',
640
- 'amount' => '70070',
641
- 'orderSource'=>'ecommerce',
642
- 'billToAddress'=>{
643
- 'name' => 'Jane Murray',
644
- 'addressLine1' => '7 Main St.',
645
- 'city' => 'Amesbury',
646
- 'state' => 'MA',
647
- 'zip' => '01913',
648
- 'country' => 'US'},
649
- 'card'=>{
650
- 'number' =>'5112010100000002',
651
- 'expDate' => '0712',
652
- 'cardValidationNum' => '251',
653
- 'type' => 'MC'}
654
- }
655
- hash = customer_hash.merge(@@merchant_hash)
656
- authorization_response = LitleOnlineRequest.new.authorization(hash)
657
- assert_equal('301', authorization_response.authorizationResponse.response)
658
- assert_equal('Invalid Account Number', authorization_response.authorizationResponse.message)
659
- assert_equal('34', authorization_response.authorizationResponse.fraudResult.avsResult)
660
- assert_equal('N', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
661
- end
662
-
663
- def test_7_avs
664
- customer_hash = {
665
- 'orderId' => '7',
666
- 'amount' => '0',
667
- 'orderSource'=>'ecommerce',
668
- 'billToAddress'=>{
669
- 'name' => 'Jane Murray',
670
- 'addressLine1' => '7 Main St.',
671
- 'city' => 'Amesbury',
672
- 'state' => 'MA',
673
- 'zip' => '01913',
674
- 'country' => 'US'},
675
- 'card'=>{
676
- 'number' =>'5112010100000002',
677
- 'expDate' => '0712',
678
- 'cardValidationNum' => '251',
679
- 'type' => 'MC'}
680
- }
681
- hash = customer_hash.merge(@@merchant_hash)
682
- authorization_response = LitleOnlineRequest.new.authorization(hash)
683
- assert_equal('301', authorization_response.authorizationResponse.response)
684
- assert_equal('Invalid Account Number', authorization_response.authorizationResponse.message)
685
- assert_equal('34', authorization_response.authorizationResponse.fraudResult.avsResult)
686
- assert_equal('N', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
687
- end
688
-
689
- def test_7_sale
690
- customer_hash = {
691
- 'orderId' => '7',
692
- 'amount' => '70070',
693
- 'orderSource'=>'ecommerce',
694
- 'billToAddress'=>{
695
- 'name' => 'Jane Murray',
696
- 'addressLine1' => '7 Main St.',
697
- 'city' => 'Amesbury',
698
- 'state' => 'MA',
699
- 'zip' => '01913',
700
- 'country' => 'US'},
701
- 'card'=>{
702
- 'number' =>'5112010100000002',
703
- 'expDate' => '0712',
704
- 'cardValidationNum' => '251',
705
- 'type' => 'MC'}
706
- }
707
- hash = customer_hash.merge(@@merchant_hash)
708
- sale_response = LitleOnlineRequest.new.sale(hash)
709
- assert_equal('301', sale_response.saleResponse.response)
710
- assert_equal('Invalid Account Number', sale_response.saleResponse.message)
711
- assert_equal('34', sale_response.saleResponse.fraudResult.avsResult)
712
- assert_equal('N', sale_response.saleResponse.fraudResult.cardValidationResult)
713
- end
714
-
715
- def test_8_auth
716
- customer_hash = {
717
- 'orderId' => '8',
718
- 'amount' => '80080',
719
- 'orderSource'=>'ecommerce',
720
- 'billToAddress'=>{
721
- 'name' => 'Mark Johnson',
722
- 'addressLine1' => '8 Main St.',
723
- 'city' => 'Manchester',
724
- 'state' => 'NH',
725
- 'zip' => '03101',
726
- 'country' => 'US'},
727
- 'card'=>{
728
- 'number' =>'6011010100000002',
729
- 'expDate' => '0812',
730
- 'type' => 'DI',
731
- 'cardValidationNum' => '184'}
732
- }
733
- hash = customer_hash.merge(@@merchant_hash)
734
- auth_response = LitleOnlineRequest.new.authorization(hash)
735
- assert_equal('123', auth_response.authorizationResponse.response)
736
- assert_equal('Call Discover', auth_response.authorizationResponse.message)
737
- assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
738
- assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
739
- end
740
-
741
- def test_8_avs
742
- customer_hash = {
743
- 'orderId' => '8',
744
- 'amount' => '0',
745
- 'orderSource'=>'ecommerce',
746
- 'billToAddress'=>{
747
- 'name' => 'Mark Johnson',
748
- 'addressLine1' => '8 Main St.',
749
- 'city' => 'Manchester',
750
- 'state' => 'NH',
751
- 'zip' => '03101',
752
- 'country' => 'US'},
753
- 'card'=>{
754
- 'number' =>'6011010100000002',
755
- 'expDate' => '0812',
756
- 'type' => 'DI',
757
- 'cardValidationNum' => '184'}
758
- }
759
- hash = customer_hash.merge(@@merchant_hash)
760
- auth_response = LitleOnlineRequest.new.authorization(hash)
761
- assert_equal('123', auth_response.authorizationResponse.response)
762
- assert_equal('Call Discover', auth_response.authorizationResponse.message)
763
- assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
764
- assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
765
- end
766
-
767
- def test_8_sale
768
- customer_hash = {
769
- 'orderId' => '8',
770
- 'amount' => '80080',
771
- 'orderSource'=>'ecommerce',
772
- 'billToAddress'=>{
773
- 'name' => 'Mark Johnson',
774
- 'addressLine1' => '8 Main St.',
775
- 'city' => 'Manchester',
776
- 'state' => 'NH',
777
- 'zip' => '03101',
778
- 'country' => 'US'},
779
- 'card'=>{
780
- 'number' =>'6011010100000002',
781
- 'expDate' => '0812',
782
- 'type' => 'DI',
783
- 'cardValidationNum' => '184'}
784
- }
785
- hash = customer_hash.merge(@@merchant_hash)
786
- sale_response = LitleOnlineRequest.new.sale(hash)
787
- assert_equal('123', sale_response.saleResponse.response)
788
- assert_equal('Call Discover', sale_response.saleResponse.message)
789
- assert_equal('P', sale_response.saleResponse.fraudResult.cardValidationResult)
790
- assert_equal('34', sale_response.saleResponse.fraudResult.avsResult)
791
- end
792
-
793
- def test_9_auth
794
- customer_hash = {
795
- 'orderId' => '9',
796
- 'amount' => '90090',
797
- 'orderSource'=>'ecommerce',
798
- 'billToAddress'=>{
799
- 'name' => 'James Miller',
800
- 'addressLine1' => '9 Main St.',
801
- 'city' => 'Boston',
802
- 'state' => 'MA',
803
- 'zip' => '02134',
804
- 'country' => 'US'},
805
- 'card'=>{
806
- 'number' =>'375001010000003',
807
- 'expDate' => '0912',
808
- 'cardValidationNum' => '0421',
809
- 'type' => 'AX'
11
+
12
+ def test_1_auth
13
+ customer_hash = {
14
+ 'orderId' => '1',
15
+ 'amount' => '10010',
16
+ 'orderSource'=>'ecommerce',
17
+ 'billToAddress'=>{
18
+ 'name' => 'John Smith',
19
+ 'addressLine1' => '1 Main St.',
20
+ 'city' => 'Burlington',
21
+ 'state' => 'MA',
22
+ 'zip' => '01803-3747',
23
+ 'country' => 'US'},
24
+ 'card'=>{
25
+ 'number' =>'4457010000000009',
26
+ 'expDate' => '0112',
27
+ 'cardValidationNum' => '349',
28
+ 'type' => 'VI'}
810
29
  }
811
- }
812
- hash = customer_hash.merge(@@merchant_hash)
813
- response = LitleOnlineRequest.new.authorization(hash)
814
- assert_equal('303', response.authorizationResponse.response)
815
- assert_equal('Pick Up Card', response.authorizationResponse.message)
816
- assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
817
- end
818
-
819
- def test_9_avs
820
- customer_hash = {
821
- 'orderId' => '9',
822
- 'amount' => '0',
823
- 'orderSource'=>'ecommerce',
824
- 'billToAddress'=>{
825
- 'name' => 'James Miller',
826
- 'addressLine1' => '9 Main St.',
827
- 'city' => 'Boston',
828
- 'state' => 'MA',
829
- 'zip' => '02134',
830
- 'country' => 'US'},
831
- 'card'=>{
832
- 'number' =>'375001010000003',
833
- 'expDate' => '0912',
834
- 'cardValidationNum' => '0421',
835
- 'type' => 'AX'
30
+ hash = customer_hash.merge(@@merchant_hash)
31
+ auth_response = LitleOnlineRequest.new.authorization(hash)
32
+ assert_equal('000', auth_response.authorizationResponse.response)
33
+ assert_equal('Approved', auth_response.authorizationResponse.message)
34
+ assert_equal('11111 ', auth_response.authorizationResponse.authCode)
35
+ assert_equal('01', auth_response.authorizationResponse.fraudResult.avsResult)
36
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
37
+
38
+ #test 1A
39
+ capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
40
+ hash1a = capture_hash.merge(@@merchant_hash)
41
+ capture_response = LitleOnlineRequest.new.capture(hash1a)
42
+ assert_equal('000', capture_response.captureResponse.response)
43
+ assert_equal('Approved', capture_response.captureResponse.message)
44
+
45
+ #test 1B
46
+ credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
47
+ hash1b = credit_hash.merge(@@merchant_hash)
48
+ credit_response = LitleOnlineRequest.new.credit(hash1b)
49
+ assert_equal('000', credit_response.creditResponse.response)
50
+ assert_equal('Approved', credit_response.creditResponse.message)
51
+
52
+ #test1C
53
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
54
+ hash1c = void_hash.merge(@@merchant_hash)
55
+ void_response = LitleOnlineRequest.new.void(hash1c)
56
+ assert_equal('000', void_response.voidResponse.response)
57
+ assert_equal('Approved', void_response.voidResponse.message)
58
+ end
59
+
60
+ def test_1_AVS
61
+ customer_hash = {
62
+ 'orderId' => '1',
63
+ 'amount' => '0',
64
+ 'orderSource'=>'ecommerce',
65
+ 'billToAddress'=>{
66
+ 'name' => 'John Smith',
67
+ 'addressLine1' => '1 Main St.',
68
+ 'city' => 'Burlington',
69
+ 'state' => 'MA',
70
+ 'zip' => '01803-3747',
71
+ 'country' => 'US'},
72
+ 'card'=>{
73
+ 'number' =>'4457010000000009',
74
+ 'expDate' => '0112',
75
+ 'cardValidationNum' => '349',
76
+ 'type' => 'VI'}
836
77
  }
837
- }
838
- hash = customer_hash.merge(@@merchant_hash)
839
- response = LitleOnlineRequest.new.authorization(hash)
840
- assert_equal('303', response.authorizationResponse.response)
841
- assert_equal('Pick Up Card', response.authorizationResponse.message)
842
- assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
843
- end
844
-
845
- def test_9_sale
846
- customer_hash = {
847
- 'orderId' => '9',
848
- 'amount' => '90090',
849
- 'orderSource'=>'ecommerce',
850
- 'billToAddress'=>{
851
- 'name' => 'James Miller',
852
- 'addressLine1' => '9 Main St.',
853
- 'city' => 'Boston',
854
- 'state' => 'MA',
855
- 'zip' => '02134',
856
- 'country' => 'US'},
857
- 'card'=>{
858
- 'number' =>'375001010000003',
859
- 'expDate' => '0912',
860
- 'cardValidationNum' => '0421',
861
- 'type' => 'AX'
78
+ hash = customer_hash.merge(@@merchant_hash)
79
+ auth_response = LitleOnlineRequest.new.authorization(hash)
80
+ assert_equal('000', auth_response.authorizationResponse.response)
81
+ assert_equal('Approved', auth_response.authorizationResponse.message)
82
+ assert_equal('11111 ', auth_response.authorizationResponse.authCode)
83
+ assert_equal('01', auth_response.authorizationResponse.fraudResult.avsResult)
84
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
85
+ end
86
+
87
+ def test_1_sale
88
+ customer_hash = {
89
+ 'orderId' => '1',
90
+ 'amount' => '10010',
91
+ 'orderSource'=>'ecommerce',
92
+ 'billToAddress'=>{
93
+ 'name' => 'John Smith',
94
+ 'addressLine1' => '1 Main St.',
95
+ 'city' => 'Burlington',
96
+ 'state' => 'MA',
97
+ 'zip' => '01803-3747',
98
+ 'country' => 'US'},
99
+ 'card'=>{
100
+ 'number' =>'4457010000000009',
101
+ 'expDate' => '0112',
102
+ 'cardValidationNum' => '349',
103
+ 'type' => 'VI'}
862
104
  }
863
- }
864
- hash = customer_hash.merge(@@merchant_hash)
865
- response = LitleOnlineRequest.new.sale(hash)
866
- assert_equal('303', response.saleResponse.response)
867
- assert_equal('Pick Up Card', response.saleResponse.message)
868
- assert_equal('34', response.saleResponse.fraudResult.avsResult)
869
- end
870
-
871
- def test_10
872
- customer_hash = {
873
- 'orderId' => '10',
874
- 'amount' => '40000',
875
- 'orderSource'=>'ecommerce',
876
- 'card'=>{
877
- 'number' =>'4457010140000141',
878
- 'expDate' => '0912',
879
- 'type' => 'VI'
880
- },
881
- 'allowPartialAuth' => 'true'
882
- }
883
- hash = customer_hash.merge(@@merchant_hash)
884
- auth_response = LitleOnlineRequest.new.authorization(hash)
885
- assert_equal('010', auth_response.authorizationResponse.response)
886
- assert_equal('Partially Approved', auth_response.authorizationResponse.message)
887
- assert_equal('32000', auth_response.authorizationResponse.approvedAmount)
888
- end
889
-
890
- def test_11
891
- customer_hash = {
892
- 'orderId' => '11',
893
- 'amount' => '60000',
894
- 'orderSource'=>'ecommerce',
895
- 'card'=>{
896
- 'number' =>'5112010140000004',
897
- 'expDate' => '1111',
898
- 'type' => 'MC'
899
- },
900
- 'allowPartialAuth' => 'true'
901
- }
902
- hash = customer_hash.merge(@@merchant_hash)
903
- auth_response = LitleOnlineRequest.new.authorization(hash)
904
- assert_equal('010', auth_response.authorizationResponse.response)
905
- assert_equal('Partially Approved', auth_response.authorizationResponse.message)
906
- assert_equal('48000', auth_response.authorizationResponse.approvedAmount)
907
- end
908
-
909
- def test_12
910
- customer_hash = {
911
- 'orderId' => '12',
912
- 'amount' => '50000',
913
- 'orderSource'=>'ecommerce',
914
- 'card'=>{
915
- 'number' =>'375001014000009',
916
- 'expDate' => '0412',
917
- 'type' => 'AX'},
918
- 'allowPartialAuth' => 'true'
919
- }
920
- hash = customer_hash.merge(@@merchant_hash)
921
- auth_response = LitleOnlineRequest.new.authorization(hash)
922
- assert_equal('010', auth_response.authorizationResponse.response)
923
- assert_equal('Partially Approved', auth_response.authorizationResponse.message)
924
- assert_equal('40000', auth_response.authorizationResponse.approvedAmount)
925
- end
926
-
927
- def test_13
928
- customer_hash = {
929
- 'orderId' => '13',
930
- 'amount' => '15000',
931
- 'orderSource'=>'ecommerce',
932
- 'card'=>{
933
- 'number' =>'6011010140000004',
934
- 'expDate' => '0812',
935
- 'type' => 'DI'},
936
- 'allowPartialAuth' => 'true'
937
- }
938
- hash = customer_hash.merge(@@merchant_hash)
939
- auth_response = LitleOnlineRequest.new.authorization(hash)
940
- assert_equal('010', auth_response.authorizationResponse.response)
941
- assert_equal('Partially Approved', auth_response.authorizationResponse.message)
942
- assert_equal('12000', auth_response.authorizationResponse.approvedAmount)
105
+ hash = customer_hash.merge(@@merchant_hash)
106
+ sale_response = LitleOnlineRequest.new.sale(hash)
107
+ assert_equal('000', sale_response.saleResponse.response)
108
+ assert_equal('Approved', sale_response.saleResponse.message)
109
+ assert_equal('11111 ', sale_response.saleResponse.authCode)
110
+ assert_equal('01', sale_response.saleResponse.fraudResult.avsResult)
111
+ assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
112
+
113
+ #test 1B
114
+ credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
115
+ hash1b = credit_hash.merge(@@merchant_hash)
116
+ credit_response = LitleOnlineRequest.new.credit(hash1b)
117
+ assert_equal('000', credit_response.creditResponse.response)
118
+ assert_equal('Approved', credit_response.creditResponse.message)
119
+
120
+ #test1C
121
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
122
+ hash1c = void_hash.merge(@@merchant_hash)
123
+ void_response = LitleOnlineRequest.new.void(hash1c)
124
+ assert_equal('000', void_response.voidResponse.response)
125
+ assert_equal('Approved', void_response.voidResponse.message)
126
+ end
127
+
128
+ def test_2_auth
129
+ customer_hash = {
130
+ 'orderId' => '2',
131
+ 'amount' => '20020',
132
+ 'orderSource'=>'ecommerce',
133
+ 'billToAddress'=>{
134
+ 'name' => 'Mike J. Hammer',
135
+ 'addressLine1' => '2 Main St.',
136
+ 'addressLine2' => 'Apt. 222',
137
+ 'city' => 'Riverside',
138
+ 'state' => 'RI',
139
+ 'zip' => '02915',
140
+ 'country' => 'US'},
141
+ 'card'=>{
142
+ 'number' =>'5112010000000003',
143
+ 'expDate' => '0212',
144
+ 'cardValidationNum' => '261',
145
+ 'type' => 'MC'
146
+ },
147
+ 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
148
+ }
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('22222', auth_response.authorizationResponse.authCode)
154
+ assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
155
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
156
+
157
+ #test 2A
158
+ capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
159
+ hash2a = capture_hash.merge(@@merchant_hash)
160
+ capture_response = LitleOnlineRequest.new.capture(hash2a)
161
+ assert_equal('000', capture_response.captureResponse.response)
162
+ assert_equal('Approved', capture_response.captureResponse.message)
163
+
164
+ #test 2B
165
+ credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
166
+ hash2b = credit_hash.merge(@@merchant_hash)
167
+ credit_response = LitleOnlineRequest.new.credit(hash2b)
168
+ assert_equal('000', credit_response.creditResponse.response)
169
+ assert_equal('Approved', credit_response.creditResponse.message)
170
+
171
+ #test 2C
172
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
173
+ hash2c = void_hash.merge(@@merchant_hash)
174
+ void_response = LitleOnlineRequest.new.void(hash2c)
175
+ assert_equal('000', void_response.voidResponse.response)
176
+ assert_equal('Approved', void_response.voidResponse.message)
177
+ end
178
+
179
+ def test_2_avs
180
+ customer_hash = {
181
+ 'orderId' => '2',
182
+ 'amount' => '0',
183
+ 'orderSource'=>'ecommerce',
184
+ 'billToAddress'=>{
185
+ 'name' => 'Mike J. Hammer',
186
+ 'addressLine1' => '2 Main St.',
187
+ 'addressLine2' => 'Apt. 222',
188
+ 'city' => 'Riverside',
189
+ 'state' => 'RI',
190
+ 'zip' => '02915',
191
+ 'country' => 'US'},
192
+ 'card'=>{
193
+ 'number' =>'5112010000000003',
194
+ 'expDate' => '0212',
195
+ 'cardValidationNum' => '261',
196
+ 'type' => 'MC'
197
+ },
198
+ 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
199
+ }
200
+ hash = customer_hash.merge(@@merchant_hash)
201
+ auth_response = LitleOnlineRequest.new.authorization(hash)
202
+ assert_equal('000', auth_response.authorizationResponse.response)
203
+ assert_equal('Approved', auth_response.authorizationResponse.message)
204
+ assert_equal('22222', auth_response.authorizationResponse.authCode)
205
+ assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
206
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
207
+ end
208
+
209
+ def test_2_sale
210
+ customer_hash = {
211
+ 'orderId' => '2',
212
+ 'amount' => '20020',
213
+ 'orderSource'=>'ecommerce',
214
+ 'billToAddress'=>{
215
+ 'name' => 'Mike J. Hammer',
216
+ 'addressLine1' => '2 Main St.',
217
+ 'addressLine2' => 'Apt. 222',
218
+ 'city' => 'Riverside',
219
+ 'state' => 'RI',
220
+ 'zip' => '02915',
221
+ 'country' => 'US'},
222
+ 'card'=>{
223
+ 'number' =>'5112010000000003',
224
+ 'expDate' => '0212',
225
+ 'cardValidationNum' => '261',
226
+ 'type' => 'MC'
227
+ },
228
+ 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
229
+ }
230
+ hash = customer_hash.merge(@@merchant_hash)
231
+ sale_response = LitleOnlineRequest.new.sale(hash)
232
+ assert_equal('000', sale_response.saleResponse.response)
233
+ assert_equal('Approved', sale_response.saleResponse.message)
234
+ assert_equal('22222', sale_response.saleResponse.authCode)
235
+ assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
236
+ assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
237
+
238
+ #test 2B
239
+ credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
240
+ hash2b = credit_hash.merge(@@merchant_hash)
241
+ credit_response = LitleOnlineRequest.new.credit(hash2b)
242
+ assert_equal('000', credit_response.creditResponse.response)
243
+ assert_equal('Approved', credit_response.creditResponse.message)
244
+
245
+ #test 2C
246
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
247
+ hash2c = void_hash.merge(@@merchant_hash)
248
+ void_response = LitleOnlineRequest.new.void(hash2c)
249
+ assert_equal('000', void_response.voidResponse.response)
250
+ assert_equal('Approved', void_response.voidResponse.message)
251
+ end
252
+
253
+ def test_3_auth
254
+ customer_hash = {
255
+ 'orderId' => '3',
256
+ 'amount' => '30030',
257
+ 'orderSource'=>'ecommerce',
258
+ 'billToAddress'=>{
259
+ 'name' => 'Eileen Jones',
260
+ 'addressLine1' => '3 Main St.',
261
+ 'city' => 'Bloomfield',
262
+ 'state' => 'CT',
263
+ 'zip' => '06002',
264
+ 'country' => 'US'},
265
+ 'card'=>{
266
+ 'number' =>'6011010000000003',
267
+ 'expDate' => '0312',
268
+ 'type' => 'DI',
269
+ 'cardValidationNum' => '758'},
270
+ }
271
+ hash = customer_hash.merge(@@merchant_hash)
272
+ auth_response = LitleOnlineRequest.new.authorization(hash)
273
+ assert_equal('000', auth_response.authorizationResponse.response)
274
+ assert_equal('Approved', auth_response.authorizationResponse.message)
275
+ assert_equal('33333', auth_response.authorizationResponse.authCode)
276
+ assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
277
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
278
+
279
+ #test 3A
280
+ capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
281
+ hash2a = capture_hash.merge(@@merchant_hash)
282
+ capture_response = LitleOnlineRequest.new.capture(hash2a)
283
+ assert_equal('000', capture_response.captureResponse.response)
284
+ assert_equal('Approved', capture_response.captureResponse.message)
285
+
286
+ #test 3B
287
+ credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
288
+ hash2b = credit_hash.merge(@@merchant_hash)
289
+ credit_response = LitleOnlineRequest.new.credit(hash2b)
290
+ assert_equal('000', credit_response.creditResponse.response)
291
+ assert_equal('Approved', credit_response.creditResponse.message)
292
+
293
+ #test 3C
294
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
295
+ hash2c = void_hash.merge(@@merchant_hash)
296
+ void_response = LitleOnlineRequest.new.void(hash2c)
297
+ assert_equal('000', void_response.voidResponse.response)
298
+ assert_equal('Approved', void_response.voidResponse.message)
299
+ end
300
+
301
+ def test_3_avs
302
+ customer_hash = {
303
+ 'orderId' => '3',
304
+ 'amount' => '0',
305
+ 'orderSource'=>'ecommerce',
306
+ 'billToAddress'=>{
307
+ 'name' => 'Eileen Jones',
308
+ 'addressLine1' => '3 Main St.',
309
+ 'city' => 'Bloomfield',
310
+ 'state' => 'CT',
311
+ 'zip' => '06002',
312
+ 'country' => 'US'},
313
+ 'card'=>{
314
+ 'number' =>'6011010000000003',
315
+ 'expDate' => '0312',
316
+ 'type' => 'DI',
317
+ 'cardValidationNum' => '758'},
318
+ }
319
+ hash = customer_hash.merge(@@merchant_hash)
320
+ auth_response = LitleOnlineRequest.new.authorization(hash)
321
+ assert_equal('000', auth_response.authorizationResponse.response)
322
+ assert_equal('Approved', auth_response.authorizationResponse.message)
323
+ assert_equal('33333', auth_response.authorizationResponse.authCode)
324
+ assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
325
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
326
+ end
327
+
328
+ def test_3_sale
329
+ customer_hash = {
330
+ 'orderId' => '3',
331
+ 'amount' => '30030',
332
+ 'orderSource'=>'ecommerce',
333
+ 'billToAddress'=>{
334
+ 'name' => 'Eileen Jones',
335
+ 'addressLine1' => '3 Main St.',
336
+ 'city' => 'Bloomfield',
337
+ 'state' => 'CT',
338
+ 'zip' => '06002',
339
+ 'country' => 'US'},
340
+ 'card'=>{
341
+ 'number' =>'6011010000000003',
342
+ 'expDate' => '0312',
343
+ 'type' => 'DI',
344
+ 'cardValidationNum' => '758'},
345
+ }
346
+ hash = customer_hash.merge(@@merchant_hash)
347
+ sale_response = LitleOnlineRequest.new.sale(hash)
348
+ assert_equal('000', sale_response.saleResponse.response)
349
+ assert_equal('Approved', sale_response.saleResponse.message)
350
+ assert_equal('33333', sale_response.saleResponse.authCode)
351
+ assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
352
+ assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
353
+
354
+ #test 3B
355
+ credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
356
+ hash2b = credit_hash.merge(@@merchant_hash)
357
+ credit_response = LitleOnlineRequest.new.credit(hash2b)
358
+ assert_equal('000', credit_response.creditResponse.response)
359
+ assert_equal('Approved', credit_response.creditResponse.message)
360
+
361
+ #test 3C
362
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
363
+ hash2c = void_hash.merge(@@merchant_hash)
364
+ void_response = LitleOnlineRequest.new.void(hash2c)
365
+ assert_equal('000', void_response.voidResponse.response)
366
+ assert_equal('Approved', void_response.voidResponse.message)
367
+ end
368
+
369
+ def test_4_auth
370
+ customer_hash = {
371
+ 'orderId' => '4',
372
+ 'amount' => '40040',
373
+ 'orderSource'=>'ecommerce',
374
+ 'billToAddress'=>{
375
+ 'name' => 'Bob Black',
376
+ 'addressLine1' => '4 Main St.',
377
+ 'city' => 'Laurel',
378
+ 'state' => 'MD',
379
+ 'zip' => '20708',
380
+ 'country' => 'US'},
381
+ 'card'=>{
382
+ 'number' =>'375001000000005',
383
+ 'expDate' => '0412',
384
+ 'type' => 'AX'
385
+ },
386
+ }
387
+ hash = customer_hash.merge(@@merchant_hash)
388
+ auth_response = LitleOnlineRequest.new.authorization(hash)
389
+ assert_equal('000', auth_response.authorizationResponse.response)
390
+ assert_equal('Approved', auth_response.authorizationResponse.message)
391
+ assert_equal('44444', auth_response.authorizationResponse.authCode)
392
+ assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
393
+
394
+ #test 4A
395
+ capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
396
+ hash2a = capture_hash.merge(@@merchant_hash)
397
+ capture_response = LitleOnlineRequest.new.capture(hash2a)
398
+ assert_equal('Approved', capture_response.captureResponse.message)
399
+
400
+ #test 4B
401
+ credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
402
+ hash2b = credit_hash.merge(@@merchant_hash)
403
+ credit_response = LitleOnlineRequest.new.credit(hash2b)
404
+ assert_equal('000', credit_response.creditResponse.response)
405
+ assert_equal('Approved', credit_response.creditResponse.message)
406
+
407
+ #test 4C
408
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
409
+ hash2c = void_hash.merge(@@merchant_hash)
410
+ void_response = LitleOnlineRequest.new.void(hash2c)
411
+ assert_equal('000', void_response.voidResponse.response)
412
+ assert_equal('Approved', void_response.voidResponse.message)
413
+ end
414
+
415
+ def test_4_avs
416
+ customer_hash = {
417
+ 'orderId' => '4',
418
+ 'amount' => '0',
419
+ 'orderSource'=>'ecommerce',
420
+ 'billToAddress'=>{
421
+ 'name' => 'Bob Black',
422
+ 'addressLine1' => '4 Main St.',
423
+ 'city' => 'Laurel',
424
+ 'state' => 'MD',
425
+ 'zip' => '20708',
426
+ 'country' => 'US'},
427
+ 'card'=>{
428
+ 'number' =>'375001000000005',
429
+ 'expDate' => '0412',
430
+ 'type' => 'AX'
431
+ },
432
+ }
433
+ hash = customer_hash.merge(@@merchant_hash)
434
+ auth_response = LitleOnlineRequest.new.authorization(hash)
435
+ assert_equal('000', auth_response.authorizationResponse.response)
436
+ assert_equal('Approved', auth_response.authorizationResponse.message)
437
+ assert_equal('44444', auth_response.authorizationResponse.authCode)
438
+ assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
439
+ end
440
+
441
+ def test_4_sale
442
+ customer_hash = {
443
+ 'orderId' => '4',
444
+ 'amount' => '40040',
445
+ 'orderSource'=>'ecommerce',
446
+ 'billToAddress'=>{
447
+ 'name' => 'Bob Black',
448
+ 'addressLine1' => '4 Main St.',
449
+ 'city' => 'Laurel',
450
+ 'state' => 'MD',
451
+ 'zip' => '20708',
452
+ 'country' => 'US'},
453
+ 'card'=>{
454
+ 'number' =>'375001000000005',
455
+ 'expDate' => '0412',
456
+ 'type' => 'AX'
457
+ },
458
+ }
459
+ hash = customer_hash.merge(@@merchant_hash)
460
+ sale_response = LitleOnlineRequest.new.sale(hash)
461
+ assert_equal('000', sale_response.saleResponse.response)
462
+ assert_equal('Approved', sale_response.saleResponse.message)
463
+ assert_equal('44444', sale_response.saleResponse.authCode)
464
+ assert_equal('12', sale_response.saleResponse.fraudResult.avsResult)
465
+
466
+ #test 4B
467
+ credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
468
+ hash2b = credit_hash.merge(@@merchant_hash)
469
+ credit_response = LitleOnlineRequest.new.credit(hash2b)
470
+ assert_equal('000', credit_response.creditResponse.response)
471
+ assert_equal('Approved', credit_response.creditResponse.message)
472
+
473
+ #test 4C
474
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
475
+ hash2c = void_hash.merge(@@merchant_hash)
476
+ void_response = LitleOnlineRequest.new.void(hash2c)
477
+ assert_equal('000', void_response.voidResponse.response)
478
+ assert_equal('Approved', void_response.voidResponse.message)
479
+ end
480
+
481
+ def test_5_auth
482
+ customer_hash = {
483
+ 'orderId' => '5',
484
+ 'amount' => '50050',
485
+ 'orderSource'=>'ecommerce',
486
+ 'card'=>{
487
+ 'number' =>'4457010200000007',
488
+ 'expDate' => '0512',
489
+ 'cardValidationNum' => '463',
490
+ 'type' => 'VI'},
491
+ 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
492
+ }
493
+ hash = customer_hash.merge(@@merchant_hash)
494
+ auth_response = LitleOnlineRequest.new.authorization(hash)
495
+ assert_equal('000', auth_response.authorizationResponse.response)
496
+ assert_equal('Approved', auth_response.authorizationResponse.message)
497
+ assert_equal('55555 ', auth_response.authorizationResponse.authCode)
498
+ assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
499
+ assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
500
+
501
+ #test 5A
502
+ capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
503
+ hash2a = capture_hash.merge(@@merchant_hash)
504
+ capture_response = LitleOnlineRequest.new.capture(hash2a)
505
+ assert_equal('000', capture_response.captureResponse.response)
506
+ assert_equal('Approved', capture_response.captureResponse.message)
507
+
508
+ #test 5B
509
+ credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
510
+ hash2b = credit_hash.merge(@@merchant_hash)
511
+ credit_response = LitleOnlineRequest.new.credit(hash2b)
512
+ assert_equal('000', credit_response.creditResponse.response)
513
+ assert_equal('Approved', credit_response.creditResponse.message)
514
+
515
+ #test 5C
516
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
517
+ hash2c = void_hash.merge(@@merchant_hash)
518
+ void_response = LitleOnlineRequest.new.void(hash2c)
519
+ assert_equal('000', void_response.voidResponse.response)
520
+ assert_equal('Approved', void_response.voidResponse.message)
521
+ end
522
+
523
+ def test_5_avs
524
+ customer_hash = {
525
+ 'orderId' => '5',
526
+ 'amount' => '0',
527
+ 'orderSource'=>'ecommerce',
528
+ 'card'=>{
529
+ 'number' =>'4457010200000007',
530
+ 'expDate' => '0512',
531
+ 'cardValidationNum' => '463',
532
+ 'type' => 'VI'},
533
+ 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
534
+ }
535
+ hash = customer_hash.merge(@@merchant_hash)
536
+ auth_response = LitleOnlineRequest.new.authorization(hash)
537
+ assert_equal('000', auth_response.authorizationResponse.response)
538
+ assert_equal('Approved', auth_response.authorizationResponse.message)
539
+ assert_equal('55555 ', auth_response.authorizationResponse.authCode)
540
+ assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
541
+ assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
542
+ end
543
+
544
+ def test_5_sale
545
+ customer_hash = {
546
+ 'orderId' => '5',
547
+ 'amount' => '50050',
548
+ 'orderSource'=>'ecommerce',
549
+ 'card'=>{
550
+ 'number' =>'4457010200000007',
551
+ 'expDate' => '0512',
552
+ 'cardValidationNum' => '463',
553
+ 'type' => 'VI'},
554
+ 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
555
+ }
556
+ hash = customer_hash.merge(@@merchant_hash)
557
+ sale_response = LitleOnlineRequest.new.sale(hash)
558
+ assert_equal('000', sale_response.saleResponse.response)
559
+ assert_equal('Approved', sale_response.saleResponse.message)
560
+ assert_equal('55555 ', sale_response.saleResponse.authCode)
561
+ assert_equal('32', sale_response.saleResponse.fraudResult.avsResult)
562
+ assert_equal('N', sale_response.saleResponse.fraudResult.cardValidationResult)
563
+
564
+ #test 5B
565
+ credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
566
+ hash2b = credit_hash.merge(@@merchant_hash)
567
+ credit_response = LitleOnlineRequest.new.credit(hash2b)
568
+ assert_equal('000', credit_response.creditResponse.response)
569
+ assert_equal('Approved', credit_response.creditResponse.message)
570
+
571
+ #test 5C
572
+ void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
573
+ hash2c = void_hash.merge(@@merchant_hash)
574
+ void_response = LitleOnlineRequest.new.void(hash2c)
575
+ assert_equal('000', void_response.voidResponse.response)
576
+ assert_equal('Approved', void_response.voidResponse.message)
577
+ end
578
+
579
+ def test_6_auth
580
+ customer_hash = {
581
+ 'orderId' => '6',
582
+ 'amount' => '60060',
583
+ 'orderSource'=>'ecommerce',
584
+ 'billToAddress'=>{
585
+ 'name' => 'Joe Green',
586
+ 'addressLine1' => '6 Main St.',
587
+ 'city' => 'Derry',
588
+ 'state' => 'NH',
589
+ 'zip' => '03038',
590
+ 'country' => 'US'},
591
+ 'card'=>{
592
+ 'number' =>'4457010100000008',
593
+ 'expDate' => '0612',
594
+ 'type' => 'VI',
595
+ 'cardValidationNum' => '992'}
596
+ }
597
+ hash = customer_hash.merge(@@merchant_hash)
598
+ auth_response = LitleOnlineRequest.new.authorization(hash)
599
+ assert_equal('110', auth_response.authorizationResponse.response)
600
+ assert_equal('Insufficient Funds', auth_response.authorizationResponse.message)
601
+ assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
602
+ assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
603
+ end
604
+
605
+ def test_6_sale
606
+ customer_hash = {
607
+ 'orderId' => '6',
608
+ 'amount' => '60060',
609
+ 'orderSource'=>'ecommerce',
610
+ 'billToAddress'=>{
611
+ 'name' => 'Joe Green',
612
+ 'addressLine1' => '6 Main St.',
613
+ 'city' => 'Derry',
614
+ 'state' => 'NH',
615
+ 'zip' => '03038',
616
+ 'country' => 'US'},
617
+ 'card'=>{
618
+ 'number' =>'4457010100000008',
619
+ 'expDate' => '0612',
620
+ 'type' => 'VI',
621
+ 'cardValidationNum' => '992'}
622
+ }
623
+ hash = customer_hash.merge(@@merchant_hash)
624
+ sale_response = LitleOnlineRequest.new.sale(hash)
625
+ assert_equal('110', sale_response.saleResponse.response)
626
+ assert_equal('Insufficient Funds', sale_response.saleResponse.message)
627
+ assert_equal('34', sale_response.saleResponse.fraudResult.avsResult)
628
+ assert_equal('P', sale_response.saleResponse.fraudResult.cardValidationResult)
629
+
630
+ #test 6A
631
+ void_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId }
632
+ hash6A = void_hash.merge(@@merchant_hash)
633
+ void_response = LitleOnlineRequest.new.void(hash6A)
634
+ assert_equal('360', void_response.voidResponse.response)
635
+ assert_equal('No transaction found with specified litleTxnId', void_response.voidResponse.message)
636
+ end
637
+
638
+ def test_7_auth
639
+ customer_hash = {
640
+ 'orderId' => '7',
641
+ 'amount' => '70070',
642
+ 'orderSource'=>'ecommerce',
643
+ 'billToAddress'=>{
644
+ 'name' => 'Jane Murray',
645
+ 'addressLine1' => '7 Main St.',
646
+ 'city' => 'Amesbury',
647
+ 'state' => 'MA',
648
+ 'zip' => '01913',
649
+ 'country' => 'US'},
650
+ 'card'=>{
651
+ 'number' =>'5112010100000002',
652
+ 'expDate' => '0712',
653
+ 'cardValidationNum' => '251',
654
+ 'type' => 'MC'}
655
+ }
656
+ hash = customer_hash.merge(@@merchant_hash)
657
+ authorization_response = LitleOnlineRequest.new.authorization(hash)
658
+ assert_equal('301', authorization_response.authorizationResponse.response)
659
+ assert_equal('Invalid Account Number', authorization_response.authorizationResponse.message)
660
+ assert_equal('34', authorization_response.authorizationResponse.fraudResult.avsResult)
661
+ assert_equal('N', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
662
+ end
663
+
664
+ def test_7_avs
665
+ customer_hash = {
666
+ 'orderId' => '7',
667
+ 'amount' => '0',
668
+ 'orderSource'=>'ecommerce',
669
+ 'billToAddress'=>{
670
+ 'name' => 'Jane Murray',
671
+ 'addressLine1' => '7 Main St.',
672
+ 'city' => 'Amesbury',
673
+ 'state' => 'MA',
674
+ 'zip' => '01913',
675
+ 'country' => 'US'},
676
+ 'card'=>{
677
+ 'number' =>'5112010100000002',
678
+ 'expDate' => '0712',
679
+ 'cardValidationNum' => '251',
680
+ 'type' => 'MC'}
681
+ }
682
+ hash = customer_hash.merge(@@merchant_hash)
683
+ authorization_response = LitleOnlineRequest.new.authorization(hash)
684
+ assert_equal('301', authorization_response.authorizationResponse.response)
685
+ assert_equal('Invalid Account Number', authorization_response.authorizationResponse.message)
686
+ assert_equal('34', authorization_response.authorizationResponse.fraudResult.avsResult)
687
+ assert_equal('N', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
688
+ end
689
+
690
+ def test_7_sale
691
+ customer_hash = {
692
+ 'orderId' => '7',
693
+ 'amount' => '70070',
694
+ 'orderSource'=>'ecommerce',
695
+ 'billToAddress'=>{
696
+ 'name' => 'Jane Murray',
697
+ 'addressLine1' => '7 Main St.',
698
+ 'city' => 'Amesbury',
699
+ 'state' => 'MA',
700
+ 'zip' => '01913',
701
+ 'country' => 'US'},
702
+ 'card'=>{
703
+ 'number' =>'5112010100000002',
704
+ 'expDate' => '0712',
705
+ 'cardValidationNum' => '251',
706
+ 'type' => 'MC'}
707
+ }
708
+ hash = customer_hash.merge(@@merchant_hash)
709
+ sale_response = LitleOnlineRequest.new.sale(hash)
710
+ assert_equal('301', sale_response.saleResponse.response)
711
+ assert_equal('Invalid Account Number', sale_response.saleResponse.message)
712
+ assert_equal('34', sale_response.saleResponse.fraudResult.avsResult)
713
+ assert_equal('N', sale_response.saleResponse.fraudResult.cardValidationResult)
714
+ end
715
+
716
+ def test_8_auth
717
+ customer_hash = {
718
+ 'orderId' => '8',
719
+ 'amount' => '80080',
720
+ 'orderSource'=>'ecommerce',
721
+ 'billToAddress'=>{
722
+ 'name' => 'Mark Johnson',
723
+ 'addressLine1' => '8 Main St.',
724
+ 'city' => 'Manchester',
725
+ 'state' => 'NH',
726
+ 'zip' => '03101',
727
+ 'country' => 'US'},
728
+ 'card'=>{
729
+ 'number' =>'6011010100000002',
730
+ 'expDate' => '0812',
731
+ 'type' => 'DI',
732
+ 'cardValidationNum' => '184'}
733
+ }
734
+ hash = customer_hash.merge(@@merchant_hash)
735
+ auth_response = LitleOnlineRequest.new.authorization(hash)
736
+ assert_equal('123', auth_response.authorizationResponse.response)
737
+ assert_equal('Call Discover', auth_response.authorizationResponse.message)
738
+ assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
739
+ assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
740
+ end
741
+
742
+ def test_8_avs
743
+ customer_hash = {
744
+ 'orderId' => '8',
745
+ 'amount' => '0',
746
+ 'orderSource'=>'ecommerce',
747
+ 'billToAddress'=>{
748
+ 'name' => 'Mark Johnson',
749
+ 'addressLine1' => '8 Main St.',
750
+ 'city' => 'Manchester',
751
+ 'state' => 'NH',
752
+ 'zip' => '03101',
753
+ 'country' => 'US'},
754
+ 'card'=>{
755
+ 'number' =>'6011010100000002',
756
+ 'expDate' => '0812',
757
+ 'type' => 'DI',
758
+ 'cardValidationNum' => '184'}
759
+ }
760
+ hash = customer_hash.merge(@@merchant_hash)
761
+ auth_response = LitleOnlineRequest.new.authorization(hash)
762
+ assert_equal('123', auth_response.authorizationResponse.response)
763
+ assert_equal('Call Discover', auth_response.authorizationResponse.message)
764
+ assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
765
+ assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
766
+ end
767
+
768
+ def test_8_sale
769
+ customer_hash = {
770
+ 'orderId' => '8',
771
+ 'amount' => '80080',
772
+ 'orderSource'=>'ecommerce',
773
+ 'billToAddress'=>{
774
+ 'name' => 'Mark Johnson',
775
+ 'addressLine1' => '8 Main St.',
776
+ 'city' => 'Manchester',
777
+ 'state' => 'NH',
778
+ 'zip' => '03101',
779
+ 'country' => 'US'},
780
+ 'card'=>{
781
+ 'number' =>'6011010100000002',
782
+ 'expDate' => '0812',
783
+ 'type' => 'DI',
784
+ 'cardValidationNum' => '184'}
785
+ }
786
+ hash = customer_hash.merge(@@merchant_hash)
787
+ sale_response = LitleOnlineRequest.new.sale(hash)
788
+ assert_equal('123', sale_response.saleResponse.response)
789
+ assert_equal('Call Discover', sale_response.saleResponse.message)
790
+ assert_equal('P', sale_response.saleResponse.fraudResult.cardValidationResult)
791
+ assert_equal('34', sale_response.saleResponse.fraudResult.avsResult)
792
+ end
793
+
794
+ def test_9_auth
795
+ customer_hash = {
796
+ 'orderId' => '9',
797
+ 'amount' => '90090',
798
+ 'orderSource'=>'ecommerce',
799
+ 'billToAddress'=>{
800
+ 'name' => 'James Miller',
801
+ 'addressLine1' => '9 Main St.',
802
+ 'city' => 'Boston',
803
+ 'state' => 'MA',
804
+ 'zip' => '02134',
805
+ 'country' => 'US'},
806
+ 'card'=>{
807
+ 'number' =>'375001010000003',
808
+ 'expDate' => '0912',
809
+ 'cardValidationNum' => '0421',
810
+ 'type' => 'AX'
811
+ }
812
+ }
813
+ hash = customer_hash.merge(@@merchant_hash)
814
+ response = LitleOnlineRequest.new.authorization(hash)
815
+ assert_equal('303', response.authorizationResponse.response)
816
+ assert_equal('Pick Up Card', response.authorizationResponse.message)
817
+ assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
818
+ end
819
+
820
+ def test_9_avs
821
+ customer_hash = {
822
+ 'orderId' => '9',
823
+ 'amount' => '0',
824
+ 'orderSource'=>'ecommerce',
825
+ 'billToAddress'=>{
826
+ 'name' => 'James Miller',
827
+ 'addressLine1' => '9 Main St.',
828
+ 'city' => 'Boston',
829
+ 'state' => 'MA',
830
+ 'zip' => '02134',
831
+ 'country' => 'US'},
832
+ 'card'=>{
833
+ 'number' =>'375001010000003',
834
+ 'expDate' => '0912',
835
+ 'cardValidationNum' => '0421',
836
+ 'type' => 'AX'
837
+ }
838
+ }
839
+ hash = customer_hash.merge(@@merchant_hash)
840
+ response = LitleOnlineRequest.new.authorization(hash)
841
+ assert_equal('303', response.authorizationResponse.response)
842
+ assert_equal('Pick Up Card', response.authorizationResponse.message)
843
+ assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
844
+ end
845
+
846
+ def test_9_sale
847
+ customer_hash = {
848
+ 'orderId' => '9',
849
+ 'amount' => '90090',
850
+ 'orderSource'=>'ecommerce',
851
+ 'billToAddress'=>{
852
+ 'name' => 'James Miller',
853
+ 'addressLine1' => '9 Main St.',
854
+ 'city' => 'Boston',
855
+ 'state' => 'MA',
856
+ 'zip' => '02134',
857
+ 'country' => 'US'},
858
+ 'card'=>{
859
+ 'number' =>'375001010000003',
860
+ 'expDate' => '0912',
861
+ 'cardValidationNum' => '0421',
862
+ 'type' => 'AX'
863
+ }
864
+ }
865
+ hash = customer_hash.merge(@@merchant_hash)
866
+ response = LitleOnlineRequest.new.sale(hash)
867
+ assert_equal('303', response.saleResponse.response)
868
+ assert_equal('Pick Up Card', response.saleResponse.message)
869
+ assert_equal('34', response.saleResponse.fraudResult.avsResult)
870
+ end
871
+
872
+ def test_10
873
+ customer_hash = {
874
+ 'orderId' => '10',
875
+ 'amount' => '40000',
876
+ 'orderSource'=>'ecommerce',
877
+ 'card'=>{
878
+ 'number' =>'4457010140000141',
879
+ 'expDate' => '0912',
880
+ 'type' => 'VI'
881
+ },
882
+ 'allowPartialAuth' => 'true'
883
+ }
884
+ hash = customer_hash.merge(@@merchant_hash)
885
+ auth_response = LitleOnlineRequest.new.authorization(hash)
886
+ assert_equal('010', auth_response.authorizationResponse.response)
887
+ assert_equal('Partially Approved', auth_response.authorizationResponse.message)
888
+ assert_equal('32000', auth_response.authorizationResponse.approvedAmount)
889
+ end
890
+
891
+ def test_11
892
+ customer_hash = {
893
+ 'orderId' => '11',
894
+ 'amount' => '60000',
895
+ 'orderSource'=>'ecommerce',
896
+ 'card'=>{
897
+ 'number' =>'5112010140000004',
898
+ 'expDate' => '1111',
899
+ 'type' => 'MC'
900
+ },
901
+ 'allowPartialAuth' => 'true'
902
+ }
903
+ hash = customer_hash.merge(@@merchant_hash)
904
+ auth_response = LitleOnlineRequest.new.authorization(hash)
905
+ assert_equal('010', auth_response.authorizationResponse.response)
906
+ assert_equal('Partially Approved', auth_response.authorizationResponse.message)
907
+ assert_equal('48000', auth_response.authorizationResponse.approvedAmount)
908
+ end
909
+
910
+ def test_12
911
+ customer_hash = {
912
+ 'orderId' => '12',
913
+ 'amount' => '50000',
914
+ 'orderSource'=>'ecommerce',
915
+ 'card'=>{
916
+ 'number' =>'375001014000009',
917
+ 'expDate' => '0412',
918
+ 'type' => 'AX'},
919
+ 'allowPartialAuth' => 'true'
920
+ }
921
+ hash = customer_hash.merge(@@merchant_hash)
922
+ auth_response = LitleOnlineRequest.new.authorization(hash)
923
+ assert_equal('010', auth_response.authorizationResponse.response)
924
+ assert_equal('Partially Approved', auth_response.authorizationResponse.message)
925
+ assert_equal('40000', auth_response.authorizationResponse.approvedAmount)
926
+ end
927
+
928
+ def test_13
929
+ customer_hash = {
930
+ 'orderId' => '13',
931
+ 'amount' => '15000',
932
+ 'orderSource'=>'ecommerce',
933
+ 'card'=>{
934
+ 'number' =>'6011010140000004',
935
+ 'expDate' => '0812',
936
+ 'type' => 'DI'},
937
+ 'allowPartialAuth' => 'true'
938
+ }
939
+ hash = customer_hash.merge(@@merchant_hash)
940
+ auth_response = LitleOnlineRequest.new.authorization(hash)
941
+ assert_equal('010', auth_response.authorizationResponse.response)
942
+ assert_equal('Partially Approved', auth_response.authorizationResponse.message)
943
+ assert_equal('12000', auth_response.authorizationResponse.approvedAmount)
944
+ end
943
945
  end
944
946
  end