LitleOnline 8.13.1 → 8.13.2
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.
- data/CHANGELOG +5 -0
- data/README.md +2 -1
- data/Rakefile +1 -1
- data/index.html?grep= +18 -0
- data/lib/LitleOnlineRequest.rb +45 -29
- data/lib/XMLFields.rb +220 -21
- data/test/functional/test_auth.rb +0 -18
- data/test/functional/test_echeckRedeposit.rb +0 -25
- data/test/functional/test_sale.rb +0 -18
- data/test/functional/test_token.rb +0 -12
- data/test/functional/test_xmlfields.rb +0 -144
- data/test/unit/test_LitleOnlineRequest.rb +1 -1
- data/test/unit/test_auth.rb +107 -2
- data/test/unit/test_captureGivenAuth.rb +1 -1
- data/test/unit/test_credit.rb +98 -2
- data/test/unit/test_echeckRedeposit.rb +24 -0
- data/test/unit/test_forceCapture.rb +2 -2
- data/test/unit/test_sale.rb +22 -3
- data/test/unit/test_token.rb +13 -1
- data/test/unit/test_xmlfields.rb +2385 -3
- metadata +9 -8
@@ -115,24 +115,6 @@ module LitleOnline
|
|
115
115
|
assert_equal('000', response.authorizationResponse.response)
|
116
116
|
end
|
117
117
|
|
118
|
-
def test_pos_without_capability_and_entry_mode
|
119
|
-
hash = {
|
120
|
-
'merchantId' => '101',
|
121
|
-
'version'=>'8.8',
|
122
|
-
'reportGroup'=>'Planets',
|
123
|
-
'orderId'=>'12344',
|
124
|
-
'amount'=>'106',
|
125
|
-
'orderSource'=>'ecommerce',
|
126
|
-
'pos'=>{'cardholderId'=>'pin'},
|
127
|
-
'card'=>{
|
128
|
-
'type'=>'VI',
|
129
|
-
'number' =>'4100000000000001',
|
130
|
-
'expDate' =>'1210'
|
131
|
-
}}
|
132
|
-
response= LitleOnlineRequest.new.authorization(hash)
|
133
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
134
|
-
end
|
135
|
-
|
136
118
|
def test_no_order_id
|
137
119
|
hash = {
|
138
120
|
'merchantId' => '101',
|
@@ -84,30 +84,5 @@ module LitleOnline
|
|
84
84
|
response= LitleOnlineRequest.new.echeck_redeposit(hash)
|
85
85
|
assert(response.message =~ /Error validating xml data against the schema/)
|
86
86
|
end
|
87
|
-
|
88
|
-
def test_echeck_redeposit_withecheckmissingfield
|
89
|
-
hash = {
|
90
|
-
'merchantId' => '101',
|
91
|
-
'version'=>'8.8',
|
92
|
-
'reportGroup'=>'Planets',
|
93
|
-
'litleTxnId'=>'123456',
|
94
|
-
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','checkNum'=>'123455'}
|
95
|
-
}
|
96
|
-
response= LitleOnlineRequest.new.echeck_redeposit(hash)
|
97
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_echeck_redeposit_with_echeck_token_missing_field
|
101
|
-
hash = {
|
102
|
-
'merchantId' => '101',
|
103
|
-
'version'=>'8.8',
|
104
|
-
'reportGroup'=>'Planets',
|
105
|
-
'litleTxnId'=>'123456',
|
106
|
-
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','checkNum'=>'123455'}
|
107
|
-
}
|
108
|
-
response= LitleOnlineRequest.new.echeck_redeposit(hash)
|
109
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
110
|
-
end
|
111
|
-
|
112
87
|
end
|
113
88
|
end
|
@@ -81,24 +81,6 @@ module LitleOnline
|
|
81
81
|
assert(response.message =~ /Error validating xml data against the schema/)
|
82
82
|
end
|
83
83
|
|
84
|
-
def test_illegal_card_type
|
85
|
-
hash = {
|
86
|
-
'merchantId' => '101',
|
87
|
-
'version'=>'8.8',
|
88
|
-
'reportGroup'=>'Planets',
|
89
|
-
'litleTxnId'=>'123456',
|
90
|
-
'orderId'=>'12344',
|
91
|
-
'amount'=>'106',
|
92
|
-
'orderSource'=>'ecommerce',
|
93
|
-
'card'=>{
|
94
|
-
'type'=>'NO',
|
95
|
-
'number' =>'4100000000000002',
|
96
|
-
'expDate' =>'1210'
|
97
|
-
}}
|
98
|
-
response= LitleOnlineRequest.new.sale(hash)
|
99
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
100
|
-
end
|
101
|
-
|
102
84
|
def test_no_report_group
|
103
85
|
hash = {
|
104
86
|
'merchantId' => '101',
|
@@ -63,18 +63,6 @@ module LitleOnline
|
|
63
63
|
assert_equal('Valid Format', response.message)
|
64
64
|
end
|
65
65
|
|
66
|
-
def test_token_echeck_missing_required
|
67
|
-
hash = {
|
68
|
-
'merchantId' => '101',
|
69
|
-
'version'=>'8.8',
|
70
|
-
'reportGroup'=>'Planets',
|
71
|
-
'orderId'=>'12344',
|
72
|
-
'echeckForToken'=>{'routingNum'=>'132344565'}
|
73
|
-
}
|
74
|
-
response= LitleOnlineRequest.new.register_token_request(hash)
|
75
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
76
|
-
end
|
77
|
-
|
78
66
|
def test_fields_out_of_order
|
79
67
|
hash = {
|
80
68
|
'merchantId' => '101',
|
@@ -157,24 +157,6 @@ module LitleOnline
|
|
157
157
|
assert_equal('Valid Format', response.message)
|
158
158
|
end
|
159
159
|
|
160
|
-
def test_pos_with_invalid_entry_mode
|
161
|
-
hash = {
|
162
|
-
'merchantId' => '101',
|
163
|
-
'version'=>'8.8',
|
164
|
-
'reportGroup'=>'Planets',
|
165
|
-
'orderId'=>'12344',
|
166
|
-
'amount'=>'106',
|
167
|
-
'orderSource'=>'ecommerce',
|
168
|
-
'pos'=>{'entryMode'=>'none','cardholderId'=>'pin','capability'=>'notused'},
|
169
|
-
'card'=>{
|
170
|
-
'type'=>'VI',
|
171
|
-
'number' =>'4100000000000001',
|
172
|
-
'expDate' =>'1210'
|
173
|
-
}}
|
174
|
-
response= LitleOnlineRequest.new.credit(hash)
|
175
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
176
|
-
end
|
177
|
-
|
178
160
|
def test_amex_data
|
179
161
|
hash = {
|
180
162
|
'merchantId' => '101',
|
@@ -235,30 +217,6 @@ module LitleOnline
|
|
235
217
|
assert_equal('Valid Format', response.message)
|
236
218
|
end
|
237
219
|
|
238
|
-
def test_simple_enhanced_data_incorrect_enum_for_country_code
|
239
|
-
hash = {
|
240
|
-
'merchantId' => '101',
|
241
|
-
'version'=>'8.8',
|
242
|
-
'reportGroup'=>'Planets',
|
243
|
-
'orderId'=>'12344',
|
244
|
-
'amount'=>'106',
|
245
|
-
'card'=>{
|
246
|
-
'type'=>'VI',
|
247
|
-
'number' =>'4100000000000001',
|
248
|
-
'expDate' =>'1210'},
|
249
|
-
'orderSource'=>'ecommerce',
|
250
|
-
'enhancedData'=>{
|
251
|
-
'destinationCountryCode'=>'001',
|
252
|
-
'customerReference'=>'Litle',
|
253
|
-
'salesTax'=>'50',
|
254
|
-
'deliveryType'=>'TBD',
|
255
|
-
'shipFromPostalCode'=>'01741',
|
256
|
-
'destinationPostalCode'=>'01742'}
|
257
|
-
}
|
258
|
-
response= LitleOnlineRequest.new.credit(hash)
|
259
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
260
|
-
end
|
261
|
-
|
262
220
|
def test_enhanced_data_with_detail_tax
|
263
221
|
hash = {
|
264
222
|
'merchantId' => '101',
|
@@ -333,24 +291,6 @@ module LitleOnline
|
|
333
291
|
assert_equal('Valid Format', response.message)
|
334
292
|
end
|
335
293
|
|
336
|
-
def test_token_with_incorrect_token_Length
|
337
|
-
hash = {
|
338
|
-
'merchantId' => '101',
|
339
|
-
'version'=>'8.8',
|
340
|
-
'reportGroup'=>'Planets',
|
341
|
-
'orderId'=>'12344',
|
342
|
-
'amount'=>'106',
|
343
|
-
'orderSource'=>'ecommerce',
|
344
|
-
'token'=> {
|
345
|
-
'litleToken'=>'123456',
|
346
|
-
'expDate'=>'1210',
|
347
|
-
'cardValidationNum'=>'555',
|
348
|
-
'type'=>'VI'
|
349
|
-
}}
|
350
|
-
response= LitleOnlineRequest.new.credit(hash)
|
351
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
352
|
-
end
|
353
|
-
|
354
294
|
def test_token_missing_exp_dat_and_valid_num
|
355
295
|
hash = {
|
356
296
|
'merchantId' => '101',
|
@@ -420,90 +360,6 @@ module LitleOnline
|
|
420
360
|
assert(response.message =~ /Error validating xml data against the schema/)
|
421
361
|
end
|
422
362
|
|
423
|
-
def test_paypal_missing_payer_id
|
424
|
-
hash = {
|
425
|
-
'merchantId' => '101',
|
426
|
-
'version'=>'8.8',
|
427
|
-
'reportGroup'=>'Planets',
|
428
|
-
'orderId'=>'12344',
|
429
|
-
'amount'=>'106',
|
430
|
-
'orderSource'=>'ecommerce',
|
431
|
-
'paypal'=>{
|
432
|
-
'token'=>'1234',
|
433
|
-
'transactionId'=>'123456'
|
434
|
-
}}
|
435
|
-
response= LitleOnlineRequest.new.authorization(hash)
|
436
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
437
|
-
end
|
438
|
-
|
439
|
-
def test_paypal_missing_transaction_id
|
440
|
-
hash = {
|
441
|
-
'merchantId' => '101',
|
442
|
-
'version'=>'8.8',
|
443
|
-
'reportGroup'=>'Planets',
|
444
|
-
'orderId'=>'12344',
|
445
|
-
'amount'=>'106',
|
446
|
-
'orderSource'=>'ecommerce',
|
447
|
-
'paypal'=>{
|
448
|
-
'token'=>'1234',
|
449
|
-
'payerId'=>'123456'
|
450
|
-
}}
|
451
|
-
response= LitleOnlineRequest.new.authorization(hash)
|
452
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
453
|
-
end
|
454
|
-
|
455
|
-
def test_pos_without_capability
|
456
|
-
hash = {
|
457
|
-
'merchantId' => '101',
|
458
|
-
'version'=>'8.8',
|
459
|
-
'reportGroup'=>'Planets',
|
460
|
-
'orderId'=>'12344',
|
461
|
-
'amount'=>'106',
|
462
|
-
'orderSource'=>'ecommerce',
|
463
|
-
'pos'=>{'entryMode'=>'track1','cardholderId'=>'pin'},
|
464
|
-
'card'=>{
|
465
|
-
'type'=>'VI',
|
466
|
-
'number' =>'4100000000000001',
|
467
|
-
'expDate' =>'1210'
|
468
|
-
}}
|
469
|
-
response= LitleOnlineRequest.new.authorization(hash)
|
470
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
471
|
-
end
|
472
|
-
|
473
|
-
def test_token_missing_token
|
474
|
-
hash = {
|
475
|
-
'merchantId' => '101',
|
476
|
-
'version'=>'8.8',
|
477
|
-
'reportGroup'=>'Planets',
|
478
|
-
'orderId'=>'12344',
|
479
|
-
'amount'=>'106',
|
480
|
-
'orderSource'=>'ecommerce',
|
481
|
-
'token'=> {
|
482
|
-
'expDate'=>'1210',
|
483
|
-
'cardValidationNum'=>'555',
|
484
|
-
'type'=>'VI'
|
485
|
-
}}
|
486
|
-
response= LitleOnlineRequest.new.credit(hash)
|
487
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
488
|
-
end
|
489
|
-
|
490
|
-
def test_paypage_missing_id
|
491
|
-
hash = {
|
492
|
-
'merchantId' => '101',
|
493
|
-
'version'=>'8.8',
|
494
|
-
'reportGroup'=>'Planets',
|
495
|
-
'orderId'=>'12344',
|
496
|
-
'amount'=>'106',
|
497
|
-
'orderSource'=>'ecommerce',
|
498
|
-
'paypage'=> {
|
499
|
-
'expDate'=>'1210',
|
500
|
-
'cardValidationNum'=>'555',
|
501
|
-
'type'=>'VI'
|
502
|
-
}}
|
503
|
-
response= LitleOnlineRequest.new.credit(hash)
|
504
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
505
|
-
end
|
506
|
-
|
507
363
|
def test_line_item_data
|
508
364
|
hash = {
|
509
365
|
'merchantId' => '101',
|
@@ -244,7 +244,7 @@ module LitleOnline
|
|
244
244
|
#Explicit - used for integrations
|
245
245
|
assert_equal 'ActiveMerchant;3.2', litle.send(:get_merchant_sdk, {'merchantSdk'=>'ActiveMerchant;3.2'})
|
246
246
|
#Implicit - used raw when nothing is specified
|
247
|
-
assert_equal 'Ruby;8.13.
|
247
|
+
assert_equal 'Ruby;8.13.2', litle.send(:get_merchant_sdk, {'NotMerchantSdk'=>'ActiveMerchant;3.2'})
|
248
248
|
end
|
249
249
|
|
250
250
|
|
data/test/unit/test_auth.rb
CHANGED
@@ -119,7 +119,7 @@ module LitleOnline
|
|
119
119
|
'token'=>'1234',
|
120
120
|
'transactionId'=>'123456'},
|
121
121
|
'token'=> {
|
122
|
-
'litleToken'=>'
|
122
|
+
'litleToken'=>'1234567890123',
|
123
123
|
'expDate'=>'1210',
|
124
124
|
'cardValidationNum'=>'555',
|
125
125
|
'type'=>'VI'
|
@@ -161,7 +161,112 @@ module LitleOnline
|
|
161
161
|
XMLObject.expects(:new)
|
162
162
|
Communications.expects(:http_post).with(regexp_matches(/.*<authorization.*?<fraudFilterOverride>true<\/fraudFilterOverride>.*?<\/authorization>.*/m),kind_of(Hash))
|
163
163
|
LitleOnlineRequest.new.authorization(hash)
|
164
|
-
end
|
164
|
+
end
|
165
|
+
|
166
|
+
def test_pos_without_capability
|
167
|
+
hash = {
|
168
|
+
'merchantId' => '101',
|
169
|
+
'version'=>'8.8',
|
170
|
+
'reportGroup'=>'Planets',
|
171
|
+
'orderId'=>'12344',
|
172
|
+
'amount'=>'106',
|
173
|
+
'orderSource'=>'ecommerce',
|
174
|
+
'pos'=>{'entryMode'=>'track1','cardholderId'=>'pin'},
|
175
|
+
'card'=>{
|
176
|
+
'type'=>'VI',
|
177
|
+
'number' =>'4100000000000001',
|
178
|
+
'expDate' =>'1210'
|
179
|
+
}}
|
180
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
181
|
+
assert_match /If pos is specified, it must have a capability/, exception.message
|
182
|
+
end
|
183
|
+
|
184
|
+
def test_paypal_missing_payer_id
|
185
|
+
hash = {
|
186
|
+
'merchantId' => '101',
|
187
|
+
'version'=>'8.8',
|
188
|
+
'reportGroup'=>'Planets',
|
189
|
+
'orderId'=>'12344',
|
190
|
+
'amount'=>'106',
|
191
|
+
'orderSource'=>'ecommerce',
|
192
|
+
'paypal'=>{
|
193
|
+
'token'=>'1234',
|
194
|
+
'transactionId'=>'123456'
|
195
|
+
}}
|
196
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
197
|
+
assert_match /If paypal is specified, it must have a payerId/, exception.message
|
198
|
+
end
|
199
|
+
|
200
|
+
def test_paypal_missing_transaction_id
|
201
|
+
hash = {
|
202
|
+
'merchantId' => '101',
|
203
|
+
'version'=>'8.8',
|
204
|
+
'reportGroup'=>'Planets',
|
205
|
+
'orderId'=>'12344',
|
206
|
+
'amount'=>'106',
|
207
|
+
'orderSource'=>'ecommerce',
|
208
|
+
'paypal'=>{
|
209
|
+
'token'=>'1234',
|
210
|
+
'payerId'=>'123456'
|
211
|
+
}}
|
212
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
213
|
+
assert_match /If paypal is specified, it must have a transactionId/, exception.message
|
214
|
+
end
|
215
|
+
|
216
|
+
def test_pos_without_capability_and_entry_mode
|
217
|
+
hash = {
|
218
|
+
'merchantId' => '101',
|
219
|
+
'version'=>'8.8',
|
220
|
+
'reportGroup'=>'Planets',
|
221
|
+
'orderId'=>'12344',
|
222
|
+
'amount'=>'106',
|
223
|
+
'orderSource'=>'ecommerce',
|
224
|
+
'pos'=>{'cardholderId'=>'pin','capability'=>'notused'},
|
225
|
+
'card'=>{
|
226
|
+
'type'=>'VI',
|
227
|
+
'number' =>'4100000000000001',
|
228
|
+
'expDate' =>'1210'
|
229
|
+
}}
|
230
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
231
|
+
assert_match /If pos is specified, it must have a entryMode/, exception.message
|
232
|
+
end
|
233
|
+
|
234
|
+
def test_auth_override_username
|
235
|
+
hash = {
|
236
|
+
'merchantId' => '101',
|
237
|
+
'user' => 'UNIT',
|
238
|
+
'password' => 'TEST',
|
239
|
+
'version'=>'8.12',
|
240
|
+
'orderId'=>'1',
|
241
|
+
'amount'=>'0',
|
242
|
+
'orderSource'=>'ecommerce',
|
243
|
+
'reportGroup'=>'Planets',
|
244
|
+
'fraudFilterOverride'=> 'true'
|
245
|
+
}
|
246
|
+
|
247
|
+
XMLObject.expects(:new)
|
248
|
+
Communications.expects(:http_post).with(regexp_matches(/.*<authentication.*?<user>UNIT<\/user>.*?<\/authentication>.*/m),kind_of(Hash))
|
249
|
+
LitleOnlineRequest.new.authorization(hash)
|
250
|
+
end
|
251
|
+
|
252
|
+
def test_auth_override_password
|
253
|
+
hash = {
|
254
|
+
'merchantId' => '101',
|
255
|
+
'user' => 'UNIT',
|
256
|
+
'password' => 'TEST',
|
257
|
+
'version'=>'8.12',
|
258
|
+
'orderId'=>'1',
|
259
|
+
'amount'=>'0',
|
260
|
+
'orderSource'=>'ecommerce',
|
261
|
+
'reportGroup'=>'Planets',
|
262
|
+
'fraudFilterOverride'=> 'true'
|
263
|
+
}
|
264
|
+
|
265
|
+
XMLObject.expects(:new)
|
266
|
+
Communications.expects(:http_post).with(regexp_matches(/.*<authentication.*?<password>TEST<\/password>.*?<\/authentication>.*/m),kind_of(Hash))
|
267
|
+
LitleOnlineRequest.new.authorization(hash)
|
268
|
+
end
|
269
|
+
|
165
270
|
end
|
166
271
|
|
167
272
|
end
|
data/test/unit/test_credit.rb
CHANGED
@@ -43,6 +43,7 @@ module LitleOnline
|
|
43
43
|
'expDate' =>'1210'
|
44
44
|
},
|
45
45
|
'paypal'=>{
|
46
|
+
'payerEmail'=>'a@b.com',
|
46
47
|
'payerId'=>'1234',
|
47
48
|
'token'=>'1234',
|
48
49
|
'transactionId'=>'123456'
|
@@ -71,6 +72,7 @@ module LitleOnline
|
|
71
72
|
'cardValidationNum'=>'555',
|
72
73
|
'type'=>'VI'},
|
73
74
|
'paypal'=>{
|
75
|
+
'payerEmail'=>'a@b.com',
|
74
76
|
'payerId'=>'1234',
|
75
77
|
'token'=>'1234',
|
76
78
|
'transactionId'=>'123456'
|
@@ -102,10 +104,11 @@ module LitleOnline
|
|
102
104
|
'type'=>'VI'},
|
103
105
|
'paypal'=>{
|
104
106
|
'payerId'=>'1234',
|
107
|
+
'payerEmail'=>'a@b.com',
|
105
108
|
'token'=>'1234',
|
106
109
|
'transactionId'=>'123456'},
|
107
110
|
'token'=> {
|
108
|
-
'litleToken'=>'
|
111
|
+
'litleToken'=>'1234567890123',
|
109
112
|
'expDate'=>'1210',
|
110
113
|
'cardValidationNum'=>'555',
|
111
114
|
'type'=>'VI'
|
@@ -129,6 +132,99 @@ module LitleOnline
|
|
129
132
|
Communications.expects(:http_post).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m),kind_of(Hash))
|
130
133
|
LitleOnlineRequest.new.credit(hash)
|
131
134
|
end
|
132
|
-
|
135
|
+
|
136
|
+
def test_simple_enhanced_data_incorrect_enum_for_country_code
|
137
|
+
hash = {
|
138
|
+
'merchantId' => '101',
|
139
|
+
'version'=>'8.8',
|
140
|
+
'reportGroup'=>'Planets',
|
141
|
+
'orderId'=>'12344',
|
142
|
+
'amount'=>'106',
|
143
|
+
'card'=>{
|
144
|
+
'type'=>'VI',
|
145
|
+
'number' =>'4100000000000001',
|
146
|
+
'expDate' =>'1210'},
|
147
|
+
'orderSource'=>'ecommerce',
|
148
|
+
'enhancedData'=>{
|
149
|
+
'destinationCountryCode'=>'001',
|
150
|
+
'customerReference'=>'Litle',
|
151
|
+
'salesTax'=>'50',
|
152
|
+
'deliveryType'=>'TBD',
|
153
|
+
'shipFromPostalCode'=>'01741',
|
154
|
+
'destinationPostalCode'=>'01742'}
|
155
|
+
}
|
156
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
157
|
+
assert_match /If enhancedData destinationCountryCode is specified, it must be/, exception.message
|
158
|
+
end
|
159
|
+
|
160
|
+
def test_token_with_incorrect_token_Length
|
161
|
+
hash = {
|
162
|
+
'merchantId' => '101',
|
163
|
+
'version'=>'8.8',
|
164
|
+
'reportGroup'=>'Planets',
|
165
|
+
'orderId'=>'12344',
|
166
|
+
'amount'=>'106',
|
167
|
+
'orderSource'=>'ecommerce',
|
168
|
+
'token'=> {
|
169
|
+
'litleToken'=>'123456789012',
|
170
|
+
'expDate'=>'1210',
|
171
|
+
'cardValidationNum'=>'555',
|
172
|
+
'type'=>'VI'
|
173
|
+
}}
|
174
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
175
|
+
assert_match /If token litleToken is specified, it must be between/, exception.message
|
176
|
+
end
|
177
|
+
|
178
|
+
def test_token_missing_token
|
179
|
+
hash = {
|
180
|
+
'merchantId' => '101',
|
181
|
+
'version'=>'8.8',
|
182
|
+
'reportGroup'=>'Planets',
|
183
|
+
'orderId'=>'12344',
|
184
|
+
'amount'=>'106',
|
185
|
+
'orderSource'=>'ecommerce',
|
186
|
+
'token'=> {
|
187
|
+
'expDate'=>'1210',
|
188
|
+
'cardValidationNum'=>'555',
|
189
|
+
'type'=>'VI'
|
190
|
+
}}
|
191
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
192
|
+
assert_match /If token is specified, it must have a litleToken/, exception.message
|
193
|
+
end
|
194
|
+
|
195
|
+
def test_pos_with_invalid_entry_mode
|
196
|
+
hash = {
|
197
|
+
'merchantId' => '101',
|
198
|
+
'version'=>'8.8',
|
199
|
+
'reportGroup'=>'Planets',
|
200
|
+
'orderId'=>'12344',
|
201
|
+
'amount'=>'106',
|
202
|
+
'orderSource'=>'ecommerce',
|
203
|
+
'pos'=>{'entryMode'=>'none','cardholderId'=>'pin','capability'=>'notused'},
|
204
|
+
'card'=>{
|
205
|
+
'type'=>'VI',
|
206
|
+
'number' =>'4100000000000001',
|
207
|
+
'expDate' =>'1210'
|
208
|
+
}}
|
209
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
210
|
+
assert_match /If pos entryMode is specified, it must be in/, exception.message
|
211
|
+
end
|
212
|
+
|
213
|
+
def test_paypage_missing_id
|
214
|
+
hash = {
|
215
|
+
'merchantId' => '101',
|
216
|
+
'version'=>'8.8',
|
217
|
+
'reportGroup'=>'Planets',
|
218
|
+
'orderId'=>'12344',
|
219
|
+
'amount'=>'106',
|
220
|
+
'orderSource'=>'ecommerce',
|
221
|
+
'paypage'=> {
|
222
|
+
'expDate'=>'1210',
|
223
|
+
'cardValidationNum'=>'555',
|
224
|
+
'type'=>'VI'
|
225
|
+
}}
|
226
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
227
|
+
assert_match /If paypage is specified, it must have a paypageRegistrationId/, exception.message
|
228
|
+
end
|
133
229
|
end
|
134
230
|
end
|