CnpOnline 9.14.0 → 11.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/CHANGELOG +23 -17
- data/CONTRIBUTORS +0 -0
- data/DESCRIPTION +1 -1
- data/LICENSE +1 -1
- data/README.md +5 -3
- data/Rakefile +5 -5
- data/Rakefile~ +5 -5
- data/SETUP.md +3 -3
- data/bin/Setup.rb +59 -41
- data/lib/Communications.rb +3 -3
- data/lib/Configuration.rb +52 -45
- data/lib/EnvironmentVariables.rb +5 -1
- data/lib/LitleBatchRequest.rb +72 -7
- data/lib/LitleListeners.rb +17 -1
- data/lib/LitleOnline.rb +3 -4
- data/lib/LitleOnlineRequest.rb +37 -7
- data/lib/LitleRequest.rb +315 -186
- data/lib/LitleTransaction.rb +212 -85
- data/lib/LitleXmlMapper.rb +4 -2
- data/lib/XMLFields.rb +384 -171
- data/lib/cacert.pem +0 -0
- data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
- data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
- data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
- data/samples/Batch/AccountUpdate.rb +1 -0
- data/samples/Batch/SampleBatchDriver.rb +2 -1
- data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
- data/samples/Capture/LitleCaptureTransaction.rb +2 -2
- data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
- data/samples/Capture/LitlePartialCapture.rb +3 -3
- data/samples/Credit/LitleCreditTransaction.rb +2 -2
- data/samples/Credit/LitleRefundTransaction.rb +2 -1
- data/samples/Other/LitleAvsTransaction.rb +2 -1
- data/samples/Other/LitleVoidTransaction.rb +2 -1
- data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
- data/samples/Run_all.rb +0 -0
- data/samples/Sale/LitleSaleTransaction.rb +2 -1
- data/samples/Sale/SampleSaleTransaction.rb +2 -1
- data/test/certification/certTest1_base.rb +52 -53
- data/test/certification/certTest2_authenhanced.rb +24 -25
- data/test/certification/certTest3_authreversal.rb +23 -26
- data/test/certification/certTest4_echeck.rb +18 -32
- data/test/certification/certTest5_token.rb +105 -106
- data/test/certification/certTest_batchAll.rb +47 -15
- data/test/functional/test_activate.rb +32 -4
- data/test/functional/test_activateReversal.rb +18 -5
- data/test/functional/test_auth.rb +94 -48
- data/test/functional/test_authReversal.rb +4 -1
- data/test/functional/test_balanceInquiry.rb +28 -3
- data/test/functional/test_batchStream.rb +2 -4
- data/test/functional/test_cancelSubscription.rb +2 -2
- data/test/functional/test_capture.rb +21 -14
- data/test/functional/test_captureGivenAuth.rb +15 -6
- data/test/functional/test_createPlan.rb +1 -1
- data/test/functional/test_credit.rb +14 -5
- data/test/functional/test_deactivate.rb +26 -3
- data/test/functional/test_deactivateReversal.rb +18 -5
- data/test/functional/test_depositReversal.rb +31 -19
- data/test/functional/test_echeckCredit.rb +34 -6
- data/test/functional/test_echeckRedeposit.rb +29 -2
- data/test/functional/test_echeckSale.rb +68 -11
- data/test/functional/test_echeckVerification.rb +32 -7
- data/test/functional/test_echeckVoid.rb +2 -1
- data/test/functional/test_forceCapture.rb +20 -6
- data/test/functional/test_fraudCheck.rb +3 -5
- data/test/functional/test_giftCardAuthReversal.rb +72 -0
- data/test/functional/test_giftCardCapture.rb +72 -0
- data/test/functional/test_giftCardCredit.rb +69 -0
- data/test/functional/test_litle_requests.rb +3 -6
- data/test/functional/test_load.rb +27 -3
- data/test/functional/test_loadReversal.rb +18 -5
- data/test/functional/test_override.rb +7 -3
- data/test/functional/test_pgp_litle_requests.rb +294 -0
- data/test/functional/test_queryTransaction.rb +152 -0
- data/test/functional/test_refundReversal.rb +18 -5
- data/test/functional/test_sale.rb +122 -159
- data/test/functional/test_token.rb +17 -11
- data/test/functional/test_unload.rb +27 -3
- data/test/functional/test_unloadReversal.rb +18 -5
- data/test/functional/test_updateCardValidationNumOnToken.rb +1 -0
- data/test/functional/test_updatePlan.rb +2 -1
- data/test/functional/test_updateSubscription.rb +3 -1
- data/test/functional/test_wallet.rb +74 -0
- data/test/functional/test_xmlfields.rb +22 -3
- data/test/functional/ts_all.rb +2 -0
- data/test/unit/test_LitleBatchRequest.rb +53 -5
- data/test/unit/test_LitleOnlineRequest.rb +5 -30
- data/test/unit/test_LitleRequest.rb +7 -6
- data/test/unit/test_LitleTransaction.rb +34 -5
- data/test/unit/test_LitleXmlMapper.rb +3 -0
- data/test/unit/test_activate.rb +22 -2
- data/test/unit/test_activateReversal.rb +15 -3
- data/test/unit/test_auth.rb +11 -9
- data/test/unit/test_balanceInquiry.rb +2 -2
- data/test/unit/test_capture.rb +2 -2
- data/test/unit/test_captureGivenAuth.rb +21 -1
- data/test/unit/test_credit.rb +1 -1
- data/test/unit/test_deactivate.rb +19 -0
- data/test/unit/test_deactivateReversal.rb +15 -3
- data/test/unit/test_depositReversal.rb +17 -5
- data/test/unit/test_echeckCredit.rb +19 -0
- data/test/unit/test_echeckRedeposit.rb +15 -0
- data/test/unit/test_echeckSale.rb +20 -1
- data/test/unit/test_echeckVerification.rb +6 -3
- data/test/unit/test_forceCapture.rb +1 -1
- data/test/unit/test_giftCardAuthReversal.rb +58 -0
- data/test/{functional/test_utf8.rb → unit/test_giftCardCapture.rb} +25 -12
- data/test/unit/test_giftCardCredit.rb +57 -0
- data/test/unit/test_load.rb +2 -2
- data/test/unit/test_loadReversal.rb +15 -3
- data/test/unit/test_pgp_LitleRequest +139 -0
- data/test/unit/test_queryTransaction.rb +105 -0
- data/test/unit/test_refundReversal.rb +15 -3
- data/test/unit/test_sale.rb +23 -3
- data/test/unit/test_token.rb +24 -20
- data/test/unit/test_unload.rb +2 -2
- data/test/unit/test_unloadReversal.rb +15 -3
- data/test/unit/test_wallet.rb +262 -0
- data/test/unit/ts_unit.rb +2 -1
- metadata +81 -100
@@ -43,6 +43,7 @@ module LitleOnline
|
|
43
43
|
def test_MEGA_batch
|
44
44
|
authHash = {
|
45
45
|
'reportGroup'=>'Planets',
|
46
|
+
'id' => '006',
|
46
47
|
'orderId'=>'12344',
|
47
48
|
'amount'=>'106',
|
48
49
|
'orderSource'=>'ecommerce',
|
@@ -50,8 +51,7 @@ module LitleOnline
|
|
50
51
|
'type'=>'VI',
|
51
52
|
'number' =>'4100000000000001',
|
52
53
|
'expDate' =>'1210'
|
53
|
-
}
|
54
|
-
}
|
54
|
+
}}
|
55
55
|
|
56
56
|
saleHash = {
|
57
57
|
'reportGroup'=>'Planets',
|
@@ -63,13 +63,12 @@ module LitleOnline
|
|
63
63
|
'type'=>'VI',
|
64
64
|
'number' =>'4100000000000001',
|
65
65
|
'expDate' =>'1210'
|
66
|
-
}
|
67
|
-
'originalTransactionAmount' => '536981'
|
68
|
-
}
|
66
|
+
}}
|
69
67
|
|
70
68
|
creditHash = {
|
71
69
|
'merchantId' => '101',
|
72
70
|
'version'=>'8.8',
|
71
|
+
'id' => '006',
|
73
72
|
'reportGroup'=>'Planets',
|
74
73
|
'orderId'=>'12344',
|
75
74
|
'amount'=>'106',
|
@@ -83,6 +82,7 @@ module LitleOnline
|
|
83
82
|
authReversalHash = {
|
84
83
|
'merchantId' => '101',
|
85
84
|
'version'=>'8.8',
|
85
|
+
'id' => '006',
|
86
86
|
'reportGroup'=>'Planets',
|
87
87
|
'litleTxnId'=>'12345678000',
|
88
88
|
'amount'=>'106',
|
@@ -92,6 +92,7 @@ module LitleOnline
|
|
92
92
|
registerTokenHash = {
|
93
93
|
'merchantId' => '101',
|
94
94
|
'version'=>'8.8',
|
95
|
+
'id' => '006',
|
95
96
|
'reportGroup'=>'Planets',
|
96
97
|
'orderId'=>'12344',
|
97
98
|
'accountNumber'=>'1233456789103801'
|
@@ -111,6 +112,7 @@ module LitleOnline
|
|
111
112
|
forceCaptHash = {
|
112
113
|
'merchantId' => '101',
|
113
114
|
'version'=>'8.8',
|
115
|
+
'id' => '006',
|
114
116
|
'reportGroup'=>'Planets',
|
115
117
|
'litleTxnId'=>'123456',
|
116
118
|
'orderId'=>'12344',
|
@@ -120,28 +122,28 @@ module LitleOnline
|
|
120
122
|
'type'=>'VI',
|
121
123
|
'number' =>'4100000000000001',
|
122
124
|
'expDate' =>'1210'
|
123
|
-
}
|
124
|
-
}
|
125
|
+
}}
|
125
126
|
|
126
127
|
captHash = {
|
127
128
|
'merchantId' => '101',
|
128
129
|
'version'=>'8.8',
|
130
|
+
'id' => '006',
|
129
131
|
'reportGroup'=>'Planets',
|
130
132
|
'litleTxnId'=>'123456000',
|
131
133
|
'amount'=>'106',
|
132
|
-
'pin'=>'1234'
|
133
134
|
}
|
134
135
|
|
135
136
|
captGivenAuthHash = {
|
136
137
|
'merchantId' => '101',
|
137
138
|
'version'=>'8.8',
|
139
|
+
'id' => '006',
|
138
140
|
'reportGroup'=>'Planets',
|
139
141
|
'orderId'=>'12344',
|
140
142
|
'amount'=>'106',
|
141
143
|
'authInformation' => {
|
142
144
|
'authDate'=>'2002-10-09','authCode'=>'543216',
|
143
145
|
'authAmount'=>'12345'
|
144
|
-
},
|
146
|
+
},
|
145
147
|
'orderSource'=>'ecommerce',
|
146
148
|
'card'=>{
|
147
149
|
'type'=>'VI',
|
@@ -152,17 +154,19 @@ module LitleOnline
|
|
152
154
|
echeckVerificationHash = {
|
153
155
|
'merchantId' => '101',
|
154
156
|
'version'=>'8.8',
|
157
|
+
'id' => '006',
|
155
158
|
'reportGroup'=>'Planets',
|
156
159
|
'amount'=>'123456',
|
157
160
|
'orderId'=>'12345',
|
158
161
|
'orderSource'=>'ecommerce',
|
159
162
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
160
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
163
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
|
161
164
|
}
|
162
165
|
|
163
166
|
echeckCreditHash = {
|
164
167
|
'merchantId' => '101',
|
165
168
|
'version'=>'8.8',
|
169
|
+
'id' => '006',
|
166
170
|
'reportGroup'=>'Planets',
|
167
171
|
'litleTxnId'=>'123456789101112',
|
168
172
|
'amount'=>'12'
|
@@ -171,6 +175,7 @@ module LitleOnline
|
|
171
175
|
echeckRedeopsitHash = {
|
172
176
|
'merchantId' => '101',
|
173
177
|
'version'=>'8.8',
|
178
|
+
'id' => '006',
|
174
179
|
'reportGroup'=>'Planets',
|
175
180
|
'litleTxnId'=>'123456'
|
176
181
|
}
|
@@ -178,13 +183,14 @@ module LitleOnline
|
|
178
183
|
echeckSaleHash = {
|
179
184
|
'merchantId' => '101',
|
180
185
|
'version'=>'8.8',
|
186
|
+
'id' => '006',
|
181
187
|
'reportGroup'=>'Planets',
|
182
188
|
'amount'=>'123456',
|
183
189
|
'verify'=>'true',
|
184
190
|
'orderId'=>'12345',
|
185
191
|
'orderSource'=>'ecommerce',
|
186
192
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
187
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
193
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
|
188
194
|
}
|
189
195
|
|
190
196
|
accountUpdateHash = {
|
@@ -249,13 +255,14 @@ module LitleOnline
|
|
249
255
|
echeckSaleHash = {
|
250
256
|
'merchantId' => '101',
|
251
257
|
'version'=>'8.8',
|
258
|
+
'id' => '006',
|
252
259
|
'reportGroup'=>'Planets',
|
253
260
|
'amount'=>'123456',
|
254
261
|
'verify'=>'true',
|
255
262
|
'orderId'=>'12345',
|
256
263
|
'orderSource'=>'ecommerce',
|
257
264
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
258
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
265
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
|
259
266
|
}
|
260
267
|
|
261
268
|
path = "/tmp/litle-sdk-for-ruby/cert/"
|
@@ -295,13 +302,14 @@ module LitleOnline
|
|
295
302
|
echeckSaleHash = {
|
296
303
|
'merchantId' => '101',
|
297
304
|
'version'=>'8.8',
|
305
|
+
'id' => '006',
|
298
306
|
'reportGroup'=>'Planets',
|
299
307
|
'amount'=>'123456',
|
300
308
|
'verify'=>'true',
|
301
309
|
'orderId'=>'12345',
|
302
310
|
'orderSource'=>'ecommerce',
|
303
311
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
304
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
312
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
|
305
313
|
}
|
306
314
|
|
307
315
|
path = "/tmp/litle-sdk-for-ruby/cert/"
|
@@ -342,6 +350,7 @@ module LitleOnline
|
|
342
350
|
# submerchantCreditHash = {
|
343
351
|
# 'reportGroup'=>'Planets',
|
344
352
|
# 'orderId'=>'12344',
|
353
|
+
# 'id' => '006',
|
345
354
|
# 'fundingSubmerchantId'=>'123456',
|
346
355
|
# 'submerchantName'=>'001',
|
347
356
|
# 'fundsTransferId'=>'00003',
|
@@ -352,40 +361,49 @@ module LitleOnline
|
|
352
361
|
# vendorCreditHash = {
|
353
362
|
# 'reportGroup'=>'Planets',
|
354
363
|
# 'orderId'=>'12344',
|
364
|
+
# 'id' => '006',
|
355
365
|
# 'fundingSubmerchantId'=>'123456',
|
356
366
|
# 'vendorName'=>'001',
|
357
367
|
# 'fundsTransferId'=>'00007',
|
358
368
|
# 'amount'=>'7000',
|
369
|
+
#
|
359
370
|
# 'accountInfo' => {'accType'=>'Checking','accNum'=>'123456789012','routingNum'=>'114567895'}
|
360
371
|
# }
|
361
372
|
#
|
362
373
|
# payFacCreditHash = {
|
363
374
|
# 'reportGroup'=>'Planets',
|
364
375
|
# 'orderId'=>'12344',
|
376
|
+
# 'id' => '006',
|
365
377
|
# 'fundingSubmerchantId'=>'123456',
|
366
378
|
# 'fundsTransferId'=>'00001',
|
367
379
|
# 'amount'=>'1000',
|
380
|
+
#
|
368
381
|
# }
|
369
382
|
#
|
370
383
|
# reserveCreditHash = {
|
371
384
|
# 'reportGroup'=>'Planets',
|
372
385
|
# 'orderId'=>'12344',
|
386
|
+
# 'id' => '006',
|
373
387
|
# 'fundingSubmerchantId'=>'123456',
|
374
388
|
# 'fundsTransferId'=>'00005',
|
375
389
|
# 'amount'=>'50000',
|
390
|
+
#
|
376
391
|
# }
|
377
392
|
#
|
378
393
|
# physicalCheckCreditHash = {
|
379
394
|
# 'reportGroup'=>'Planets',
|
380
395
|
# 'orderId'=>'12344',
|
396
|
+
# 'id' => '006',
|
381
397
|
# 'fundingSubmerchantId'=>'123456',
|
382
398
|
# 'fundsTransferId'=>'00009',
|
383
399
|
# 'amount'=>'9000',
|
400
|
+
#
|
384
401
|
# }
|
385
402
|
#
|
386
403
|
# submerchantDebitHash = {
|
387
404
|
# 'reportGroup'=>'Planets',
|
388
405
|
# 'orderId'=>'12344',
|
406
|
+
# 'id' => '006',
|
389
407
|
# 'fundingSubmerchantId'=>'123456',
|
390
408
|
# 'submerchantName'=>'001',
|
391
409
|
# 'fundsTransferId'=>'00003',
|
@@ -396,35 +414,43 @@ module LitleOnline
|
|
396
414
|
# vendorDebitHash = {
|
397
415
|
# 'reportGroup'=>'Planets',
|
398
416
|
# 'orderId'=>'12344',
|
417
|
+
# 'id' => '006',
|
399
418
|
# 'fundingSubmerchantId'=>'123456',
|
400
419
|
# 'vendorName'=>'001',
|
401
420
|
# 'fundsTransferId'=>'00007',
|
402
421
|
# 'amount'=>'7000',
|
422
|
+
#
|
403
423
|
# 'accountInfo' => {'accType'=>'Checking','accNum'=>'123456789012','routingNum'=>'114567895'}
|
404
424
|
# }
|
405
425
|
#
|
406
426
|
# payFacDebitHash = {
|
407
427
|
# 'reportGroup'=>'Planets',
|
408
428
|
# 'orderId'=>'12344',
|
429
|
+
# 'id' => '006',
|
409
430
|
# 'fundingSubmerchantId'=>'123456',
|
410
431
|
# 'fundsTransferId'=>'00001',
|
411
432
|
# 'amount'=>'1000',
|
433
|
+
#
|
412
434
|
# }
|
413
435
|
#
|
414
436
|
# reserveDebitHash = {
|
415
437
|
# 'reportGroup'=>'Planets',
|
416
438
|
# 'orderId'=>'12344',
|
439
|
+
# 'id' => '006',
|
417
440
|
# 'fundingSubmerchantId'=>'123456',
|
418
441
|
# 'fundsTransferId'=>'00005',
|
419
442
|
# 'amount'=>'50000',
|
443
|
+
#
|
420
444
|
# }
|
421
445
|
#
|
422
446
|
# physicalCheckDebitHash = {
|
423
447
|
# 'reportGroup'=>'Planets',
|
424
448
|
# 'orderId'=>'12344',
|
449
|
+
# 'id' => '006',
|
425
450
|
# 'fundingSubmerchantId'=>'123456',
|
426
451
|
# 'fundsTransferId'=>'00009',
|
427
452
|
# 'amount'=>'9000',
|
453
|
+
#
|
428
454
|
# }
|
429
455
|
#
|
430
456
|
# path = "/tmp/litle-sdk-for-ruby/cert/"
|
@@ -471,7 +497,7 @@ module LitleOnline
|
|
471
497
|
|
472
498
|
def test_echeck_pre_note_all
|
473
499
|
|
474
|
-
billToAddress = {'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
500
|
+
billToAddress = {'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
|
475
501
|
echeckSuccess = {'accType'=>'Corporate','accNum'=>'1092969901','routingNum'=>'011075150'}
|
476
502
|
echeckRoutErr = {'accType'=>'Checking','accNum'=>'6099999992','routingNum'=>'053133052'}
|
477
503
|
echeckAccErr = {'accType'=>'Corporate','accNum'=>'10@2969901','routingNum'=>'011100012'}
|
@@ -481,6 +507,7 @@ module LitleOnline
|
|
481
507
|
'version'=>'9.3',
|
482
508
|
'reportGroup'=>'Planets',
|
483
509
|
'orderId'=>'000',
|
510
|
+
'id' => '006',
|
484
511
|
'orderSource'=>'ecommerce',
|
485
512
|
'billToAddress'=> billToAddress,
|
486
513
|
'echeck' => echeckSuccess
|
@@ -491,6 +518,7 @@ module LitleOnline
|
|
491
518
|
'version'=>'9.3',
|
492
519
|
'reportGroup'=>'Planets',
|
493
520
|
'orderId'=>'900',
|
521
|
+
'id' => '006',
|
494
522
|
'orderSource'=>'ecommerce',
|
495
523
|
'billToAddress'=> billToAddress,
|
496
524
|
'echeck' => echeckRoutErr
|
@@ -501,6 +529,7 @@ module LitleOnline
|
|
501
529
|
'version'=>'9.3',
|
502
530
|
'reportGroup'=>'Planets',
|
503
531
|
'orderId'=>'301',
|
532
|
+
'id' => '006',
|
504
533
|
'orderSource'=>'ecommerce',
|
505
534
|
'billToAddress'=> billToAddress,
|
506
535
|
'echeck' => echeckAccErr
|
@@ -511,6 +540,7 @@ module LitleOnline
|
|
511
540
|
'version'=>'9.3',
|
512
541
|
'reportGroup'=>'Planets',
|
513
542
|
'orderId'=>'000',
|
543
|
+
'id' => '006',
|
514
544
|
'orderSource'=>'ecommerce',
|
515
545
|
'billToAddress'=> billToAddress,
|
516
546
|
'echeck' => echeckSuccess
|
@@ -521,6 +551,7 @@ module LitleOnline
|
|
521
551
|
'version'=>'9.3',
|
522
552
|
'reportGroup'=>'Planets',
|
523
553
|
'orderId'=>'900',
|
554
|
+
'id' => '006',
|
524
555
|
'orderSource'=>'ecommerce',
|
525
556
|
'billToAddress'=> billToAddress,
|
526
557
|
'echeck' => echeckRoutErr
|
@@ -531,6 +562,7 @@ module LitleOnline
|
|
531
562
|
'version'=>'9.3',
|
532
563
|
'reportGroup'=>'Planets',
|
533
564
|
'orderId'=>'301',
|
565
|
+
'id' => '006',
|
534
566
|
'orderSource'=>'ecommerce',
|
535
567
|
'billToAddress'=> billToAddress,
|
536
568
|
'echeck' => echeckAccErr
|
@@ -568,7 +600,7 @@ module LitleOnline
|
|
568
600
|
request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
|
569
601
|
assert_not_nil transaction["litleTxnId"] =~ /\d+/
|
570
602
|
assert_not_nil transaction["message"]
|
571
|
-
|
603
|
+
assert_not_nil transaction["response"]
|
572
604
|
count+=1
|
573
605
|
end})
|
574
606
|
assert_equal 6,count
|
@@ -32,16 +32,17 @@ module LitleOnline
|
|
32
32
|
def test_simple_card_happy
|
33
33
|
hash = {
|
34
34
|
'merchantId' => '101',
|
35
|
+
'id' =>'test',
|
35
36
|
'version'=>'8.8',
|
36
37
|
'reportGroup'=>'Planets',
|
37
38
|
'orderId' =>'1001',
|
38
39
|
'amount' =>'500',
|
39
40
|
'orderSource' =>'ecommerce',
|
40
41
|
'card'=>{
|
41
|
-
'type'=>'
|
42
|
+
'type'=>'GC',
|
42
43
|
'number' =>'4100000000000001',
|
43
44
|
'expDate' =>'1210'
|
44
|
-
|
45
|
+
}
|
45
46
|
}
|
46
47
|
|
47
48
|
response= LitleOnlineRequest.new.activate(hash)
|
@@ -52,6 +53,7 @@ def test_simple_virtualGiftCard_happy
|
|
52
53
|
hash = {
|
53
54
|
'merchantId' => '101',
|
54
55
|
'version'=>'8.8',
|
56
|
+
'id' =>'test',
|
55
57
|
'reportGroup'=>'Planets',
|
56
58
|
'orderId' =>'1001',
|
57
59
|
'amount' =>'500',
|
@@ -59,7 +61,7 @@ def test_simple_virtualGiftCard_happy
|
|
59
61
|
'virtualGiftCard'=>{
|
60
62
|
'accountNumberLength'=>'13',
|
61
63
|
'giftCardBin'=>'giftCardBinString'
|
62
|
-
|
64
|
+
}
|
63
65
|
}
|
64
66
|
|
65
67
|
response= LitleOnlineRequest.new.activate(hash)
|
@@ -70,12 +72,13 @@ def test_simple_virtualGiftCard_happy
|
|
70
72
|
hash = {
|
71
73
|
'merchantId' => '101',
|
72
74
|
'version'=>'8.8',
|
75
|
+
'id' =>'test',
|
73
76
|
'reportGroup'=>'Planets',
|
74
77
|
'amount' =>'500',
|
75
78
|
'orderId' =>'1001',
|
76
79
|
'orderSource' =>'ecommerce',
|
77
80
|
'card'=>{
|
78
|
-
'type'=>'
|
81
|
+
'type'=>'GC',
|
79
82
|
'number' =>'4100000000000001',
|
80
83
|
'expDate' =>'1210'
|
81
84
|
}
|
@@ -100,5 +103,30 @@ def test_simple_virtualGiftCard_happy
|
|
100
103
|
#Test
|
101
104
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
102
105
|
end
|
106
|
+
|
107
|
+
def test_GiftCardCardType_NotPresent
|
108
|
+
hash = {
|
109
|
+
'merchantId' => '101',
|
110
|
+
'version'=>'8.8',
|
111
|
+
'id' =>'test',
|
112
|
+
'reportGroup'=>'Planets',
|
113
|
+
'amount' =>'500',
|
114
|
+
'orderId' =>'1001',
|
115
|
+
'orderSource' =>'ecommerce',
|
116
|
+
'card'=>{
|
117
|
+
'type'=>'VI',
|
118
|
+
'number' =>'4100000000000001',
|
119
|
+
'expDate' =>'1210'
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
#Get exceptions
|
124
|
+
exception = assert_raise(RuntimeError){
|
125
|
+
LitleOnlineRequest.new.activate(hash)
|
126
|
+
}
|
127
|
+
#Test
|
128
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
129
|
+
end
|
130
|
+
|
103
131
|
end
|
104
132
|
end
|
@@ -32,13 +32,26 @@ module LitleOnline
|
|
32
32
|
def test_simple
|
33
33
|
hash = {
|
34
34
|
'merchantId' => '101',
|
35
|
+
'id' => 'test',
|
35
36
|
'version'=>'8.8',
|
36
37
|
'reportGroup'=>'Planets',
|
37
|
-
'litleTxnId' =>'5000'
|
38
|
-
|
38
|
+
'litleTxnId' =>'5000',
|
39
|
+
'card'=>{
|
40
|
+
'type'=>'GC',
|
41
|
+
'number' =>'400000000000001',
|
42
|
+
'expDate' =>'0150',
|
43
|
+
'pin' => '1234',
|
44
|
+
'cardValidationNum' => '411'
|
45
|
+
},
|
46
|
+
'originalRefCode' => '101',
|
47
|
+
'originalAmount' => '34561',
|
48
|
+
'originalTxnTime' => '2017-01-24T09:00:00',
|
49
|
+
'originalSystemTraceId' => '33',
|
50
|
+
'originalSequenceNumber' => '111111',
|
51
|
+
}
|
39
52
|
|
40
|
-
response= LitleOnlineRequest.new.
|
41
|
-
assert_equal('
|
53
|
+
response= LitleOnlineRequest.new.deposit_reversal(hash)
|
54
|
+
assert_equal('000', response.depositReversalResponse.response)
|
42
55
|
end
|
43
56
|
|
44
57
|
|
@@ -49,7 +62,7 @@ def test_simple
|
|
49
62
|
'reportGroup'=>'Planets',
|
50
63
|
}
|
51
64
|
|
52
|
-
|
65
|
+
#Get exceptions
|
53
66
|
exception = assert_raise(RuntimeError){
|
54
67
|
LitleOnlineRequest.new.activate_reversal(hash)
|
55
68
|
}
|
@@ -31,6 +31,7 @@ module LitleOnline
|
|
31
31
|
def test_simple_auth_with_card
|
32
32
|
hash = {
|
33
33
|
'merchantId' => '101',
|
34
|
+
'id' => 'test',
|
34
35
|
'version'=>'8.8',
|
35
36
|
'reportGroup'=>'Planets',
|
36
37
|
'orderId'=>'12344',
|
@@ -48,6 +49,7 @@ module LitleOnline
|
|
48
49
|
def test_simple_auth_with_paypal
|
49
50
|
hash = {
|
50
51
|
'merchantId' => '101',
|
52
|
+
'id' => 'test',
|
51
53
|
'version'=>'8.8',
|
52
54
|
'reportGroup'=>'Planets',
|
53
55
|
'amount'=>'106',
|
@@ -65,6 +67,7 @@ module LitleOnline
|
|
65
67
|
def test_simple_auth_with_applepay_and_secondaryAmount
|
66
68
|
hash = {
|
67
69
|
'merchantId' => '101',
|
70
|
+
'id' => 'test',
|
68
71
|
'version'=>'8.8',
|
69
72
|
'reportGroup'=>'Planets',
|
70
73
|
'orderId'=>'12344',
|
@@ -80,7 +83,9 @@ module LitleOnline
|
|
80
83
|
'transactionId'=>'1234'
|
81
84
|
},
|
82
85
|
'signature' =>'1',
|
83
|
-
|
86
|
+
# RUby SDK XML 10
|
87
|
+
#'version'=>'1'
|
88
|
+
'version'=>'1000000'
|
84
89
|
}}
|
85
90
|
response= LitleOnlineRequest.new.authorization(hash)
|
86
91
|
assert_equal('Insufficient Funds', response.authorizationResponse.message)
|
@@ -90,6 +95,7 @@ module LitleOnline
|
|
90
95
|
def test_illegal_order_source
|
91
96
|
hash = {
|
92
97
|
'merchantId' => '101',
|
98
|
+
'id' => 'test',
|
93
99
|
'version'=>'8.8',
|
94
100
|
'reportGroup'=>'Planets',
|
95
101
|
'orderId'=>'12344',
|
@@ -100,19 +106,18 @@ module LitleOnline
|
|
100
106
|
'number' =>'4100000000000001',
|
101
107
|
'expDate' =>'1210'
|
102
108
|
}}
|
103
|
-
|
104
109
|
#Get exceptions
|
105
110
|
exception = assert_raise(RuntimeError){
|
106
111
|
LitleOnlineRequest.new.authorization(hash)
|
107
112
|
}
|
108
113
|
#Test
|
109
114
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
110
|
-
|
111
115
|
end
|
112
116
|
|
113
117
|
def test_fields_out_of_order
|
114
118
|
hash = {
|
115
119
|
'merchantId' => '101',
|
120
|
+
'id' => 'test',
|
116
121
|
'version'=>'8.8',
|
117
122
|
'reportGroup'=>'Planets',
|
118
123
|
'orderId'=>'12344',
|
@@ -131,6 +136,7 @@ module LitleOnline
|
|
131
136
|
def test_invalid_field
|
132
137
|
hash = {
|
133
138
|
'merchantId' => '101',
|
139
|
+
'id' => 'test',
|
134
140
|
'version'=>'8.8',
|
135
141
|
'reportGroup'=>'Planets',
|
136
142
|
'orderId'=>'12344',
|
@@ -149,6 +155,7 @@ module LitleOnline
|
|
149
155
|
def test_no_order_id
|
150
156
|
hash = {
|
151
157
|
'merchantId' => '101',
|
158
|
+
'id' => 'test',
|
152
159
|
'version'=>'8.8',
|
153
160
|
'reportGroup'=>'Planets',
|
154
161
|
'amount'=>'106',
|
@@ -169,6 +176,7 @@ module LitleOnline
|
|
169
176
|
def test_no_amount
|
170
177
|
hash = {
|
171
178
|
'merchantId' => '101',
|
179
|
+
'id' => 'test',
|
172
180
|
'version'=>'8.8',
|
173
181
|
'reportGroup'=>'Planets',
|
174
182
|
'orderId'=>'12344',
|
@@ -189,9 +197,10 @@ module LitleOnline
|
|
189
197
|
def test_no_order_source
|
190
198
|
hash = {
|
191
199
|
'merchantId' => '101',
|
200
|
+
'id' => 'test',
|
192
201
|
'version'=>'8.8',
|
193
202
|
'reportGroup'=>'Planets',
|
194
|
-
#
|
203
|
+
# 'litleTxnId'=>'123456',
|
195
204
|
'orderId'=>'12344',
|
196
205
|
'amount'=>'106',
|
197
206
|
'card'=>{
|
@@ -218,7 +227,6 @@ module LitleOnline
|
|
218
227
|
'number' =>'4100000000000001',
|
219
228
|
'expDate' =>'1210'
|
220
229
|
}}
|
221
|
-
|
222
230
|
#Get exceptions
|
223
231
|
exception = assert_raise(RuntimeError){
|
224
232
|
LitleOnlineRequest.new.authorization(hash)
|
@@ -244,14 +252,16 @@ module LitleOnline
|
|
244
252
|
}
|
245
253
|
#Test
|
246
254
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
247
|
-
|
248
|
-
response = LitleOnlineRequest.new.authorization(
|
255
|
+
#SDK XML 10
|
256
|
+
#response = LitleOnlineRequest.new.authorization(start_hash.merge({'orderId'=>'1234'}))
|
257
|
+
response = LitleOnlineRequest.new.authorization(hash.merge({'orderId'=>'1234','id'=>'test'}))
|
249
258
|
assert_equal('000', response.authorizationResponse.response)
|
250
259
|
end
|
251
260
|
|
252
261
|
def test_ssn_optional
|
253
262
|
start_hash = {
|
254
263
|
'orderId'=>'12344',
|
264
|
+
'id' => 'test',
|
255
265
|
'merchantId'=>'101',
|
256
266
|
'reportGroup'=>'Planets',
|
257
267
|
'amount'=>'101',
|
@@ -271,6 +281,7 @@ module LitleOnline
|
|
271
281
|
def test_simple_auth_with_paypage
|
272
282
|
hash = {
|
273
283
|
'orderId'=>'12344',
|
284
|
+
'id' => 'test',
|
274
285
|
'amount'=>'106',
|
275
286
|
'orderSource'=>'ecommerce',
|
276
287
|
'paypage'=>{
|
@@ -287,6 +298,7 @@ module LitleOnline
|
|
287
298
|
def test_simple_auth_with_advanced_fraud_checks
|
288
299
|
hash = {
|
289
300
|
'merchantId' => '101',
|
301
|
+
'id' => 'test',
|
290
302
|
'version'=>'8.8',
|
291
303
|
'reportGroup'=>'Planets',
|
292
304
|
'orderId'=>'12355',
|
@@ -306,6 +318,7 @@ module LitleOnline
|
|
306
318
|
def test_simple_auth_with_mpos
|
307
319
|
hash = {
|
308
320
|
'orderId'=>'12344',
|
321
|
+
'id' => 'test',
|
309
322
|
'amount'=>'106',
|
310
323
|
'orderSource'=>'ecommerce',
|
311
324
|
'mpos'=>
|
@@ -321,81 +334,114 @@ module LitleOnline
|
|
321
334
|
assert_equal('000', response.authorizationResponse.response)
|
322
335
|
end
|
323
336
|
|
324
|
-
|
337
|
+
#SDK XML 10
|
338
|
+
def test_simple_auth_with_wallet1
|
339
|
+
hash = {
|
340
|
+
'merchantId' => '101',
|
341
|
+
'id' => 'test',
|
342
|
+
'version'=>'8.8',
|
343
|
+
'reportGroup'=>'Planets',
|
344
|
+
'amount'=>'106',
|
345
|
+
'orderId'=>'123456',
|
346
|
+
'orderSource'=>'ecommerce',
|
347
|
+
'paypal'=>
|
348
|
+
{
|
349
|
+
'payerId'=>'1234',
|
350
|
+
'token'=>'1234',
|
351
|
+
'transactionId'=>'123456'
|
352
|
+
},
|
353
|
+
'wallet'=> {
|
354
|
+
'walletSourceType' => 'MasterPass',
|
355
|
+
'walletSourceTypeId' => '102'
|
356
|
+
}}
|
357
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
358
|
+
assert_equal 'Valid Format', response.message
|
359
|
+
end
|
360
|
+
|
361
|
+
def test_simple_auth_with_enhancedAuthResponse
|
325
362
|
hash = {
|
326
363
|
'merchantId' => '101',
|
364
|
+
'id' => 'test',
|
327
365
|
'version'=>'8.8',
|
328
366
|
'reportGroup'=>'Planets',
|
329
367
|
'orderId'=>'12355',
|
330
368
|
'amount'=>'106',
|
331
369
|
'orderSource'=>'ecommerce',
|
332
370
|
'card'=>{
|
333
|
-
|
334
|
-
|
335
|
-
|
371
|
+
'type'=>'VI',
|
372
|
+
'number' =>'4100800000000000',
|
373
|
+
'expDate' =>'1210'
|
336
374
|
},
|
337
|
-
'processingType' => 'initialInstallment',
|
338
|
-
'originalNetworkTransactionId' => '9876543210',
|
339
|
-
'originalTransactionAmount' => '536981'
|
340
375
|
}
|
341
376
|
response= LitleOnlineRequest.new.authorization(hash)
|
342
|
-
assert_equal('
|
343
|
-
assert_equal('
|
377
|
+
assert_equal('visa', response.authorizationResponse.enhancedAuthResponse.networkResponse.endpoint)
|
378
|
+
assert_equal('135798642', response.authorizationResponse.enhancedAuthResponse.networkResponse.networkField.fieldValue)
|
379
|
+
assert_equal('4', response.authorizationResponse.enhancedAuthResponse.networkResponse.networkField['fieldNumber'])
|
380
|
+
assert_equal('Transaction Amount', response.authorizationResponse.enhancedAuthResponse.networkResponse.networkField['fieldName'])
|
344
381
|
end
|
345
|
-
|
346
|
-
def
|
382
|
+
|
383
|
+
def test_simple_auth_with_networkTransactionId
|
347
384
|
hash = {
|
348
385
|
'merchantId' => '101',
|
386
|
+
'id' => 'test',
|
349
387
|
'version'=>'8.8',
|
350
388
|
'reportGroup'=>'Planets',
|
351
|
-
'
|
352
|
-
'
|
353
|
-
'amount'=>'10000',
|
389
|
+
'orderId'=>'12355',
|
390
|
+
'amount'=>'106',
|
354
391
|
'orderSource'=>'ecommerce',
|
355
|
-
'processingType' => 'initialInstallment',
|
356
|
-
'originalNetworkTransactionId' => '9876543210',
|
357
|
-
'originalTransactionAmount' => '536981',
|
358
392
|
'card'=>{
|
359
|
-
|
360
|
-
|
361
|
-
|
393
|
+
'type'=>'VI',
|
394
|
+
'number' =>'4100800000000000',
|
395
|
+
'expDate' =>'1210'
|
362
396
|
},
|
363
|
-
'wallet'=>{
|
364
|
-
'walletSourceType'=>'VisaCheckout',
|
365
|
-
'walletSourceTypeId' => 'VCIND'
|
366
|
-
}
|
367
397
|
}
|
368
398
|
response= LitleOnlineRequest.new.authorization(hash)
|
369
|
-
assert_equal('000', response.authorizationResponse.response)
|
370
399
|
assert_equal('63225578415568556365452427825', response.authorizationResponse.networkTransactionId)
|
371
400
|
end
|
372
|
-
|
373
|
-
def
|
401
|
+
|
402
|
+
def test_processingType_originalNetworkTransactionId_originalTransactionAmount
|
374
403
|
hash = {
|
375
404
|
'merchantId' => '101',
|
405
|
+
'id' => 'test',
|
376
406
|
'version'=>'8.8',
|
377
407
|
'reportGroup'=>'Planets',
|
378
|
-
'
|
379
|
-
'
|
380
|
-
'amount'=>'10000',
|
408
|
+
'orderId'=>'12355',
|
409
|
+
'amount'=>'106',
|
381
410
|
'orderSource'=>'ecommerce',
|
411
|
+
'card'=>{
|
412
|
+
'type'=>'VI',
|
413
|
+
'number' =>'4100800000000000',
|
414
|
+
'expDate' =>'1210'
|
415
|
+
},
|
382
416
|
'processingType' => 'initialInstallment',
|
383
417
|
'originalNetworkTransactionId' => '9876543210',
|
384
|
-
'originalTransactionAmount' => '536981'
|
418
|
+
'originalTransactionAmount' => '536981'
|
419
|
+
}
|
420
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
421
|
+
assert_equal 'Valid Format', response.message
|
422
|
+
end
|
423
|
+
|
424
|
+
def test_eciIndicator
|
425
|
+
hash = {
|
426
|
+
'merchantId' => '101',
|
427
|
+
'id' => 'test',
|
428
|
+
'version'=>'8.8',
|
429
|
+
'reportGroup'=>'Planets',
|
430
|
+
'orderId'=>'12355',
|
431
|
+
'amount'=>'106',
|
432
|
+
'orderSource'=>'androidpay',
|
385
433
|
'card'=>{
|
386
|
-
|
387
|
-
|
388
|
-
|
434
|
+
'type'=>'VI',
|
435
|
+
'number' =>'4100800000000000',
|
436
|
+
'expDate' =>'1210'
|
389
437
|
},
|
390
|
-
'
|
391
|
-
|
392
|
-
|
393
|
-
}
|
438
|
+
'processingType' => 'initialInstallment',
|
439
|
+
'originalNetworkTransactionId' => '9876543210',
|
440
|
+
'originalTransactionAmount' => '536981'
|
394
441
|
}
|
395
442
|
response= LitleOnlineRequest.new.authorization(hash)
|
396
|
-
assert_equal
|
397
|
-
assert_equal('123456', response.authorizationResponse.cardSuffix)
|
443
|
+
assert_equal 'Valid Format', response.message
|
398
444
|
end
|
399
|
-
|
445
|
+
|
400
446
|
end
|
401
447
|
end
|