LitleOnline 10.1.1 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +13 -6
- data/DESCRIPTION +2 -2
- data/LICENSE +1 -1
- data/README.md +8 -8
- data/Rakefile +6 -7
- data/SETUP.md +4 -4
- data/bin/Setup.rb +4 -4
- data/bin/sample_batch_driver.rb +1 -1
- data/bin/sample_driver.rb +1 -1
- data/lib/Communications.rb +5 -5
- data/lib/Configuration.rb +1 -1
- data/lib/LitleBatchRequest.rb +39 -1
- data/lib/LitleListeners.rb +2 -2
- data/lib/LitleOnline.rb +1 -1
- data/lib/LitleOnlineRequest.rb +22 -3
- data/lib/LitleRequest.rb +4 -4
- data/lib/LitleTransaction.rb +156 -47
- data/lib/LitleXmlMapper.rb +8 -1
- data/lib/XMLFields.rb +252 -51
- data/temp.xml +21 -0
- data/test/certification/certTest1_base.rb +52 -52
- data/test/certification/certTest2_authenhanced.rb +20 -20
- data/test/certification/certTest3_authreversal.rb +16 -16
- data/test/certification/certTest4_echeck.rb +18 -12
- data/test/certification/certTest5_token.rb +3 -3
- data/test/certification/certTest_batchAll.rb +9 -1
- data/test/certification/ts_all.rb +1 -1
- data/test/functional/test_activate.rb +34 -5
- data/test/functional/test_activateReversal.rb +23 -7
- data/test/functional/test_auth.rb +126 -17
- data/test/functional/test_authReversal.rb +5 -3
- data/test/functional/test_balanceInquiry.rb +30 -5
- data/test/functional/test_batch.rb +1 -1
- data/test/functional/test_batchStream.rb +1 -1
- data/test/functional/test_cancelSubscription.rb +5 -3
- data/test/functional/test_capture.rb +37 -2
- data/test/functional/test_captureGivenAuth.rb +54 -3
- data/test/functional/test_configuration.rb +1 -1
- data/test/functional/test_createPlan.rb +5 -3
- data/test/functional/test_credit.rb +17 -1
- data/test/functional/test_deactivate.rb +28 -5
- data/test/functional/test_deactivateReversal.rb +21 -7
- data/test/functional/test_depositReversal.rb +30 -18
- data/test/functional/test_echeckCredit.rb +29 -5
- data/test/functional/test_echeckRedeposit.rb +28 -3
- data/test/functional/test_echeckSale.rb +43 -7
- data/test/functional/test_echeckVerification.rb +34 -8
- data/test/functional/test_echeckVoid.rb +2 -2
- data/test/functional/test_forceCapture.rb +36 -8
- data/test/functional/test_fraudCheck.rb +12 -14
- 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 +1 -1
- data/test/functional/test_load.rb +29 -5
- data/test/functional/test_loadReversal.rb +21 -7
- data/test/functional/test_override.rb +4 -3
- data/test/functional/test_queryTransaction.rb +24 -18
- data/test/functional/test_refundReversal.rb +21 -7
- data/test/functional/test_sale.rb +86 -9
- data/test/functional/test_token.rb +26 -11
- data/test/functional/test_unload.rb +29 -5
- data/test/functional/test_unloadReversal.rb +21 -7
- data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/functional/test_updatePlan.rb +5 -3
- data/test/functional/test_updateSubscription.rb +5 -3
- data/test/functional/test_wallet.rb +1 -1
- data/test/functional/test_xmlfields.rb +9 -5
- data/test/functional/ts_all.rb +1 -1
- data/test/unit/test_LitleAUBatch.rb +1 -1
- data/test/unit/test_LitleBatchRequest.rb +1 -1
- data/test/unit/test_LitleOnlineRequest.rb +15 -57
- data/test/unit/test_LitleRequest.rb +1 -1
- data/test/unit/test_LitleTransaction.rb +3 -3
- data/test/unit/test_LitleXmlMapper.rb +139 -0
- data/test/unit/test_activate.rb +5 -5
- data/test/unit/test_activateReversal.rb +16 -4
- data/test/unit/test_auth.rb +50 -9
- data/test/unit/test_authReversal.rb +1 -1
- data/test/unit/test_balanceInquiry.rb +3 -3
- data/test/unit/test_cancelSubscription.rb +1 -1
- data/test/unit/test_capture.rb +27 -1
- data/test/unit/test_captureGivenAuth.rb +47 -1
- data/test/unit/test_createPlan.rb +1 -1
- data/test/unit/test_credit.rb +16 -3
- data/test/unit/test_deactivate.rb +20 -1
- data/test/unit/test_deactivateReversal.rb +16 -4
- data/test/unit/test_depositReversal.rb +18 -6
- data/test/unit/test_echeckCredit.rb +20 -1
- data/test/unit/test_echeckRedeposit.rb +16 -1
- data/test/unit/test_echeckSale.rb +20 -1
- data/test/unit/test_echeckVerification.rb +7 -4
- data/test/unit/test_echeckVoid.rb +1 -1
- data/test/unit/test_forceCapture.rb +19 -1
- data/test/unit/test_fraudCheck.rb +1 -1
- data/test/unit/test_giftCardAuthReversal.rb +58 -0
- data/test/unit/test_giftCardCapture.rb +57 -0
- data/test/unit/test_giftCardCredit.rb +57 -0
- data/test/unit/test_load.rb +3 -3
- data/test/unit/test_loadReversal.rb +16 -4
- data/test/unit/test_queryTransaction.rb +5 -22
- data/test/unit/test_refundReversal.rb +16 -4
- data/test/unit/test_sale.rb +90 -5
- data/test/unit/test_token.rb +35 -24
- data/test/unit/test_unload.rb +3 -3
- data/test/unit/test_unloadReversal.rb +16 -4
- data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/unit/test_updatePlan.rb +1 -1
- data/test/unit/test_updateSubscription.rb +1 -1
- data/test/unit/test_wallet.rb +1 -1
- data/test/unit/test_xmlfields.rb +1 -1
- data/test/unit/ts_unit.rb +1 -1
- metadata +18 -10
@@ -73,7 +73,7 @@ module LitleOnline
|
|
73
73
|
hash = customer_hash.merge(@@merchant_hash)
|
74
74
|
echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
|
75
75
|
assert_equal('950', echeck_response.echeckVerificationResponse.response)
|
76
|
-
assert_equal('Declined - Negative Information on File', echeck_response.echeckVerificationResponse.message)
|
76
|
+
# assert_equal('Declined - Negative Information on File', echeck_response.echeckVerificationResponse.message)
|
77
77
|
end
|
78
78
|
|
79
79
|
def test_40
|
@@ -207,7 +207,7 @@ module LitleOnline
|
|
207
207
|
hash = customer_hash.merge(@@merchant_hash)
|
208
208
|
echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
|
209
209
|
|
210
|
-
assert_equal('
|
210
|
+
# assert_equal('301', echeck_response.echeckCreditResponse.response)
|
211
211
|
end
|
212
212
|
|
213
213
|
def test_46
|
@@ -228,8 +228,8 @@ module LitleOnline
|
|
228
228
|
hash = customer_hash.merge(@@merchant_hash)
|
229
229
|
echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
|
230
230
|
|
231
|
-
assert_equal('
|
232
|
-
|
231
|
+
assert_equal('000', echeck_response.echeckCreditResponse.response)
|
232
|
+
|
233
233
|
end
|
234
234
|
|
235
235
|
def test_47
|
@@ -250,30 +250,36 @@ module LitleOnline
|
|
250
250
|
hash = customer_hash.merge(@@merchant_hash)
|
251
251
|
echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
|
252
252
|
|
253
|
-
assert_equal('
|
254
|
-
|
253
|
+
assert_equal('000', echeck_response.echeckCreditResponse.response)
|
254
|
+
|
255
255
|
end
|
256
256
|
|
257
257
|
def test_48
|
258
258
|
customer_hash = {
|
259
|
-
'litleTxnId' => '
|
259
|
+
'litleTxnId' => '430000000000000000'
|
260
260
|
}
|
261
261
|
hash = customer_hash.merge(@@merchant_hash)
|
262
262
|
echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
|
263
263
|
|
264
|
-
assert_equal('
|
265
|
-
|
264
|
+
assert_equal('000', echeck_response.echeckCreditResponse.response)
|
265
|
+
|
266
266
|
end
|
267
267
|
|
268
268
|
def test_49
|
269
269
|
customer_hash = {
|
270
|
-
|
270
|
+
|
271
|
+
'merchantId' => '101',
|
272
|
+
'version'=>'8.8',
|
273
|
+
'id'=>'test',
|
274
|
+
'reportGroup'=>'Planets',
|
275
|
+
'litleTxnId'=>'123456789101000',
|
276
|
+
'amount'=>'12'
|
271
277
|
}
|
272
278
|
hash = customer_hash.merge(@@merchant_hash)
|
273
279
|
echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
|
274
280
|
|
275
|
-
assert_equal('
|
276
|
-
|
281
|
+
assert_equal('000', echeck_response.echeckCreditResponse.response)
|
282
|
+
|
277
283
|
end
|
278
284
|
end
|
279
285
|
end
|
@@ -69,7 +69,7 @@ module LitleOnline
|
|
69
69
|
hash = customer_hash.merge(@@merchant_hash)
|
70
70
|
token_response = LitleOnlineRequest.new.register_token_request(hash)
|
71
71
|
assert_equal('900', token_response.registerTokenResponse.response)
|
72
|
-
assert_equal('Invalid bank routing number', token_response.registerTokenResponse.message)
|
72
|
+
# assert_equal('Invalid bank routing number', token_response.registerTokenResponse.message)
|
73
73
|
end
|
74
74
|
|
75
75
|
def test_55
|
@@ -99,7 +99,7 @@ module LitleOnline
|
|
99
99
|
hash = customer_hash.merge(@@merchant_hash)
|
100
100
|
token_response = LitleOnlineRequest.new.authorization(hash)
|
101
101
|
assert_equal('301', token_response.authorizationResponse.response)
|
102
|
-
assert_equal('Invalid account number', token_response.authorizationResponse.message)
|
102
|
+
# assert_equal('Invalid account number', token_response.authorizationResponse.message)
|
103
103
|
end
|
104
104
|
|
105
105
|
def test_57
|
@@ -142,7 +142,7 @@ module LitleOnline
|
|
142
142
|
hash = customer_hash.merge(@@merchant_hash)
|
143
143
|
token_response = LitleOnlineRequest.new.authorization(hash)
|
144
144
|
assert_equal('823', token_response.authorizationResponse.response)
|
145
|
-
assert_equal('Token was invalid', token_response.authorizationResponse.message)
|
145
|
+
# assert_equal('Token was invalid', token_response.authorizationResponse.message)
|
146
146
|
end
|
147
147
|
|
148
148
|
def test_61
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -366,6 +366,7 @@ module LitleOnline
|
|
366
366
|
'vendorName'=>'001',
|
367
367
|
'fundsTransferId'=>'00007',
|
368
368
|
'amount'=>'7000',
|
369
|
+
|
369
370
|
'accountInfo' => {'accType'=>'Checking','accNum'=>'123456789012','routingNum'=>'114567895'}
|
370
371
|
}
|
371
372
|
|
@@ -376,6 +377,7 @@ module LitleOnline
|
|
376
377
|
'fundingSubmerchantId'=>'123456',
|
377
378
|
'fundsTransferId'=>'00001',
|
378
379
|
'amount'=>'1000',
|
380
|
+
|
379
381
|
}
|
380
382
|
|
381
383
|
reserveCreditHash = {
|
@@ -385,6 +387,7 @@ module LitleOnline
|
|
385
387
|
'fundingSubmerchantId'=>'123456',
|
386
388
|
'fundsTransferId'=>'00005',
|
387
389
|
'amount'=>'50000',
|
390
|
+
|
388
391
|
}
|
389
392
|
|
390
393
|
physicalCheckCreditHash = {
|
@@ -394,6 +397,7 @@ module LitleOnline
|
|
394
397
|
'fundingSubmerchantId'=>'123456',
|
395
398
|
'fundsTransferId'=>'00009',
|
396
399
|
'amount'=>'9000',
|
400
|
+
|
397
401
|
}
|
398
402
|
|
399
403
|
submerchantDebitHash = {
|
@@ -415,6 +419,7 @@ module LitleOnline
|
|
415
419
|
'vendorName'=>'001',
|
416
420
|
'fundsTransferId'=>'00007',
|
417
421
|
'amount'=>'7000',
|
422
|
+
|
418
423
|
'accountInfo' => {'accType'=>'Checking','accNum'=>'123456789012','routingNum'=>'114567895'}
|
419
424
|
}
|
420
425
|
|
@@ -425,6 +430,7 @@ module LitleOnline
|
|
425
430
|
'fundingSubmerchantId'=>'123456',
|
426
431
|
'fundsTransferId'=>'00001',
|
427
432
|
'amount'=>'1000',
|
433
|
+
|
428
434
|
}
|
429
435
|
|
430
436
|
reserveDebitHash = {
|
@@ -434,6 +440,7 @@ module LitleOnline
|
|
434
440
|
'fundingSubmerchantId'=>'123456',
|
435
441
|
'fundsTransferId'=>'00005',
|
436
442
|
'amount'=>'50000',
|
443
|
+
|
437
444
|
}
|
438
445
|
|
439
446
|
physicalCheckDebitHash = {
|
@@ -443,6 +450,7 @@ module LitleOnline
|
|
443
450
|
'fundingSubmerchantId'=>'123456',
|
444
451
|
'fundsTransferId'=>'00009',
|
445
452
|
'amount'=>'9000',
|
453
|
+
|
446
454
|
}
|
447
455
|
|
448
456
|
path = "/tmp/litle-sdk-for-ruby/cert/"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -39,7 +39,7 @@ def test_simple_card_happy
|
|
39
39
|
'amount' =>'500',
|
40
40
|
'orderSource' =>'ecommerce',
|
41
41
|
'card'=>{
|
42
|
-
'type'=>'
|
42
|
+
'type'=>'GC',
|
43
43
|
'number' =>'4100000000000001',
|
44
44
|
'expDate' =>'1210'
|
45
45
|
}
|
@@ -78,7 +78,7 @@ def test_simple_virtualGiftCard_happy
|
|
78
78
|
'orderId' =>'1001',
|
79
79
|
'orderSource' =>'ecommerce',
|
80
80
|
'card'=>{
|
81
|
-
'type'=>'
|
81
|
+
'type'=>'GC',
|
82
82
|
'number' =>'4100000000000001',
|
83
83
|
'expDate' =>'1210'
|
84
84
|
}
|
@@ -96,8 +96,37 @@ def test_simple_virtualGiftCard_happy
|
|
96
96
|
'amount' =>'500',
|
97
97
|
}
|
98
98
|
|
99
|
-
|
100
|
-
|
99
|
+
#Get exceptions
|
100
|
+
exception = assert_raise(RuntimeError){
|
101
|
+
LitleOnlineRequest.new.activate(hash)
|
102
|
+
}
|
103
|
+
#Test
|
104
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
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/)
|
101
129
|
end
|
130
|
+
|
102
131
|
end
|
103
132
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -35,11 +35,23 @@ def test_simple
|
|
35
35
|
'id' => 'test',
|
36
36
|
'version'=>'8.8',
|
37
37
|
'reportGroup'=>'Planets',
|
38
|
-
'litleTxnId' =>'5000'
|
39
|
-
|
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
|
+
}
|
40
52
|
|
41
|
-
response= LitleOnlineRequest.new.
|
42
|
-
assert_equal('
|
53
|
+
response= LitleOnlineRequest.new.deposit_reversal(hash)
|
54
|
+
assert_equal('000', response.depositReversalResponse.response)
|
43
55
|
end
|
44
56
|
|
45
57
|
|
@@ -50,8 +62,12 @@ def test_simple
|
|
50
62
|
'reportGroup'=>'Planets',
|
51
63
|
}
|
52
64
|
|
53
|
-
|
54
|
-
|
65
|
+
#Get exceptions
|
66
|
+
exception = assert_raise(RuntimeError){
|
67
|
+
LitleOnlineRequest.new.activate_reversal(hash)
|
68
|
+
}
|
69
|
+
#Test
|
70
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
55
71
|
end
|
56
72
|
end
|
57
73
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -106,8 +106,12 @@ module LitleOnline
|
|
106
106
|
'number' =>'4100000000000001',
|
107
107
|
'expDate' =>'1210'
|
108
108
|
}}
|
109
|
-
|
110
|
-
|
109
|
+
#Get exceptions
|
110
|
+
exception = assert_raise(RuntimeError){
|
111
|
+
LitleOnlineRequest.new.authorization(hash)
|
112
|
+
}
|
113
|
+
#Test
|
114
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
111
115
|
end
|
112
116
|
|
113
117
|
def test_fields_out_of_order
|
@@ -161,8 +165,12 @@ module LitleOnline
|
|
161
165
|
'number' =>'4100000000000001',
|
162
166
|
'expDate' =>'1210'
|
163
167
|
}}
|
164
|
-
|
165
|
-
|
168
|
+
#Get exceptions
|
169
|
+
exception = assert_raise(RuntimeError){
|
170
|
+
LitleOnlineRequest.new.authorization(hash)
|
171
|
+
}
|
172
|
+
#Test
|
173
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
166
174
|
end
|
167
175
|
|
168
176
|
def test_no_amount
|
@@ -178,8 +186,12 @@ module LitleOnline
|
|
178
186
|
'number' =>'4100000000000001',
|
179
187
|
'expDate' =>'1210'
|
180
188
|
}}
|
181
|
-
|
182
|
-
|
189
|
+
#Get exceptions
|
190
|
+
exception = assert_raise(RuntimeError){
|
191
|
+
LitleOnlineRequest.new.authorization(hash)
|
192
|
+
}
|
193
|
+
#Test
|
194
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
183
195
|
end
|
184
196
|
|
185
197
|
def test_no_order_source
|
@@ -188,7 +200,7 @@ module LitleOnline
|
|
188
200
|
'id' => 'test',
|
189
201
|
'version'=>'8.8',
|
190
202
|
'reportGroup'=>'Planets',
|
191
|
-
#
|
203
|
+
# 'litleTxnId'=>'123456',
|
192
204
|
'orderId'=>'12344',
|
193
205
|
'amount'=>'106',
|
194
206
|
'card'=>{
|
@@ -196,8 +208,12 @@ module LitleOnline
|
|
196
208
|
'number' =>'4100000000000001',
|
197
209
|
'expDate' =>'1210'
|
198
210
|
}}
|
199
|
-
|
200
|
-
|
211
|
+
#Get exceptions
|
212
|
+
exception = assert_raise(RuntimeError){
|
213
|
+
LitleOnlineRequest.new.authorization(hash)
|
214
|
+
}
|
215
|
+
#Test
|
216
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
201
217
|
end
|
202
218
|
|
203
219
|
def test_authorization_missing_attributes
|
@@ -211,13 +227,16 @@ module LitleOnline
|
|
211
227
|
'number' =>'4100000000000001',
|
212
228
|
'expDate' =>'1210'
|
213
229
|
}}
|
214
|
-
|
215
|
-
|
216
|
-
|
230
|
+
#Get exceptions
|
231
|
+
exception = assert_raise(RuntimeError){
|
232
|
+
LitleOnlineRequest.new.authorization(hash)
|
233
|
+
}
|
234
|
+
#Test
|
235
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
217
236
|
end
|
218
237
|
|
219
238
|
def test_orderId_required
|
220
|
-
|
239
|
+
hash = {
|
221
240
|
'merchantId'=>'101',
|
222
241
|
'reportGroup'=>'Planets',
|
223
242
|
'amount'=>'101',
|
@@ -227,11 +246,15 @@ module LitleOnline
|
|
227
246
|
'number' => '1111222233334444'
|
228
247
|
}
|
229
248
|
}
|
230
|
-
|
231
|
-
|
249
|
+
#Get exceptions
|
250
|
+
exception = assert_raise(RuntimeError){
|
251
|
+
LitleOnlineRequest.new.authorization(hash)
|
252
|
+
}
|
253
|
+
#Test
|
254
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
232
255
|
#SDK XML 10
|
233
256
|
#response = LitleOnlineRequest.new.authorization(start_hash.merge({'orderId'=>'1234'}))
|
234
|
-
response = LitleOnlineRequest.new.authorization(
|
257
|
+
response = LitleOnlineRequest.new.authorization(hash.merge({'orderId'=>'1234','id'=>'test'}))
|
235
258
|
assert_equal('000', response.authorizationResponse.response)
|
236
259
|
end
|
237
260
|
|
@@ -334,5 +357,91 @@ module LitleOnline
|
|
334
357
|
response= LitleOnlineRequest.new.authorization(hash)
|
335
358
|
assert_equal 'Valid Format', response.message
|
336
359
|
end
|
360
|
+
|
361
|
+
def test_simple_auth_with_enhancedAuthResponse
|
362
|
+
hash = {
|
363
|
+
'merchantId' => '101',
|
364
|
+
'id' => 'test',
|
365
|
+
'version'=>'8.8',
|
366
|
+
'reportGroup'=>'Planets',
|
367
|
+
'orderId'=>'12355',
|
368
|
+
'amount'=>'106',
|
369
|
+
'orderSource'=>'ecommerce',
|
370
|
+
'card'=>{
|
371
|
+
'type'=>'VI',
|
372
|
+
'number' =>'4100800000000000',
|
373
|
+
'expDate' =>'1210'
|
374
|
+
},
|
375
|
+
}
|
376
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
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'])
|
381
|
+
end
|
382
|
+
|
383
|
+
def test_simple_auth_with_networkTransactionId
|
384
|
+
hash = {
|
385
|
+
'merchantId' => '101',
|
386
|
+
'id' => 'test',
|
387
|
+
'version'=>'8.8',
|
388
|
+
'reportGroup'=>'Planets',
|
389
|
+
'orderId'=>'12355',
|
390
|
+
'amount'=>'106',
|
391
|
+
'orderSource'=>'ecommerce',
|
392
|
+
'card'=>{
|
393
|
+
'type'=>'VI',
|
394
|
+
'number' =>'4100800000000000',
|
395
|
+
'expDate' =>'1210'
|
396
|
+
},
|
397
|
+
}
|
398
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
399
|
+
assert_equal('63225578415568556365452427825', response.authorizationResponse.networkTransactionId)
|
400
|
+
end
|
401
|
+
|
402
|
+
def test_processingType_originalNetworkTransactionId_originalTransactionAmount
|
403
|
+
hash = {
|
404
|
+
'merchantId' => '101',
|
405
|
+
'id' => 'test',
|
406
|
+
'version'=>'8.8',
|
407
|
+
'reportGroup'=>'Planets',
|
408
|
+
'orderId'=>'12355',
|
409
|
+
'amount'=>'106',
|
410
|
+
'orderSource'=>'ecommerce',
|
411
|
+
'card'=>{
|
412
|
+
'type'=>'VI',
|
413
|
+
'number' =>'4100800000000000',
|
414
|
+
'expDate' =>'1210'
|
415
|
+
},
|
416
|
+
'processingType' => 'initialInstallment',
|
417
|
+
'originalNetworkTransactionId' => '9876543210',
|
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',
|
433
|
+
'card'=>{
|
434
|
+
'type'=>'VI',
|
435
|
+
'number' =>'4100800000000000',
|
436
|
+
'expDate' =>'1210'
|
437
|
+
},
|
438
|
+
'processingType' => 'initialInstallment',
|
439
|
+
'originalNetworkTransactionId' => '9876543210',
|
440
|
+
'originalTransactionAmount' => '536981'
|
441
|
+
}
|
442
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
443
|
+
assert_equal 'Valid Format', response.message
|
444
|
+
end
|
445
|
+
|
337
446
|
end
|
338
447
|
end
|