LitleOnline 9.3.3 → 9.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +15 -2
- data/DESCRIPTION +2 -2
- data/LICENSE +1 -1
- data/README.md +9 -9
- data/Rakefile +8 -8
- data/SETUP.md +3 -3
- 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 +7 -7
- data/lib/Configuration.rb +1 -1
- data/lib/LitleBatchRequest.rb +3 -3
- data/lib/LitleListeners.rb +1 -1
- data/lib/LitleOnline.rb +2 -2
- data/lib/LitleOnlineRequest.rb +4 -4
- data/lib/LitleRequest.rb +3 -3
- data/lib/LitleTransaction.rb +45 -21
- data/lib/LitleXmlMapper.rb +9 -4
- data/lib/XMLFields.rb +100 -15
- data/temp.xml +21 -0
- data/test/certification/certTest_batchAll.rb +15 -10
- data/test/certification/ts_all.rb +1 -1
- data/test/functional/test_activate.rb +7 -3
- data/test/functional/test_activateReversal.rb +7 -3
- data/test/functional/test_auth.rb +119 -16
- data/test/functional/test_authReversal.rb +5 -3
- data/test/functional/test_balanceInquiry.rb +5 -3
- 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 +34 -3
- data/test/functional/test_captureGivenAuth.rb +55 -4
- 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 +5 -3
- data/test/functional/test_deactivateReversal.rb +5 -3
- data/test/functional/test_depositReversal.rb +5 -3
- data/test/functional/test_echeckCredit.rb +13 -9
- data/test/functional/test_echeckRedeposit.rb +5 -3
- data/test/functional/test_echeckSale.rb +20 -29
- data/test/functional/test_echeckVerification.rb +20 -12
- data/test/functional/test_echeckVoid.rb +1 -1
- data/test/functional/test_forceCapture.rb +27 -5
- data/test/functional/test_fraudCheck.rb +10 -10
- data/test/functional/test_litle_requests.rb +1 -1
- data/test/functional/test_load.rb +5 -3
- data/test/functional/test_loadReversal.rb +5 -3
- data/test/functional/test_refundReversal.rb +5 -3
- data/test/functional/test_sale.rb +176 -29
- data/test/functional/test_token.rb +18 -3
- data/test/functional/test_unload.rb +5 -3
- data/test/functional/test_unloadReversal.rb +6 -4
- 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_utf8.rb +44 -0
- data/test/functional/test_xmlfields.rb +10 -6
- data/test/functional/ts_all.rb +1 -1
- data/test/unit/test_LitleAUBatch.rb +1 -1
- data/test/unit/test_LitleBatchRequest.rb +4 -4
- data/test/unit/test_LitleOnlineRequest.rb +37 -54
- data/test/unit/test_LitleRequest.rb +1 -1
- data/test/unit/test_LitleTransaction.rb +5 -5
- data/test/unit/test_LitleXmlMapper.rb +136 -0
- data/test/unit/test_activate.rb +1 -21
- data/test/unit/test_activateReversal.rb +1 -1
- data/test/unit/test_auth.rb +51 -11
- data/test/unit/test_authReversal.rb +1 -1
- data/test/unit/test_balanceInquiry.rb +1 -1
- data/test/unit/test_cancelSubscription.rb +1 -1
- data/test/unit/test_capture.rb +27 -1
- data/test/unit/test_captureGivenAuth.rb +44 -18
- data/test/unit/test_createPlan.rb +1 -1
- data/test/unit/test_credit.rb +16 -3
- data/test/unit/test_deactivate.rb +1 -1
- data/test/unit/test_deactivateReversal.rb +1 -1
- data/test/unit/test_depositReversal.rb +1 -1
- data/test/unit/test_echeckCredit.rb +1 -1
- data/test/unit/test_echeckRedeposit.rb +1 -1
- data/test/unit/test_echeckSale.rb +2 -2
- data/test/unit/test_echeckVerification.rb +1 -1
- data/test/unit/test_echeckVoid.rb +1 -1
- data/test/unit/test_forceCapture.rb +20 -2
- data/test/unit/test_fraudCheck.rb +1 -1
- data/test/unit/test_load.rb +1 -1
- data/test/unit/test_loadReversal.rb +1 -1
- data/test/unit/test_refundReversal.rb +1 -1
- data/test/unit/test_sale.rb +72 -6
- data/test/unit/test_token.rb +15 -4
- data/test/unit/test_unload.rb +1 -1
- data/test/unit/test_unloadReversal.rb +1 -1
- 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_xmlfields.rb +1 -1
- data/test/unit/ts_unit.rb +1 -1
- metadata +14 -11
@@ -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
|
@@ -61,8 +61,10 @@ module LitleOnline
|
|
61
61
|
'amount'=>'106',
|
62
62
|
'payPalNotes'=>'Notes'
|
63
63
|
}
|
64
|
-
|
65
|
-
|
64
|
+
#Get exceptions
|
65
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.auth_reversal(hash)}
|
66
|
+
#Test
|
67
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
66
68
|
end
|
67
69
|
|
68
70
|
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
|
@@ -73,8 +73,10 @@ def test_simple_happy
|
|
73
73
|
'amount' =>'500',
|
74
74
|
}
|
75
75
|
|
76
|
-
|
77
|
-
|
76
|
+
#Get exceptions
|
77
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.balance_inquiry(hash)}
|
78
|
+
#Test
|
79
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
78
80
|
end
|
79
81
|
end
|
80
82
|
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
|
@@ -76,9 +76,40 @@ module LitleOnline
|
|
76
76
|
'reportGroup'=>'Planets',
|
77
77
|
'amount'=>'106',
|
78
78
|
}
|
79
|
+
#Get exceptions
|
80
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture(hash)}
|
81
|
+
#Test
|
82
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_custom_billing
|
86
|
+
hash = {
|
87
|
+
'payPalNotes'=>'Notes',
|
88
|
+
'litleTxnId'=>'123456000',
|
89
|
+
'amount'=>'106',
|
90
|
+
'customBilling'=>{
|
91
|
+
'city' =>'boston',
|
92
|
+
'descriptor' => 'card was present',
|
93
|
+
}}
|
79
94
|
response= LitleOnlineRequest.new.capture(hash)
|
80
|
-
|
95
|
+
assert_equal('Valid Format', response.message)
|
81
96
|
end
|
82
|
-
|
97
|
+
|
98
|
+
|
99
|
+
def test_simple_capture_with_pin
|
100
|
+
hash = {
|
101
|
+
#'merchantId' => '101',
|
102
|
+
#'version'=>'8.8',
|
103
|
+
#'reportGroup'=>'Planets',
|
104
|
+
'payPalNotes'=>'Notes',
|
105
|
+
'litleTxnId'=>'123456000',
|
106
|
+
'amount'=>'106',
|
107
|
+
'pin'=>'1234'
|
108
|
+
}
|
109
|
+
response= LitleOnlineRequest.new.capture(hash)
|
110
|
+
assert_equal('Valid Format', response.message)
|
111
|
+
assert_equal('Approved', response.captureResponse.message)
|
112
|
+
end
|
113
|
+
|
83
114
|
end
|
84
115
|
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
|
@@ -125,7 +125,7 @@ module LitleOnline
|
|
125
125
|
'authDate'=>'2002-10-09','authCode'=>'543216',
|
126
126
|
'authAmount'=>'12345'
|
127
127
|
},
|
128
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
128
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'},
|
129
129
|
'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
130
130
|
'orderSource'=>'ecommerce',
|
131
131
|
'card'=>{
|
@@ -180,8 +180,10 @@ module LitleOnline
|
|
180
180
|
'number' =>'4100000000000001',
|
181
181
|
'expDate' =>'1210'
|
182
182
|
}}
|
183
|
-
|
184
|
-
|
183
|
+
#Get exceptions
|
184
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture_given_auth(hash)}
|
185
|
+
#Test
|
186
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
185
187
|
end
|
186
188
|
|
187
189
|
def test_simple_captureGivenAuth_with_mpos
|
@@ -231,5 +233,54 @@ module LitleOnline
|
|
231
233
|
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
232
234
|
assert_equal('Valid Format', response.message)
|
233
235
|
end
|
236
|
+
|
237
|
+
def test_simple_capture_given_auth_with_processingType
|
238
|
+
hash = {
|
239
|
+
'merchantId' => '101',
|
240
|
+
'version'=>'8.8',
|
241
|
+
'reportGroup'=>'Planets',
|
242
|
+
'orderId'=>'12344',
|
243
|
+
'amount'=>'106',
|
244
|
+
'orderSource'=>'ecommerce',
|
245
|
+
'authInformation' => {
|
246
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
247
|
+
'authAmount'=>'12345'
|
248
|
+
},
|
249
|
+
'processingType'=>'initialRecurring',
|
250
|
+
'card'=>{
|
251
|
+
'type'=>'VI',
|
252
|
+
'number' =>'4100000000000001',
|
253
|
+
'expDate' =>'1210'
|
254
|
+
}}
|
255
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
256
|
+
assert_equal('Valid Format', response.message)
|
257
|
+
#assert_equal('000', response.captureGivenAuthResponse.response)
|
258
|
+
end
|
259
|
+
|
260
|
+
def test_simple_capture_given_auth_with_originalNetworkTransactionId_originalTransactionAmount
|
261
|
+
hash = {
|
262
|
+
'merchantId' => '101',
|
263
|
+
'version'=>'8.8',
|
264
|
+
'reportGroup'=>'Planets',
|
265
|
+
'orderId'=>'12344',
|
266
|
+
'amount'=>'106',
|
267
|
+
'orderSource'=>'ecommerce',
|
268
|
+
'authInformation' => {
|
269
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
270
|
+
'authAmount'=>'12345'
|
271
|
+
},
|
272
|
+
'card'=>{
|
273
|
+
'type'=>'VI',
|
274
|
+
'number' =>'4100000000000001',
|
275
|
+
'expDate' =>'1210'
|
276
|
+
},
|
277
|
+
'originalNetworkTransactionId'=>'987654321098765432109876543210',
|
278
|
+
'originalTransactionAmount'=>'10661'
|
279
|
+
}
|
280
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
281
|
+
assert_equal('Valid Format', response.message)
|
282
|
+
#assert_equal('000', response.captureGivenAuthResponse.response)
|
283
|
+
end
|
284
|
+
|
234
285
|
end
|
235
286
|
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
|
@@ -183,5 +183,21 @@ module LitleOnline
|
|
183
183
|
response= LitleOnlineRequest.new.credit(hash)
|
184
184
|
assert_equal('Valid Format', response.message)
|
185
185
|
end
|
186
|
+
|
187
|
+
def test_simple_credit_with_pin
|
188
|
+
hash = {
|
189
|
+
'merchantId' => '101',
|
190
|
+
'version'=>'8.8',
|
191
|
+
'reportGroup'=>'Planets',
|
192
|
+
'amount'=>'106',
|
193
|
+
'secondaryAmount'=>'20',
|
194
|
+
'litleTxnId'=>'1234',
|
195
|
+
'pin'=>'3333'
|
196
|
+
}
|
197
|
+
response= LitleOnlineRequest.new.credit(hash)
|
198
|
+
assert_equal('Valid Format', response.message)
|
199
|
+
assert_equal('000', response.creditResponse.response)
|
200
|
+
end
|
201
|
+
|
186
202
|
end
|
187
203
|
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
|
@@ -73,8 +73,10 @@ def test_simple_happy
|
|
73
73
|
'amount' =>'500',
|
74
74
|
}
|
75
75
|
|
76
|
-
|
77
|
-
|
76
|
+
#Get exceptions
|
77
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate(hash)}
|
78
|
+
#Test
|
79
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
78
80
|
end
|
79
81
|
end
|
80
82
|
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
|
@@ -49,8 +49,10 @@ def test_simple
|
|
49
49
|
'reportGroup'=>'Planets',
|
50
50
|
}
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
#Get exceptions
|
53
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deactivate_reversal(hash)}
|
54
|
+
#Test
|
55
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
54
56
|
end
|
55
57
|
end
|
56
58
|
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
|
@@ -49,8 +49,10 @@ def test_simple
|
|
49
49
|
'reportGroup'=>'Planets',
|
50
50
|
}
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
#Get exceptions
|
53
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.deposit_reversal(hash)}
|
54
|
+
#Test
|
55
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
54
56
|
end
|
55
57
|
end
|
56
58
|
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
|
@@ -45,8 +45,10 @@ module LitleOnline
|
|
45
45
|
'version'=>'8.8',
|
46
46
|
'reportGroup'=>'Planets',
|
47
47
|
}
|
48
|
-
|
49
|
-
|
48
|
+
#Get exceptions
|
49
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_credit(hash)}
|
50
|
+
#Test
|
51
|
+
assert(exception.message =~ /The content of element 'echeckCredit' is not complete/)
|
50
52
|
end
|
51
53
|
|
52
54
|
def test_echeck_credit_with_echeck
|
@@ -59,7 +61,7 @@ module LitleOnline
|
|
59
61
|
'orderId'=>'12345',
|
60
62
|
'orderSource'=>'ecommerce',
|
61
63
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
62
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
64
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
63
65
|
}
|
64
66
|
response= LitleOnlineRequest.new.echeck_credit(hash)
|
65
67
|
assert_equal('Valid Format', response.message)
|
@@ -75,7 +77,7 @@ module LitleOnline
|
|
75
77
|
'orderId'=>'12345',
|
76
78
|
'orderSource'=>'ecommerce',
|
77
79
|
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
78
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
80
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
79
81
|
}
|
80
82
|
response= LitleOnlineRequest.new.echeck_credit(hash)
|
81
83
|
assert_equal('Valid Format', response.message)
|
@@ -92,7 +94,7 @@ module LitleOnline
|
|
92
94
|
'verify'=>'true',
|
93
95
|
'orderId'=>'12345',
|
94
96
|
'orderSource'=>'ecommerce',
|
95
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
97
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
96
98
|
}
|
97
99
|
response= LitleOnlineRequest.new.echeck_credit(hash)
|
98
100
|
assert_equal('Valid Format', response.message)
|
@@ -110,8 +112,10 @@ module LitleOnline
|
|
110
112
|
'orderId'=>'12345',
|
111
113
|
'orderSource'=>'ecommerce',
|
112
114
|
}
|
113
|
-
|
114
|
-
|
115
|
+
#Get exceptions
|
116
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_credit(hash)}
|
117
|
+
#Test
|
118
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
115
119
|
end
|
116
120
|
|
117
121
|
def test_echeck_credit_with_secondaryAmount
|
@@ -125,7 +129,7 @@ module LitleOnline
|
|
125
129
|
'orderId'=>'12345',
|
126
130
|
'orderSource'=>'ecommerce',
|
127
131
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
128
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
132
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
129
133
|
}
|
130
134
|
response= LitleOnlineRequest.new.echeck_credit(hash)
|
131
135
|
assert_equal('Valid Format', response.message)
|
@@ -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
|
@@ -81,8 +81,10 @@ module LitleOnline
|
|
81
81
|
'version'=>'8.8',
|
82
82
|
'reportGroup'=>'Planets',
|
83
83
|
}
|
84
|
-
|
85
|
-
|
84
|
+
#Get exceptions
|
85
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_redeposit(hash)}
|
86
|
+
#Test
|
87
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
86
88
|
end
|
87
89
|
end
|
88
90
|
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
|
@@ -27,21 +27,6 @@ require 'test/unit'
|
|
27
27
|
|
28
28
|
module LitleOnline
|
29
29
|
class Test_echeckSale < Test::Unit::TestCase
|
30
|
-
def test_echeck_sale_with_echeck
|
31
|
-
hash = {
|
32
|
-
'merchantId' => '101',
|
33
|
-
'version'=>'8.8',
|
34
|
-
'reportGroup'=>'Planets',
|
35
|
-
'amount'=>'123456',
|
36
|
-
'verify'=>'true',
|
37
|
-
'orderId'=>'12345',
|
38
|
-
'orderSource'=>'ecommerce',
|
39
|
-
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
40
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
|
41
|
-
}
|
42
|
-
response= LitleOnlineRequest.new.echeck_sale(hash)
|
43
|
-
assert_equal('Valid Format', response.message)
|
44
|
-
end
|
45
30
|
|
46
31
|
def test_no_amount
|
47
32
|
hash = {
|
@@ -49,8 +34,10 @@ module LitleOnline
|
|
49
34
|
'version'=>'8.8',
|
50
35
|
'reportGroup'=>'Planets'
|
51
36
|
}
|
52
|
-
|
53
|
-
|
37
|
+
#Get exceptions
|
38
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_sale(hash)}
|
39
|
+
#Test
|
40
|
+
assert(exception.message =~ /The content of element 'echeckSale' is not complete/)
|
54
41
|
end
|
55
42
|
|
56
43
|
def test_echeck_sale_with_echeck
|
@@ -63,7 +50,7 @@ module LitleOnline
|
|
63
50
|
'orderId'=>'12345',
|
64
51
|
'orderSource'=>'ecommerce',
|
65
52
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
66
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
53
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
67
54
|
}
|
68
55
|
response= LitleOnlineRequest.new.echeck_sale(hash)
|
69
56
|
assert_equal('Valid Format', response.message)
|
@@ -79,8 +66,8 @@ module LitleOnline
|
|
79
66
|
'orderId'=>'12345',
|
80
67
|
'orderSource'=>'ecommerce',
|
81
68
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
82
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
83
|
-
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
69
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'},
|
70
|
+
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
84
71
|
}
|
85
72
|
response= LitleOnlineRequest.new.echeck_sale(hash)
|
86
73
|
assert_equal('Valid Format', response.message)
|
@@ -97,7 +84,7 @@ module LitleOnline
|
|
97
84
|
'orderSource'=>'ecommerce',
|
98
85
|
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
99
86
|
'customBilling'=>{'phone'=>'123456789','descriptor'=>'good'},
|
100
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
87
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
101
88
|
}
|
102
89
|
response= LitleOnlineRequest.new.echeck_sale(hash)
|
103
90
|
assert_equal('Valid Format', response.message)
|
@@ -114,7 +101,7 @@ module LitleOnline
|
|
114
101
|
'verify'=>'true',
|
115
102
|
'orderId'=>'12345',
|
116
103
|
'orderSource'=>'ecommerce',
|
117
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
104
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
118
105
|
}
|
119
106
|
response= LitleOnlineRequest.new.echeck_sale(hash)
|
120
107
|
assert_equal('Valid Format', response.message)
|
@@ -132,8 +119,10 @@ module LitleOnline
|
|
132
119
|
'orderId'=>'12345',
|
133
120
|
'orderSource'=>'ecommerce',
|
134
121
|
}
|
135
|
-
|
136
|
-
|
122
|
+
#Get exceptions
|
123
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_sale(hash)}
|
124
|
+
#Test
|
125
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
137
126
|
end
|
138
127
|
|
139
128
|
def test_simple_echeck_sale
|
@@ -167,7 +156,7 @@ module LitleOnline
|
|
167
156
|
'orderId'=>'12345',
|
168
157
|
'orderSource'=>'ecommerce',
|
169
158
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
|
170
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
159
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
171
160
|
}
|
172
161
|
response= LitleOnlineRequest.new.echeck_sale(hash)
|
173
162
|
assert_equal('Valid Format', response.message)
|
@@ -184,7 +173,7 @@ module LitleOnline
|
|
184
173
|
'orderId'=>'12345',
|
185
174
|
'orderSource'=>'ecommerce',
|
186
175
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'123456789012345678901234567890123456789012345678901234567890123456789012345678901'},
|
187
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
176
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
|
188
177
|
}
|
189
178
|
assert_raises RuntimeError do
|
190
179
|
response= LitleOnlineRequest.new.echeck_sale(hash)
|
@@ -199,8 +188,10 @@ module LitleOnline
|
|
199
188
|
'amount'=>'12',
|
200
189
|
'secondaryAmount'=>'50'
|
201
190
|
}
|
202
|
-
|
203
|
-
|
191
|
+
#Get exceptions
|
192
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_sale(hash)}
|
193
|
+
#Test
|
194
|
+
assert(exception.message =~ /Error validating xml data against the schema/)
|
204
195
|
end
|
205
196
|
|
206
197
|
end
|