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
@@ -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
|
@@ -64,8 +64,10 @@ module LitleOnline
|
|
64
64
|
'amount'=>'106',
|
65
65
|
'payPalNotes'=>'Notes'
|
66
66
|
}
|
67
|
-
|
68
|
-
|
67
|
+
#Get exceptions
|
68
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.auth_reversal(hash)}
|
69
|
+
#Test
|
70
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
69
71
|
end
|
70
72
|
|
71
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
|
@@ -38,7 +38,7 @@ def test_simple_happy
|
|
38
38
|
'orderId' =>'1001',
|
39
39
|
'orderSource' =>'ecommerce',
|
40
40
|
'card'=>{
|
41
|
-
'type'=>'
|
41
|
+
'type'=>'GC',
|
42
42
|
'number' =>'4100000000000001',
|
43
43
|
'expDate' =>'1210'
|
44
44
|
}
|
@@ -57,7 +57,7 @@ def test_simple_happy
|
|
57
57
|
'orderSource' =>'ecommerce',
|
58
58
|
'orderId' =>'1001',
|
59
59
|
'card'=>{
|
60
|
-
'type'=>'
|
60
|
+
'type'=>'GC',
|
61
61
|
'number' =>'4100000000000001',
|
62
62
|
'expDate' =>'1210'
|
63
63
|
}
|
@@ -75,8 +75,33 @@ def test_simple_happy
|
|
75
75
|
'amount' =>'500',
|
76
76
|
}
|
77
77
|
|
78
|
-
|
79
|
-
|
78
|
+
#Get exceptions
|
79
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.balance_inquiry(hash)}
|
80
|
+
#Test
|
81
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_GiftCardCardType_NotPresent
|
85
|
+
hash = {
|
86
|
+
'merchantId' => '101',
|
87
|
+
'version'=>'8.8',
|
88
|
+
'id' =>'test',
|
89
|
+
'reportGroup'=>'Planets',
|
90
|
+
'amount' =>'500',
|
91
|
+
'orderId' =>'1001',
|
92
|
+
'orderSource' =>'ecommerce',
|
93
|
+
'card'=>{
|
94
|
+
'type'=>'VI',
|
95
|
+
'number' =>'4100000000000001',
|
96
|
+
'expDate' =>'1210'
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
#Get exceptions
|
101
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.balance_inquiry(hash)}
|
102
|
+
#Test
|
103
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
80
104
|
end
|
105
|
+
|
81
106
|
end
|
82
107
|
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
|
@@ -47,8 +47,10 @@ module LitleOnline
|
|
47
47
|
'reportGroup'=>'Planets',
|
48
48
|
}
|
49
49
|
|
50
|
-
|
51
|
-
|
50
|
+
#Get exceptions
|
51
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.cancel_subscription(hash)}
|
52
|
+
#Test
|
53
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
52
54
|
end
|
53
55
|
|
54
56
|
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
|
@@ -78,10 +78,45 @@ module LitleOnline
|
|
78
78
|
'version'=>'8.8',
|
79
79
|
'reportGroup'=>'Planets',
|
80
80
|
'amount'=>'106',
|
81
|
+
'pin'=>'3333'
|
82
|
+
}
|
83
|
+
#Get exceptions
|
84
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture(hash)}
|
85
|
+
#Test
|
86
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_custom_billing
|
90
|
+
hash = {
|
91
|
+
'merchantId' => '101',
|
92
|
+
'id' => '102',
|
93
|
+
'reportGroup'=>'Planets',
|
94
|
+
'amount'=>'106',
|
95
|
+
'secondaryAmount'=>'20',
|
96
|
+
'litleTxnId'=>'1234',
|
97
|
+
'customBilling'=>{
|
98
|
+
'city' =>'boston',
|
99
|
+
'descriptor' => 'card was present',
|
100
|
+
}}
|
101
|
+
response= LitleOnlineRequest.new.capture(hash)
|
102
|
+
assert_equal('Valid Format', response.message)
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_simple_capture_with_pin
|
106
|
+
hash = {
|
107
|
+
'merchantId' => '101',
|
108
|
+
'id' => '102',
|
109
|
+
'reportGroup'=>'Planets',
|
110
|
+
'amount'=>'106',
|
111
|
+
'secondaryAmount'=>'20',
|
112
|
+
'litleTxnId'=>'123456000',
|
113
|
+
'pin'=>'1234'
|
81
114
|
}
|
82
115
|
response= LitleOnlineRequest.new.capture(hash)
|
83
|
-
|
116
|
+
assert_equal('Valid Format', response.message)
|
84
117
|
end
|
118
|
+
|
119
|
+
|
85
120
|
|
86
121
|
end
|
87
122
|
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
|
@@ -187,8 +187,10 @@ module LitleOnline
|
|
187
187
|
'number' =>'4100000000000001',
|
188
188
|
'expDate' =>'1210'
|
189
189
|
}}
|
190
|
-
|
191
|
-
|
190
|
+
#Get exceptions
|
191
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture_given_auth(hash)}
|
192
|
+
#Test
|
193
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
192
194
|
end
|
193
195
|
|
194
196
|
def test_simple_captureGivenAuth_with_mpos
|
@@ -240,5 +242,54 @@ module LitleOnline
|
|
240
242
|
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
241
243
|
assert_equal('Valid Format', response.message)
|
242
244
|
end
|
245
|
+
|
246
|
+
def test_simple_capture_given_auth_with_processingType
|
247
|
+
hash = {
|
248
|
+
'merchantId' => '101',
|
249
|
+
'id'=>'test',
|
250
|
+
'version'=>'8.8',
|
251
|
+
'reportGroup'=>'Planets',
|
252
|
+
'orderId'=>'12344',
|
253
|
+
'amount'=>'106',
|
254
|
+
'orderSource'=>'ecommerce',
|
255
|
+
'authInformation' => {
|
256
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
257
|
+
'authAmount'=>'12345'
|
258
|
+
},
|
259
|
+
'processingType'=>'initialRecurring',
|
260
|
+
'card'=>{
|
261
|
+
'type'=>'VI',
|
262
|
+
'number' =>'4100000000000001',
|
263
|
+
'expDate' =>'1210'
|
264
|
+
}}
|
265
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
266
|
+
assert_equal('Valid Format', response.message)
|
267
|
+
end
|
268
|
+
|
269
|
+
def test_simple_capture_given_auth_with_originalNetworkTransactionId_originalTransactionAmount
|
270
|
+
hash = {
|
271
|
+
'merchantId' => '101',
|
272
|
+
'id'=>'test',
|
273
|
+
'version'=>'8.8',
|
274
|
+
'reportGroup'=>'Planets',
|
275
|
+
'orderId'=>'12344',
|
276
|
+
'amount'=>'106',
|
277
|
+
'orderSource'=>'ecommerce',
|
278
|
+
'authInformation' => {
|
279
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
280
|
+
'authAmount'=>'12345'
|
281
|
+
},
|
282
|
+
'card'=>{
|
283
|
+
'type'=>'VI',
|
284
|
+
'number' =>'4100000000000001',
|
285
|
+
'expDate' =>'1210'
|
286
|
+
},
|
287
|
+
'originalNetworkTransactionId'=>'987654321098765432109876543210',
|
288
|
+
'originalTransactionAmount'=>'10661'
|
289
|
+
}
|
290
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
291
|
+
assert_equal('Valid Format', response.message)
|
292
|
+
end
|
293
|
+
|
243
294
|
end
|
244
295
|
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
|
@@ -78,8 +78,10 @@ def test_simple_happy
|
|
78
78
|
'intervalType'=>'ANNUAL',
|
79
79
|
}
|
80
80
|
|
81
|
-
|
82
|
-
|
81
|
+
#Get exceptions
|
82
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.create_plan(hash)}
|
83
|
+
#Test
|
84
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
83
85
|
end
|
84
86
|
end
|
85
87
|
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
|
@@ -192,5 +192,21 @@ module LitleOnline
|
|
192
192
|
response= LitleOnlineRequest.new.credit(hash)
|
193
193
|
assert_equal('Valid Format', response.message)
|
194
194
|
end
|
195
|
+
|
196
|
+
def test_simple_credit_with_pin
|
197
|
+
hash = {
|
198
|
+
'merchantId' => '101',
|
199
|
+
'id' => '102',
|
200
|
+
'reportGroup'=>'Planets',
|
201
|
+
'amount'=>'106',
|
202
|
+
'secondaryAmount'=>'20',
|
203
|
+
'litleTxnId'=>'123456000',
|
204
|
+
'pin'=>'1234'
|
205
|
+
}
|
206
|
+
response= LitleOnlineRequest.new.credit(hash)
|
207
|
+
assert_equal('Valid Format', response.message)
|
208
|
+
assert_equal('000', response.creditResponse.response)
|
209
|
+
end
|
210
|
+
|
195
211
|
end
|
196
212
|
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
|
@@ -38,7 +38,7 @@ def test_simple_happy
|
|
38
38
|
'orderId' =>'1001',
|
39
39
|
'orderSource' =>'ecommerce',
|
40
40
|
'card'=>{
|
41
|
-
'type'=>'
|
41
|
+
'type'=>'GC',
|
42
42
|
'number' =>'4100000000000001',
|
43
43
|
'expDate' =>'1210'
|
44
44
|
}
|
@@ -57,7 +57,7 @@ def test_simple_happy
|
|
57
57
|
'orderSource' =>'ecommerce',
|
58
58
|
'orderId' =>'1001',
|
59
59
|
'card'=>{
|
60
|
-
'type'=>'
|
60
|
+
'type'=>'GC',
|
61
61
|
'number' =>'4100000000000001',
|
62
62
|
'expDate' =>'1210'
|
63
63
|
}
|
@@ -75,8 +75,31 @@ def test_simple_happy
|
|
75
75
|
'amount' =>'500',
|
76
76
|
}
|
77
77
|
|
78
|
-
|
79
|
-
|
78
|
+
#Get exceptions
|
79
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate(hash)}
|
80
|
+
#Test
|
81
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_CardType_NotGiftCard
|
85
|
+
hash = {
|
86
|
+
'merchantId' => '101',
|
87
|
+
'version'=>'8.8',
|
88
|
+
'id'=>'test',
|
89
|
+
'reportGroup'=>'Planets',
|
90
|
+
'orderId' =>'1001',
|
91
|
+
'orderSource' =>'ecommerce',
|
92
|
+
'card'=>{
|
93
|
+
'type'=>'VI',
|
94
|
+
'number' =>'4100000000000001',
|
95
|
+
'expDate' =>'1210'
|
96
|
+
}
|
97
|
+
}
|
98
|
+
#Get exceptions
|
99
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate(hash)}
|
100
|
+
#Test
|
101
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
80
102
|
end
|
103
|
+
|
81
104
|
end
|
82
105
|
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
|
'version'=>'8.8',
|
36
36
|
'id'=>'test',
|
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,10 @@ def test_simple
|
|
50
62
|
'reportGroup'=>'Planets',
|
51
63
|
}
|
52
64
|
|
53
|
-
|
54
|
-
|
65
|
+
#Get exceptions
|
66
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate_reversal(hash)}
|
67
|
+
#Test
|
68
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
55
69
|
end
|
56
70
|
end
|
57
71
|
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
|
@@ -22,37 +22,49 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
22
22
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
23
|
OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
=end
|
25
|
-
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
28
|
#test DepositReversal Transaction
|
29
29
|
module LitleOnline
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
hash = {
|
30
|
+
class TestDepositReversal < Test::Unit::TestCase
|
31
|
+
def test_simple
|
32
|
+
hash = {
|
34
33
|
'merchantId' => '101',
|
35
34
|
'version'=>'8.8',
|
36
35
|
'id'=>'test',
|
37
36
|
'reportGroup'=>'Planets',
|
38
|
-
'litleTxnId' =>'5000'
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
'litleTxnId' =>'5000',
|
38
|
+
'card'=>{
|
39
|
+
'type'=>'GC',
|
40
|
+
'number' =>'400000000000000',
|
41
|
+
'expDate' =>'0150',
|
42
|
+
'pin' => '1234',
|
43
|
+
'cardValidationNum' => '411'
|
44
|
+
},
|
45
|
+
'originalRefCode' => '101',
|
46
|
+
'originalAmount' => '34561',
|
47
|
+
'originalTxnTime' => '2017-01-24T09:00:00',
|
48
|
+
'originalSystemTraceId' => '33',
|
49
|
+
'originalSequenceNumber' => '111111',
|
50
|
+
}
|
44
51
|
|
52
|
+
response= LitleOnlineRequest.new.deposit_reversal(hash)
|
53
|
+
assert_equal('000', response.depositReversalResponse.response)
|
54
|
+
end
|
45
55
|
|
46
|
-
|
47
|
-
|
56
|
+
def test_simple_error
|
57
|
+
hash = {
|
48
58
|
'merchantId' => '101',
|
49
59
|
'version'=>'8.8',
|
50
60
|
'id'=>'test',
|
51
61
|
'reportGroup'=>'Planets',
|
52
|
-
|
62
|
+
}
|
53
63
|
|
54
|
-
|
55
|
-
|
64
|
+
#Get exceptions
|
65
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deposit_reversal(hash)}
|
66
|
+
#Test
|
67
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
68
|
+
end
|
56
69
|
end
|
57
|
-
end
|
58
70
|
end
|