LitleOnline 8.25.1 → 8.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +10 -2
- data/README.md +2 -22
- data/Rakefile +2 -2
- data/accurev_plugin.log +1037 -0
- data/bin/sample_batch_driver.rb +1 -0
- data/bin/sample_driver.rb +4 -4
- data/lib/Configuration.rb +2 -2
- data/lib/EnvironmentVariables.rb +2 -1
- data/lib/LitleBatchRequest.rb +16 -3
- data/lib/LitleOnlineRequest.rb +2 -2
- data/lib/LitleRequest.rb +8 -4
- data/lib/LitleTransaction.rb +10 -6
- data/lib/XMLFields.rb +203 -159
- data/samples/Auth/LitleAuthReversalTransaction.rb +15 -0
- data/samples/Auth/LitleAuthorizationTransaction.rb +31 -0
- data/samples/Auth/LitlePaymentFullLifeCycle.rb +47 -0
- data/samples/Batch/AccountUpdate.rb +64 -0
- data/samples/Batch/SampleBatchDriver.rb +94 -0
- data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +30 -0
- data/samples/Capture/LitleCaptureTransaction.rb +14 -0
- data/samples/Capture/LitleForceCaptureTransaction.rb +26 -0
- data/samples/Capture/LitlePartialCapture.rb +16 -0
- data/samples/Credit/LitleCreditTransaction.rb +16 -0
- data/samples/Credit/LitleRefundTransaction.rb +29 -0
- data/samples/Other/LitleAvsTransaction.rb +34 -0
- data/samples/Other/LitleVoidTransaction.rb +18 -0
- data/samples/Paypage/FullPaypageLifeCycle.rb +74 -0
- data/samples/Run_all.rb +17 -0
- data/samples/Sale/LitleSaleTransaction.rb +29 -0
- data/samples/Sale/SampleSaleTransaction.rb +24 -0
- data/test/functional/test_auth.rb +54 -30
- data/test/functional/test_captureGivenAuth.rb +41 -18
- data/test/functional/test_credit.rb +17 -0
- data/test/functional/test_echeckCredit.rb +23 -6
- data/test/functional/test_echeckSale.rb +27 -10
- data/test/functional/test_forceCapture.rb +19 -0
- data/test/functional/test_sale.rb +44 -19
- data/test/functional/test_token.rb +27 -5
- data/test/unit/test_LitleOnlineRequest.rb +2 -2
- data/test/unit/test_activate.rb +1 -1
- data/test/unit/test_activateReversal.rb +1 -1
- data/test/unit/test_auth.rb +104 -41
- data/test/unit/test_balanceInquiry.rb +1 -1
- data/test/unit/test_cancelSubscription.rb +1 -1
- data/test/unit/test_captureGivenAuth.rb +31 -22
- data/test/unit/test_createPlan.rb +1 -1
- data/test/unit/test_credit.rb +61 -39
- 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 +18 -5
- data/test/unit/test_echeckRedeposit.rb +1 -1
- data/test/unit/test_echeckSale.rb +14 -1
- data/test/unit/test_echeckVerification.rb +1 -1
- data/test/unit/test_echeckVoid.rb +1 -1
- data/test/unit/test_forceCapture.rb +11 -0
- 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 +113 -55
- data/test/unit/test_token.rb +53 -7
- 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_xmlfields.rb +2 -2
- metadata +22 -4
@@ -0,0 +1,74 @@
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
2
|
+
hash = {
|
3
|
+
'orderId'=>'1234',
|
4
|
+
'amount'=>'106',
|
5
|
+
'orderSource'=>'ecommerce',
|
6
|
+
'paypage'=>{
|
7
|
+
'type'=>'VI',
|
8
|
+
'paypageRegistrationId' =>'QU1pTFZnV2NGQWZrZzRKeTNVR0lzejB1K2Q5VDdWMTVqb2J5WFJ2Snh4U0U4eTBxaFg2cEVWaDBWSlhtMVZTTw==',
|
9
|
+
'expDate' =>'1210',
|
10
|
+
'cardValidationNum' => '123'
|
11
|
+
}
|
12
|
+
}
|
13
|
+
auth_response = LitleOnline::LitleOnlineRequest.new.authorization(hash)
|
14
|
+
#display results, sample output from sandbox
|
15
|
+
puts "Response: " + auth_response.authorizationResponse.response #prints 000
|
16
|
+
puts "Message: " + auth_response.authorizationResponse.message #prints Approved
|
17
|
+
puts "Litle Transaction ID: " + auth_response.authorizationResponse.litleTxnId #prints 492578641509469583
|
18
|
+
puts "Litle Token: " + auth_response.authorizationResponse.tokenResponse.litleToken #prints 1234567890123456 - save this away so you can issue future authorizations against it
|
19
|
+
|
20
|
+
if (!auth_response.authorizationResponse.message.eql?'Approved')
|
21
|
+
raise ArgumentError, "FullPaypageLifeCycle's auth has not been Approved", caller
|
22
|
+
end
|
23
|
+
#Now, we capture the authorization
|
24
|
+
hash = {
|
25
|
+
'litleTxnId'=>auth_response.authorizationResponse.litleTxnId #Use the litleTxnId from the auth we want to capture
|
26
|
+
}
|
27
|
+
capture_response = LitleOnline::LitleOnlineRequest.new.capture(hash)
|
28
|
+
puts "Response: " + capture_response.captureResponse.response
|
29
|
+
puts "Message: " + capture_response.captureResponse.message
|
30
|
+
puts "Litle Transaction ID: " + capture_response.captureResponse.litleTxnId
|
31
|
+
|
32
|
+
if (!capture_response.captureResponse.message.eql?'Approved')
|
33
|
+
raise ArgumentError, "FullPaypageLifeCycle's capture has not been Approved", caller
|
34
|
+
end
|
35
|
+
#Now, we issue a refund against the capture
|
36
|
+
hash = {
|
37
|
+
'litleTxnId'=>capture_response.captureResponse.litleTxnId #Use the litleTxnId from the capture we want to refund against
|
38
|
+
}
|
39
|
+
credit_response = LitleOnline::LitleOnlineRequest.new.credit(hash)
|
40
|
+
puts "Response: " + credit_response.creditResponse.response
|
41
|
+
puts "Message: " + credit_response.creditResponse.message
|
42
|
+
puts "Litle Transaction ID: " + credit_response.creditResponse.litleTxnId
|
43
|
+
|
44
|
+
#Now, we issue an auth reversal against the refund
|
45
|
+
hash = {
|
46
|
+
'litleTxnId'=>credit_response.creditResponse.litleTxnId #Use the litleTxnId from the capture we want to refund against
|
47
|
+
}
|
48
|
+
reversal_response = LitleOnline::LitleOnlineRequest.new.auth_reversal(hash)
|
49
|
+
puts "Response: " + reversal_response.authReversalResponse.response
|
50
|
+
puts "Message: " + reversal_response.authReversalResponse.message
|
51
|
+
puts "Litle Transaction ID: " + reversal_response.authReversalResponse.litleTxnId
|
52
|
+
|
53
|
+
if (!reversal_response.authReversalResponse.message.eql?'Approved')
|
54
|
+
raise ArgumentError, "FullPaypageLifeCycle's reversal has not been Approved", caller
|
55
|
+
end
|
56
|
+
#Let's assume next month we want to create a sale for the same card as the original authorization. The paypageRegistrationId is expired, but we have the token and can use it
|
57
|
+
hash = {
|
58
|
+
'orderId'=>'4321',
|
59
|
+
'amount'=>'106',
|
60
|
+
'orderSource'=>'ecommerce',
|
61
|
+
'token'=>{
|
62
|
+
'type'=>'VI',
|
63
|
+
'litleToken' => auth_response.authorizationResponse.tokenResponse.litleToken,
|
64
|
+
'expDate' =>'1210'
|
65
|
+
}
|
66
|
+
}
|
67
|
+
sale_response = LitleOnline::LitleOnlineRequest.new.sale(hash)
|
68
|
+
puts "Response: " + sale_response.saleResponse.response
|
69
|
+
puts "Message: " + sale_response.saleResponse.message
|
70
|
+
puts "Litle Transaction ID: " + sale_response.saleResponse.litleTxnId
|
71
|
+
|
72
|
+
if (!sale_response.saleResponse.message.eql?'Approved')
|
73
|
+
raise ArgumentError, "FullPaypageLifeCycle's sale has not been Approved", caller
|
74
|
+
end
|
data/samples/Run_all.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
p system("rake test:all")
|
2
|
+
require File.expand_path("../../samples/Auth/LitlePaymentFullLifeCycle",__FILE__)
|
3
|
+
require File.expand_path("../../samples/Auth/LitleAuthorizationTransaction",__FILE__)
|
4
|
+
require File.expand_path("../../samples/Auth/LitleAuthReversalTransaction",__FILE__)
|
5
|
+
require File.expand_path("../../samples/Batch/AccountUpdate",__FILE__)
|
6
|
+
require File.expand_path("../../samples/Batch/SampleBatchDriver",__FILE__)
|
7
|
+
require File.expand_path("../../samples/Capture/LitleCaptureTransaction",__FILE__)
|
8
|
+
require File.expand_path("../../samples/Capture/LitlePartialCapture",__FILE__)
|
9
|
+
require File.expand_path("../../samples/Capture/LitleCaptureGivenAuthTransaction",__FILE__)
|
10
|
+
require File.expand_path("../../samples/Capture/LitleForceCaptureTransaction",__FILE__)
|
11
|
+
require File.expand_path("../../samples/Credit/LitleCreditTransaction",__FILE__)
|
12
|
+
require File.expand_path("../../samples/Credit/LitleRefundTransaction",__FILE__)
|
13
|
+
require File.expand_path("../../samples/Other/LitleAvsTransaction",__FILE__)
|
14
|
+
require File.expand_path("../../samples/Other/LitleVoidTransaction",__FILE__)
|
15
|
+
require File.expand_path("../../samples/Paypage/FullPaypageLifeCycle",__FILE__)
|
16
|
+
require File.expand_path("../../samples/Sale/LitleSaleTransaction",__FILE__)
|
17
|
+
require File.expand_path("../../samples/Sale/SampleSaleTransaction",__FILE__)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
2
|
+
#Sale
|
3
|
+
my_sale_info = {
|
4
|
+
'orderId' => '1',
|
5
|
+
'amount' => '10010',
|
6
|
+
'orderSource'=>'ecommerce',
|
7
|
+
'billToAddress'=>{
|
8
|
+
'name' => 'John Smith',
|
9
|
+
'addressLine1' => '1 Main St.',
|
10
|
+
'city' => 'Burlington',
|
11
|
+
'state' => 'MA',
|
12
|
+
'zip' => '01803-3747',
|
13
|
+
'country' => 'US'},
|
14
|
+
'card'=>{
|
15
|
+
'number' =>'4100000000000001',
|
16
|
+
'expDate' => '0112',
|
17
|
+
'cardValidationNum' => '349',
|
18
|
+
'type' => 'MC'}
|
19
|
+
}
|
20
|
+
sale_response = LitleOnline::LitleOnlineRequest.new.sale(my_sale_info)
|
21
|
+
|
22
|
+
#display results
|
23
|
+
puts "Response: " + sale_response.saleResponse.response
|
24
|
+
puts "Message: " + sale_response.saleResponse.message
|
25
|
+
puts "Litle Transaction ID: " + sale_response.saleResponse.litleTxnId
|
26
|
+
|
27
|
+
if (!sale_response.saleResponse.message.eql?'Approved')
|
28
|
+
raise ArgumentError, "LitleSaleTransaction has not been Approved", caller
|
29
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
2
|
+
# Visa $10 Sale
|
3
|
+
litleSaleTxn = {
|
4
|
+
'merchantId' => '087900',
|
5
|
+
'reportGroup'=>'rpt_grp',
|
6
|
+
'orderId'=>'1234567',
|
7
|
+
'card'=>{
|
8
|
+
'type'=>'VI',
|
9
|
+
'number' =>'4100000000000001',
|
10
|
+
'expDate' =>'1212'},
|
11
|
+
'orderSource'=>'ecommerce',
|
12
|
+
'amount'=>'1000'
|
13
|
+
}
|
14
|
+
|
15
|
+
# Peform the transaction on the Litle Platform
|
16
|
+
response = LitleOnline::LitleOnlineRequest.new.sale(litleSaleTxn)
|
17
|
+
|
18
|
+
# display results
|
19
|
+
puts "Message: "+ response.message
|
20
|
+
puts "Litle Transaction ID: "+ response.saleResponse.litleTxnId
|
21
|
+
|
22
|
+
if (!response.saleResponse.message.eql?'Approved')
|
23
|
+
raise ArgumentError, "SampleSaleTransaction has not been Approved", caller
|
24
|
+
end
|
@@ -22,13 +22,12 @@ 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 Authorization Transaction
|
29
29
|
module LitleOnline
|
30
30
|
class TestAuth < Test::Unit::TestCase
|
31
|
-
|
32
31
|
def test_simple_auth_with_card
|
33
32
|
hash = {
|
34
33
|
'merchantId' => '101',
|
@@ -45,7 +44,7 @@ module LitleOnline
|
|
45
44
|
response= LitleOnlineRequest.new.authorization(hash)
|
46
45
|
assert_equal('000', response.authorizationResponse.response)
|
47
46
|
end
|
48
|
-
|
47
|
+
|
49
48
|
def test_simple_auth_with_paypal
|
50
49
|
hash = {
|
51
50
|
'merchantId' => '101',
|
@@ -62,7 +61,32 @@ module LitleOnline
|
|
62
61
|
response= LitleOnlineRequest.new.authorization(hash)
|
63
62
|
assert_equal 'Valid Format', response.message
|
64
63
|
end
|
65
|
-
|
64
|
+
|
65
|
+
def test_simple_auth_with_applepay_and_secondaryAmount
|
66
|
+
hash = {
|
67
|
+
'merchantId' => '101',
|
68
|
+
'version'=>'8.8',
|
69
|
+
'reportGroup'=>'Planets',
|
70
|
+
'orderId'=>'12344',
|
71
|
+
'amount'=>'110',
|
72
|
+
'secondaryAmount'=>'50',
|
73
|
+
'orderSource'=>'ecommerce',
|
74
|
+
'applepay'=>{
|
75
|
+
'data'=>'1234',
|
76
|
+
'header'=>{
|
77
|
+
'applicationData'=>'454657413164',
|
78
|
+
'ephemeralPublicKey'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
|
79
|
+
'publicKeyHash'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
|
80
|
+
'transactionId'=>'1234'
|
81
|
+
},
|
82
|
+
'signature' =>'1',
|
83
|
+
'version'=>'1'
|
84
|
+
}}
|
85
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
86
|
+
assert_equal('Insufficient Funds', response.authorizationResponse.message)
|
87
|
+
assert_equal('110', response.authorizationResponse.applepayResponse.transactionAmount)
|
88
|
+
end
|
89
|
+
|
66
90
|
def test_illegal_order_source
|
67
91
|
hash = {
|
68
92
|
'merchantId' => '101',
|
@@ -79,7 +103,7 @@ module LitleOnline
|
|
79
103
|
response= LitleOnlineRequest.new.authorization(hash)
|
80
104
|
assert(response.message =~ /Error validating xml data against the schema/)
|
81
105
|
end
|
82
|
-
|
106
|
+
|
83
107
|
def test_fields_out_of_order
|
84
108
|
hash = {
|
85
109
|
'merchantId' => '101',
|
@@ -97,7 +121,7 @@ module LitleOnline
|
|
97
121
|
response= LitleOnlineRequest.new.authorization(hash)
|
98
122
|
assert_equal('000', response.authorizationResponse.response)
|
99
123
|
end
|
100
|
-
|
124
|
+
|
101
125
|
def test_invalid_field
|
102
126
|
hash = {
|
103
127
|
'merchantId' => '101',
|
@@ -115,7 +139,7 @@ module LitleOnline
|
|
115
139
|
response= LitleOnlineRequest.new.authorization(hash)
|
116
140
|
assert_equal('000', response.authorizationResponse.response)
|
117
141
|
end
|
118
|
-
|
142
|
+
|
119
143
|
def test_no_order_id
|
120
144
|
hash = {
|
121
145
|
'merchantId' => '101',
|
@@ -131,7 +155,7 @@ module LitleOnline
|
|
131
155
|
response= LitleOnlineRequest.new.authorization(hash)
|
132
156
|
assert(response.message =~ /Error validating xml data against the schema/)
|
133
157
|
end
|
134
|
-
|
158
|
+
|
135
159
|
def test_no_amount
|
136
160
|
hash = {
|
137
161
|
'merchantId' => '101',
|
@@ -147,7 +171,7 @@ module LitleOnline
|
|
147
171
|
response= LitleOnlineRequest.new.authorization(hash)
|
148
172
|
assert(response.message =~ /Error validating xml data against the schema/)
|
149
173
|
end
|
150
|
-
|
174
|
+
|
151
175
|
def test_no_order_source
|
152
176
|
hash = {
|
153
177
|
'merchantId' => '101',
|
@@ -164,23 +188,23 @@ module LitleOnline
|
|
164
188
|
response= LitleOnlineRequest.new.authorization(hash)
|
165
189
|
assert(response.message =~ /Error validating xml data against the schema/)
|
166
190
|
end
|
167
|
-
|
191
|
+
|
168
192
|
def test_authorization_missing_attributes
|
169
193
|
hash={
|
170
194
|
'reportGroup'=>'Planets',
|
171
195
|
'amount'=>'106',
|
172
|
-
|
196
|
+
|
173
197
|
'orderSource'=>'ecommerce',
|
174
198
|
'card'=>{
|
175
199
|
'type'=>'VI',
|
176
200
|
'number' =>'4100000000000001',
|
177
201
|
'expDate' =>'1210'
|
178
202
|
}}
|
179
|
-
|
203
|
+
|
180
204
|
response= LitleOnlineRequest.new.authorization(hash)
|
181
205
|
assert(response.message =~ /Error validating xml data against the schema/)
|
182
206
|
end
|
183
|
-
|
207
|
+
|
184
208
|
def test_orderId_required
|
185
209
|
start_hash = {
|
186
210
|
'merchantId'=>'101',
|
@@ -194,11 +218,11 @@ module LitleOnline
|
|
194
218
|
}
|
195
219
|
response= LitleOnlineRequest.new.authorization(start_hash)
|
196
220
|
assert(response.message =~ /Error validating xml data against the schema/)
|
197
|
-
|
221
|
+
|
198
222
|
response = LitleOnlineRequest.new.authorization(start_hash.merge({'orderId'=>'1234'}))
|
199
223
|
assert_equal('000', response.authorizationResponse.response)
|
200
224
|
end
|
201
|
-
|
225
|
+
|
202
226
|
def test_ssn_optional
|
203
227
|
start_hash = {
|
204
228
|
'orderId'=>'12344',
|
@@ -213,7 +237,7 @@ module LitleOnline
|
|
213
237
|
}
|
214
238
|
response = LitleOnlineRequest.new.authorization(start_hash)
|
215
239
|
assert_equal('000', response.authorizationResponse.response)
|
216
|
-
|
240
|
+
|
217
241
|
response = LitleOnlineRequest.new.authorization(start_hash.merge({'customerInfo'=>{'ssn'=>'000112222'} }))
|
218
242
|
assert_equal('000', response.authorizationResponse.response)
|
219
243
|
end
|
@@ -224,10 +248,10 @@ module LitleOnline
|
|
224
248
|
'amount'=>'106',
|
225
249
|
'orderSource'=>'ecommerce',
|
226
250
|
'paypage'=>{
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
251
|
+
'type'=>'VI',
|
252
|
+
'paypageRegistrationId' =>'QU1pTFZnV2NGQWZrZzRKeTNVR0lzejB1K2Q5VDdWMTVqb2J5WFJ2Snh4U0U4eTBxaFg2cEVWaDBWSlhtMVZTTw==',
|
253
|
+
'expDate' =>'1210',
|
254
|
+
'cardValidationNum' => '123'
|
231
255
|
}
|
232
256
|
}
|
233
257
|
response= LitleOnlineRequest.new.authorization(hash)
|
@@ -246,9 +270,9 @@ module LitleOnline
|
|
246
270
|
'type'=>'VI',
|
247
271
|
'number' =>'4100000000000000',
|
248
272
|
'expDate' =>'1210'
|
249
|
-
|
273
|
+
},
|
250
274
|
'advancedFraudChecks' => {'threatMetrixSessionId'=>'1234'}
|
251
|
-
|
275
|
+
}
|
252
276
|
response= LitleOnlineRequest.new.authorization(hash)
|
253
277
|
assert_equal('000', response.authorizationResponse.response)
|
254
278
|
end
|
@@ -259,16 +283,16 @@ module LitleOnline
|
|
259
283
|
'amount'=>'106',
|
260
284
|
'orderSource'=>'ecommerce',
|
261
285
|
'mpos'=>
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
286
|
+
{
|
287
|
+
'ksn'=>'ksnString',
|
288
|
+
'formatId'=>'30',
|
289
|
+
'encryptedTrack'=>'encryptedTrackString',
|
290
|
+
'track1Status'=>'0',
|
291
|
+
'track2Status'=>'0'
|
292
|
+
}
|
269
293
|
}
|
270
294
|
response= LitleOnlineRequest.new.authorization(hash)
|
271
295
|
assert_equal('000', response.authorizationResponse.response)
|
272
296
|
end
|
273
297
|
end
|
274
|
-
end
|
298
|
+
end
|
@@ -22,7 +22,7 @@ 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
|
module LitleOnline
|
@@ -47,7 +47,7 @@ module LitleOnline
|
|
47
47
|
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
48
48
|
assert_equal('Valid Format', response.message)
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
def test_simple_capture_given_auth_with_token
|
52
52
|
hash = {
|
53
53
|
'merchantId' => '101',
|
@@ -69,7 +69,7 @@ module LitleOnline
|
|
69
69
|
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
70
70
|
assert_equal('Valid Format', response.message)
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
def test_fields_out_of_order
|
74
74
|
hash = {
|
75
75
|
'merchantId' => '101',
|
@@ -91,7 +91,7 @@ module LitleOnline
|
|
91
91
|
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
92
92
|
assert_equal('Valid Format', response.message)
|
93
93
|
end
|
94
|
-
|
94
|
+
|
95
95
|
def test_invalid_field
|
96
96
|
hash = {
|
97
97
|
'merchantId' => '101',
|
@@ -113,7 +113,7 @@ module LitleOnline
|
|
113
113
|
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
114
114
|
assert_equal('Valid Format', response.message)
|
115
115
|
end
|
116
|
-
|
116
|
+
|
117
117
|
def test_complex_capture_given_auth
|
118
118
|
hash = {
|
119
119
|
'merchantId' => '101',
|
@@ -136,7 +136,7 @@ module LitleOnline
|
|
136
136
|
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
137
137
|
assert_equal('Valid Format', response.message)
|
138
138
|
end
|
139
|
-
|
139
|
+
|
140
140
|
def test_auth_info
|
141
141
|
hash = {
|
142
142
|
'merchantId' => '101',
|
@@ -149,10 +149,10 @@ module LitleOnline
|
|
149
149
|
'authAmount'=>'12345','fraudResult'=>{'avsResult'=>'12','cardValidationResult'=>'123','authenticationResult'=>'1',
|
150
150
|
'advancedAVSResult'=>'123',
|
151
151
|
'advancedFraudResults' => {'deviceReviewStatus' => 'deviceReviewStatusString',
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
152
|
+
'deviceReputationScore' => '100',
|
153
|
+
'triggeredRule' => ['rule1','rule2']
|
154
|
+
}
|
155
|
+
}
|
156
156
|
},
|
157
157
|
'orderSource'=>'ecommerce',
|
158
158
|
'card'=>{
|
@@ -163,7 +163,7 @@ module LitleOnline
|
|
163
163
|
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
164
164
|
assert_equal('Valid Format', response.message)
|
165
165
|
end
|
166
|
-
|
166
|
+
|
167
167
|
def test_no_amount
|
168
168
|
hash = {
|
169
169
|
'merchantId' => '101',
|
@@ -197,16 +197,39 @@ module LitleOnline
|
|
197
197
|
},
|
198
198
|
'orderSource'=>'ecommerce',
|
199
199
|
'mpos'=>
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
200
|
+
{
|
201
|
+
'ksn'=>'ksnString',
|
202
|
+
'formatId'=>'30',
|
203
|
+
'encryptedTrack'=>'encryptedTrackString',
|
204
|
+
'track1Status'=>'0',
|
205
|
+
'track2Status'=>'0'
|
206
|
+
}
|
207
207
|
}
|
208
208
|
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
209
209
|
assert_equal('Valid Format', response.message)
|
210
210
|
end
|
211
|
+
|
212
|
+
def test_simple_capture_given_auth_with_secondaryAmount
|
213
|
+
hash = {
|
214
|
+
'merchantId' => '101',
|
215
|
+
'version'=>'8.8',
|
216
|
+
'reportGroup'=>'Planets',
|
217
|
+
'orderId'=>'12344',
|
218
|
+
'authInformation' => {
|
219
|
+
'authDate'=>'2002-10-09','authCode'=>'543216', 'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
220
|
+
'authAmount'=>'12345'
|
221
|
+
},
|
222
|
+
'amount'=>'106',
|
223
|
+
'secondaryAmount'=>'50',
|
224
|
+
'orderSource'=>'ecommerce',
|
225
|
+
'token'=> {
|
226
|
+
'litleToken'=>'123456789101112',
|
227
|
+
'expDate'=>'1210',
|
228
|
+
'cardValidationNum'=>'555',
|
229
|
+
'type'=>'VI'
|
230
|
+
}}
|
231
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
232
|
+
assert_equal('Valid Format', response.message)
|
233
|
+
end
|
211
234
|
end
|
212
235
|
end
|