LitleOnline 8.12.3 → 8.12.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Rakefile +1 -1
- data/lib/Communications.rb +34 -32
- data/lib/Configuration.rb +13 -11
- data/lib/LitleOnline.rb +0 -1
- data/lib/LitleOnlineRequest.rb +546 -543
- data/lib/LitleXmlMapper.rb +17 -15
- data/lib/XMLFields.rb +903 -901
- data/test/certification/certTest1_base.rb +935 -933
- data/test/certification/certTest2_authenhanced.rb +548 -546
- data/test/certification/certTest3_authreversal.rb +179 -177
- data/test/certification/certTest4_echeck.rb +245 -243
- data/test/certification/certTest5_token.rb +198 -196
- data/test/functional/test_auth.rb +205 -204
- data/test/functional/test_authReversal.rb +41 -39
- data/test/functional/test_capture.rb +54 -52
- data/test/functional/test_captureGivenAuth.rb +153 -152
- data/test/functional/test_credit.rb +126 -126
- data/test/functional/test_echeckCredit.rb +88 -87
- data/test/functional/test_echeckRedeposit.rb +85 -84
- data/test/functional/test_echeckSale.rb +132 -131
- data/test/functional/test_echeckVerification.rb +97 -95
- data/test/functional/test_forceCapture.rb +113 -111
- data/test/functional/test_sale.rb +200 -198
- data/test/functional/test_token.rb +75 -73
- data/test/functional/test_xmlfields.rb +558 -558
- data/test/unit/test_LitleOnlineRequest.rb +210 -207
- data/test/unit/test_auth.rb +119 -116
- data/test/unit/test_authReversal.rb +16 -16
- data/test/unit/test_capture.rb +10 -8
- data/test/unit/test_captureGivenAuth.rb +62 -59
- data/test/unit/test_credit.rb +103 -100
- data/test/unit/test_echeckCredit.rb +15 -14
- data/test/unit/test_echeckRedeposit.rb +14 -13
- data/test/unit/test_echeckSale.rb +16 -15
- data/test/unit/test_echeckVerification.rb +14 -13
- data/test/unit/test_forceCapture.rb +61 -58
- data/test/unit/test_sale.rb +206 -205
- data/test/unit/test_token.rb +43 -41
- data/test/unit/test_xmlfields.rb +101 -99
- metadata +58 -77
- data/lib/Obj2xml.rb +0 -37
@@ -25,78 +25,80 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
28
|
+
module LitleOnline
|
29
|
+
class TestToken < Test::Unit::TestCase
|
30
|
+
def test_simple_token
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'orderId'=>'12344',
|
36
|
+
'accountNumber'=>'1233456789103801'
|
37
|
+
}
|
38
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
39
|
+
assert_equal('Valid Format', response.message)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_simple_token_with_paypage
|
43
|
+
hash = {
|
44
|
+
'merchantId' => '101',
|
45
|
+
'version'=>'8.8',
|
46
|
+
'reportGroup'=>'Planets',
|
47
|
+
'orderId'=>'12344',
|
48
|
+
'paypageRegistrationId'=>'1233456789101112'
|
49
|
+
}
|
50
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
51
|
+
assert_equal('Valid Format', response.message)
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_simple_token_echeck
|
55
|
+
hash = {
|
56
|
+
'reportGroup'=>'Planets',
|
57
|
+
'merchantId' => '101',
|
58
|
+
'version'=>'8.8',
|
59
|
+
'orderId'=>'12344',
|
60
|
+
'echeckForToken'=>{'accNum'=>'12344565','routingNum'=>'123476545'}
|
61
|
+
}
|
62
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
63
|
+
assert_equal('Valid Format', response.message)
|
64
|
+
end
|
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
|
+
def test_fields_out_of_order
|
79
|
+
hash = {
|
80
|
+
'merchantId' => '101',
|
81
|
+
'version'=>'8.8',
|
82
|
+
'orderId'=>'12344',
|
83
|
+
'accountNumber'=>'1233456789103801',
|
84
|
+
'reportGroup'=>'Planets',
|
85
|
+
}
|
86
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
87
|
+
assert_equal('Valid Format', response.message)
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_invalid_field
|
91
|
+
hash = {
|
92
|
+
'merchantId' => '101',
|
93
|
+
'version'=>'8.8',
|
94
|
+
'NOSUCHFIELD'=>'none',
|
95
|
+
'orderId'=>'12344',
|
96
|
+
'accountNumber'=>'1233456789103801',
|
97
|
+
'reportGroup'=>'Planets',
|
98
|
+
}
|
99
|
+
response= LitleOnlineRequest.new.register_token_request(hash)
|
100
|
+
assert_equal('Valid Format', response.message)
|
101
|
+
end
|
39
102
|
end
|
40
103
|
|
41
|
-
|
42
|
-
hash = {
|
43
|
-
'merchantId' => '101',
|
44
|
-
'version'=>'8.8',
|
45
|
-
'reportGroup'=>'Planets',
|
46
|
-
'orderId'=>'12344',
|
47
|
-
'paypageRegistrationId'=>'1233456789101112'
|
48
|
-
}
|
49
|
-
response= LitleOnlineRequest.new.register_token_request(hash)
|
50
|
-
assert_equal('Valid Format', response.message)
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_simple_token_echeck
|
54
|
-
hash = {
|
55
|
-
'reportGroup'=>'Planets',
|
56
|
-
'merchantId' => '101',
|
57
|
-
'version'=>'8.8',
|
58
|
-
'orderId'=>'12344',
|
59
|
-
'echeckForToken'=>{'accNum'=>'12344565','routingNum'=>'123476545'}
|
60
|
-
}
|
61
|
-
response= LitleOnlineRequest.new.register_token_request(hash)
|
62
|
-
assert_equal('Valid Format', response.message)
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_token_echeck_missing_required
|
66
|
-
hash = {
|
67
|
-
'merchantId' => '101',
|
68
|
-
'version'=>'8.8',
|
69
|
-
'reportGroup'=>'Planets',
|
70
|
-
'orderId'=>'12344',
|
71
|
-
'echeckForToken'=>{'routingNum'=>'132344565'}
|
72
|
-
}
|
73
|
-
response= LitleOnlineRequest.new.register_token_request(hash)
|
74
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
75
|
-
end
|
76
|
-
|
77
|
-
def test_fields_out_of_order
|
78
|
-
hash = {
|
79
|
-
'merchantId' => '101',
|
80
|
-
'version'=>'8.8',
|
81
|
-
'orderId'=>'12344',
|
82
|
-
'accountNumber'=>'1233456789103801',
|
83
|
-
'reportGroup'=>'Planets',
|
84
|
-
}
|
85
|
-
response= LitleOnlineRequest.new.register_token_request(hash)
|
86
|
-
assert_equal('Valid Format', response.message)
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_invalid_field
|
90
|
-
hash = {
|
91
|
-
'merchantId' => '101',
|
92
|
-
'version'=>'8.8',
|
93
|
-
'NOSUCHFIELD'=>'none',
|
94
|
-
'orderId'=>'12344',
|
95
|
-
'accountNumber'=>'1233456789103801',
|
96
|
-
'reportGroup'=>'Planets',
|
97
|
-
}
|
98
|
-
response= LitleOnlineRequest.new.register_token_request(hash)
|
99
|
-
assert_equal('Valid Format', response.message)
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
104
|
+
end
|
@@ -25,566 +25,566 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
def test_simple_custom_billing
|
48
|
-
hash = {
|
49
|
-
'merchantId' => '101',
|
50
|
-
'version'=>'8.8',
|
51
|
-
'reportGroup'=>'Planets',
|
52
|
-
'litleTxnId'=>'123456',
|
53
|
-
'orderId'=>'12344',
|
54
|
-
'amount'=>'106',
|
55
|
-
'orderSource'=>'ecommerce',
|
56
|
-
'customBilling'=>{'phone'=>'123456789','descriptor'=>'good'},
|
57
|
-
'card'=>{
|
58
|
-
'type'=>'VI',
|
59
|
-
'number' =>'4100000000000000',
|
60
|
-
'expDate' =>'1210'
|
61
|
-
}}
|
62
|
-
response= LitleOnlineRequest.new.sale(hash)
|
63
|
-
assert_equal('Valid Format', response.message)
|
64
|
-
end
|
65
|
-
|
66
|
-
def test_bill_me_later
|
67
|
-
hash = {
|
68
|
-
'merchantId' => '101',
|
69
|
-
'version'=>'8.8',
|
70
|
-
'reportGroup'=>'Planets',
|
71
|
-
'litleTxnId'=>'123456',
|
72
|
-
'orderId'=>'12344',
|
73
|
-
'amount'=>'106',
|
74
|
-
'orderSource'=>'ecommerce',
|
75
|
-
'billMeLaterRequest'=>{'bmlMerchantId'=>'12345','preapprovalNumber'=>'12345678909023',
|
76
|
-
'customerPhoneChnaged'=>'False','itemCategoryCode'=>'2'},
|
77
|
-
'card'=>{
|
78
|
-
'type'=>'VI',
|
79
|
-
'number' =>'4100000000000000',
|
80
|
-
'expDate' =>'1210'
|
81
|
-
}}
|
82
|
-
response= LitleOnlineRequest.new.sale(hash)
|
83
|
-
assert_equal('000', response.saleResponse.response)
|
84
|
-
end
|
85
|
-
|
86
|
-
def test__customer_info
|
87
|
-
hash = {
|
88
|
-
'merchantId' => '101',
|
89
|
-
'version'=>'8.8',
|
90
|
-
'reportGroup'=>'Planets',
|
91
|
-
'litleTxnId'=>'123456',
|
92
|
-
'orderId'=>'12344',
|
93
|
-
'amount'=>'106',
|
94
|
-
'orderSource'=>'ecommerce',
|
95
|
-
'CustomerInfo'=>{'ssn'=>'12345','incomeAmount'=>'12345','incomeCurrency'=>'dollar','yearsAtResidence'=>'2'},
|
96
|
-
'card'=>{
|
97
|
-
'type'=>'VI',
|
98
|
-
'number' =>'4100000000000000',
|
99
|
-
'expDate' =>'1210'
|
100
|
-
}}
|
101
|
-
response= LitleOnlineRequest.new.sale(hash)
|
102
|
-
assert_equal('Valid Format', response.message)
|
103
|
-
end
|
104
|
-
|
105
|
-
def test_simple_bill_to_address
|
106
|
-
hash = {
|
107
|
-
'merchantId' => '101',
|
108
|
-
'version'=>'8.8',
|
109
|
-
'reportGroup'=>'Planets',
|
110
|
-
'orderId'=>'12344',
|
111
|
-
'amount'=>'106',
|
112
|
-
'orderSource'=>'ecommerce',
|
113
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
|
114
|
-
'card'=>{
|
115
|
-
'type'=>'VI',
|
116
|
-
'number' =>'4100000000000000',
|
117
|
-
'expDate' =>'1210'
|
118
|
-
}}
|
119
|
-
response= LitleOnlineRequest.new.authorization(hash)
|
120
|
-
assert_equal('Valid Format', response.message)
|
121
|
-
end
|
122
|
-
|
123
|
-
def test_processing_instructions
|
124
|
-
hash = {
|
125
|
-
'merchantId' => '101',
|
126
|
-
'version'=>'8.8',
|
127
|
-
'reportGroup'=>'Planets',
|
128
|
-
'orderId'=>'12344',
|
129
|
-
'amount'=>'106',
|
130
|
-
'orderSource'=>'ecommerce',
|
131
|
-
'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
132
|
-
'card'=>{
|
133
|
-
'type'=>'VI',
|
134
|
-
'number' =>'4100000000000000',
|
135
|
-
'expDate' =>'1210'
|
136
|
-
}}
|
137
|
-
response= LitleOnlineRequest.new.authorization(hash)
|
138
|
-
assert_equal('Valid Format', response.message)
|
139
|
-
end
|
140
|
-
|
141
|
-
def test_pos
|
142
|
-
hash = {
|
143
|
-
'merchantId' => '101',
|
144
|
-
'version'=>'8.8',
|
145
|
-
'reportGroup'=>'Planets',
|
146
|
-
'orderId'=>'12344',
|
147
|
-
'amount'=>'106',
|
148
|
-
'orderSource'=>'ecommerce',
|
149
|
-
'pos'=>{'capability'=>'notused','entryMode'=>'track1','cardholderId'=>'pin'},
|
150
|
-
'card'=>{
|
151
|
-
'type'=>'VI',
|
152
|
-
'number' =>'4100000000000000',
|
153
|
-
'expDate' =>'1210'
|
154
|
-
}}
|
155
|
-
response= LitleOnlineRequest.new.authorization(hash)
|
156
|
-
assert_equal('Valid Format', response.message)
|
157
|
-
end
|
158
|
-
|
159
|
-
def test_pos_with_invalid_entry_mode
|
160
|
-
hash = {
|
161
|
-
'merchantId' => '101',
|
162
|
-
'version'=>'8.8',
|
163
|
-
'reportGroup'=>'Planets',
|
164
|
-
'orderId'=>'12344',
|
165
|
-
'amount'=>'106',
|
166
|
-
'orderSource'=>'ecommerce',
|
167
|
-
'pos'=>{'entryMode'=>'none','cardholderId'=>'pin','capability'=>'notused'},
|
168
|
-
'card'=>{
|
169
|
-
'type'=>'VI',
|
170
|
-
'number' =>'4100000000000001',
|
171
|
-
'expDate' =>'1210'
|
172
|
-
}}
|
173
|
-
response= LitleOnlineRequest.new.credit(hash)
|
174
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
175
|
-
end
|
176
|
-
|
177
|
-
def test_amex_data
|
178
|
-
hash = {
|
179
|
-
'merchantId' => '101',
|
180
|
-
'version'=>'8.8',
|
181
|
-
'reportGroup'=>'Planets',
|
182
|
-
'orderId'=>'12344',
|
183
|
-
'amount'=>'106',
|
184
|
-
'card'=>{
|
185
|
-
'type'=>'VI',
|
186
|
-
'number' =>'4100000000000000',
|
187
|
-
'expDate' =>'1210'},
|
188
|
-
'orderSource'=>'ecommerce',
|
189
|
-
'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234','sellerId'=>'1234Id'}
|
190
|
-
}
|
191
|
-
response= LitleOnlineRequest.new.credit(hash)
|
192
|
-
assert_equal('Valid Format', response.message)
|
193
|
-
end
|
194
|
-
|
195
|
-
def test_amex_data_missing_seller_id
|
196
|
-
hash = {
|
197
|
-
'merchantId' => '101',
|
198
|
-
'version'=>'8.8',
|
199
|
-
'reportGroup'=>'Planets',
|
200
|
-
'orderId'=>'12344',
|
201
|
-
'amount'=>'106',
|
202
|
-
'orderSource'=>'ecommerce',
|
203
|
-
'card'=>{
|
204
|
-
'type'=>'VI',
|
205
|
-
'number' =>'4100000000000001',
|
206
|
-
'expDate' =>'1210'},
|
207
|
-
'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234'}
|
208
|
-
}
|
209
|
-
response= LitleOnlineRequest.new.credit(hash)
|
210
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
211
|
-
end
|
212
|
-
|
213
|
-
def test_simple_enhanced_data
|
214
|
-
hash = {
|
215
|
-
'merchantId' => '101',
|
216
|
-
'version'=>'8.8',
|
217
|
-
'reportGroup'=>'Planets',
|
218
|
-
'orderId'=>'12344',
|
219
|
-
'amount'=>'106',
|
220
|
-
'card'=>{
|
221
|
-
'type'=>'VI',
|
222
|
-
'number' =>'4100000000000000',
|
223
|
-
'expDate' =>'1210'},
|
224
|
-
'orderSource'=>'ecommerce',
|
225
|
-
'enhancedData'=>{
|
226
|
-
'customerReference'=>'Litle',
|
227
|
-
'salesTax'=>'50',
|
228
|
-
'deliveryType'=>'TBD',
|
229
|
-
'restriction'=>'DIG',
|
230
|
-
'shipFromPostalCode'=>'01741',
|
231
|
-
'destinationPostalCode'=>'01742'}
|
232
|
-
}
|
233
|
-
response= LitleOnlineRequest.new.credit(hash)
|
234
|
-
assert_equal('Valid Format', response.message)
|
235
|
-
end
|
236
|
-
|
237
|
-
def test_simple_enhanced_data_incorrect_enum_for_country_code
|
238
|
-
hash = {
|
239
|
-
'merchantId' => '101',
|
240
|
-
'version'=>'8.8',
|
241
|
-
'reportGroup'=>'Planets',
|
242
|
-
'orderId'=>'12344',
|
243
|
-
'amount'=>'106',
|
244
|
-
'card'=>{
|
245
|
-
'type'=>'VI',
|
246
|
-
'number' =>'4100000000000001',
|
247
|
-
'expDate' =>'1210'},
|
248
|
-
'orderSource'=>'ecommerce',
|
249
|
-
'enhancedData'=>{
|
250
|
-
'destinationCountryCode'=>'001',
|
251
|
-
'customerReference'=>'Litle',
|
252
|
-
'salesTax'=>'50',
|
253
|
-
'deliveryType'=>'TBD',
|
254
|
-
'shipFromPostalCode'=>'01741',
|
255
|
-
'destinationPostalCode'=>'01742'}
|
256
|
-
}
|
257
|
-
response= LitleOnlineRequest.new.credit(hash)
|
258
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
259
|
-
end
|
260
|
-
|
261
|
-
def test_enhanced_data_with_detail_tax
|
262
|
-
hash = {
|
263
|
-
'merchantId' => '101',
|
264
|
-
'version'=>'8.8',
|
265
|
-
'reportGroup'=>'Planets',
|
266
|
-
'orderId'=>'12344',
|
267
|
-
'amount'=>'106',
|
268
|
-
'card'=>{
|
269
|
-
'type'=>'VI',
|
270
|
-
'number' =>'4100000000000000',
|
271
|
-
'expDate' =>'1210'},
|
272
|
-
'orderSource'=>'ecommerce',
|
273
|
-
'enhancedData'=>{
|
274
|
-
'detailtax'=>{'taxAmount'=>'1234','tax'=>'50'},
|
275
|
-
'customerReference'=>'Litle',
|
276
|
-
'salesTax'=>'50',
|
277
|
-
'deliveryType'=>'TBD',
|
278
|
-
'restriction'=>'DIG',
|
279
|
-
'shipFromPostalCode'=>'01741',
|
280
|
-
'destinationPostalCode'=>'01742'}
|
281
|
-
}
|
282
|
-
response= LitleOnlineRequest.new.credit(hash)
|
283
|
-
assert_equal('Valid Format', response.message)
|
284
|
-
end
|
285
|
-
|
286
|
-
def test_enhanced_data_with_line_item
|
287
|
-
hash = {
|
288
|
-
'merchantId' => '101',
|
289
|
-
'version'=>'8.8',
|
290
|
-
'reportGroup'=>'Planets',
|
291
|
-
'orderId'=>'12344',
|
292
|
-
'amount'=>'106',
|
293
|
-
'card'=>{
|
294
|
-
'type'=>'VI',
|
295
|
-
'number' =>'4100000000000000',
|
296
|
-
'expDate' =>'1210'}, 'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
297
|
-
'orderSource'=>'ecommerce',
|
298
|
-
'lineItemData'=>{
|
299
|
-
'itemSequenceNumber'=>'98765',
|
300
|
-
'itemDescription'=>'VERYnice',
|
301
|
-
'productCode'=>'10010100',
|
302
|
-
'quantity'=>'7',
|
303
|
-
'unitOfMeasure'=>'pounds',
|
304
|
-
'enhancedData'=>{
|
305
|
-
'detailtax'=>{'taxAmount'=>'1234','tax'=>'50'}},
|
306
|
-
'customerReference'=>'Litle',
|
307
|
-
'salesTax'=>'50',
|
308
|
-
'deliveryType'=>'TBD',
|
309
|
-
'restriction'=>'DIG',
|
310
|
-
'shipFromPostalCode'=>'01741',
|
311
|
-
'destinationPostalCode'=>'01742'}
|
312
|
-
}
|
313
|
-
response= LitleOnlineRequest.new.credit(hash)
|
314
|
-
assert_equal('Valid Format', response.message)
|
315
|
-
end
|
316
|
-
|
317
|
-
def test_simple_token
|
318
|
-
hash = {
|
319
|
-
'merchantId' => '101',
|
320
|
-
'version'=>'8.8',
|
321
|
-
'reportGroup'=>'Planets',
|
322
|
-
'orderId'=>'12344',
|
323
|
-
'amount'=>'106',
|
324
|
-
'orderSource'=>'ecommerce',
|
325
|
-
'token'=> {
|
326
|
-
'litleToken'=>'123456789101112',
|
327
|
-
'expDate'=>'1210',
|
328
|
-
'cardValidationNum'=>'555',
|
329
|
-
'type'=>'VI'
|
330
|
-
}}
|
331
|
-
response= LitleOnlineRequest.new.credit(hash)
|
332
|
-
assert_equal('Valid Format', response.message)
|
333
|
-
end
|
334
|
-
|
335
|
-
def test_token_with_incorrect_token_Length
|
336
|
-
hash = {
|
337
|
-
'merchantId' => '101',
|
338
|
-
'version'=>'8.8',
|
339
|
-
'reportGroup'=>'Planets',
|
340
|
-
'orderId'=>'12344',
|
341
|
-
'amount'=>'106',
|
342
|
-
'orderSource'=>'ecommerce',
|
343
|
-
'token'=> {
|
344
|
-
'litleToken'=>'123456',
|
345
|
-
'expDate'=>'1210',
|
346
|
-
'cardValidationNum'=>'555',
|
347
|
-
'type'=>'VI'
|
348
|
-
}}
|
349
|
-
response= LitleOnlineRequest.new.credit(hash)
|
350
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
351
|
-
end
|
352
|
-
|
353
|
-
def test_token_missing_exp_dat_and_valid_num
|
354
|
-
hash = {
|
355
|
-
'merchantId' => '101',
|
356
|
-
'version'=>'8.8',
|
357
|
-
'reportGroup'=>'Planets',
|
358
|
-
'orderId'=>'12344',
|
359
|
-
'amount'=>'106',
|
360
|
-
'orderSource'=>'ecommerce',
|
361
|
-
'token'=> {
|
362
|
-
'litleToken'=>'123456789101112',
|
363
|
-
'type'=>'VI'
|
364
|
-
}}
|
365
|
-
response= LitleOnlineRequest.new.credit(hash)
|
366
|
-
assert_equal('Valid Format', response.message)
|
367
|
-
end
|
368
|
-
|
369
|
-
def test_simple_paypage
|
370
|
-
hash = {
|
371
|
-
'merchantId' => '101',
|
372
|
-
'version'=>'8.8',
|
373
|
-
'reportGroup'=>'Planets',
|
374
|
-
'orderId'=>'12344',
|
375
|
-
'amount'=>'106',
|
376
|
-
'orderSource'=>'ecommerce',
|
377
|
-
'paypage'=> {
|
378
|
-
'paypageRegistrationId'=>'123456789101112',
|
379
|
-
'expDate'=>'1210',
|
380
|
-
'cardValidationNum'=>'555',
|
381
|
-
'type'=>'VI'
|
382
|
-
}}
|
383
|
-
response= LitleOnlineRequest.new.credit(hash)
|
384
|
-
assert_equal('Valid Format', response.message)
|
385
|
-
end
|
386
|
-
|
387
|
-
def test_paypage_missing_exp_dat_and_valid_num
|
388
|
-
hash = {
|
389
|
-
'merchantId' => '101',
|
390
|
-
'version'=>'8.8',
|
391
|
-
'reportGroup'=>'Planets',
|
392
|
-
'orderId'=>'12344',
|
393
|
-
'amount'=>'106',
|
394
|
-
'orderSource'=>'ecommerce',
|
395
|
-
'paypage'=> {
|
396
|
-
'paypageRegistrationId'=>'123456789101112',
|
397
|
-
'type'=>'VI'
|
398
|
-
}}
|
399
|
-
response= LitleOnlineRequest.new.credit(hash)
|
400
|
-
assert_equal('Valid Format', response.message)
|
401
|
-
end
|
28
|
+
module LitleOnline
|
29
|
+
class TestXmlfields < Test::Unit::TestCase
|
30
|
+
def test_card_no_required_type_or_track
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'litleTxnId'=>'123456',
|
36
|
+
'orderId'=>'12344',
|
37
|
+
'amount'=>'106',
|
38
|
+
'orderSource'=>'ecommerce',
|
39
|
+
'card'=>{
|
40
|
+
'number' =>'4100000000000001',
|
41
|
+
'expDate' =>'1210',
|
42
|
+
'cardValidationNum'=> '123'
|
43
|
+
}}
|
44
|
+
response= LitleOnlineRequest.new.sale(hash)
|
45
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
46
|
+
end
|
402
47
|
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
48
|
+
def test_simple_custom_billing
|
49
|
+
hash = {
|
50
|
+
'merchantId' => '101',
|
51
|
+
'version'=>'8.8',
|
52
|
+
'reportGroup'=>'Planets',
|
53
|
+
'litleTxnId'=>'123456',
|
54
|
+
'orderId'=>'12344',
|
55
|
+
'amount'=>'106',
|
56
|
+
'orderSource'=>'ecommerce',
|
57
|
+
'customBilling'=>{'phone'=>'123456789','descriptor'=>'good'},
|
58
|
+
'card'=>{
|
59
|
+
'type'=>'VI',
|
60
|
+
'number' =>'4100000000000000',
|
61
|
+
'expDate' =>'1210'
|
62
|
+
}}
|
63
|
+
response= LitleOnlineRequest.new.sale(hash)
|
64
|
+
assert_equal('Valid Format', response.message)
|
65
|
+
end
|
421
66
|
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
'
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
'
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
'
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
'
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
67
|
+
def test_bill_me_later
|
68
|
+
hash = {
|
69
|
+
'merchantId' => '101',
|
70
|
+
'version'=>'8.8',
|
71
|
+
'reportGroup'=>'Planets',
|
72
|
+
'litleTxnId'=>'123456',
|
73
|
+
'orderId'=>'12344',
|
74
|
+
'amount'=>'106',
|
75
|
+
'orderSource'=>'ecommerce',
|
76
|
+
'billMeLaterRequest'=>{'bmlMerchantId'=>'12345','preapprovalNumber'=>'12345678909023',
|
77
|
+
'customerPhoneChnaged'=>'False','itemCategoryCode'=>'2'},
|
78
|
+
'card'=>{
|
79
|
+
'type'=>'VI',
|
80
|
+
'number' =>'4100000000000000',
|
81
|
+
'expDate' =>'1210'
|
82
|
+
}}
|
83
|
+
response= LitleOnlineRequest.new.sale(hash)
|
84
|
+
assert_equal('000', response.saleResponse.response)
|
85
|
+
end
|
86
|
+
|
87
|
+
def test__customer_info
|
88
|
+
hash = {
|
89
|
+
'merchantId' => '101',
|
90
|
+
'version'=>'8.8',
|
91
|
+
'reportGroup'=>'Planets',
|
92
|
+
'litleTxnId'=>'123456',
|
93
|
+
'orderId'=>'12344',
|
94
|
+
'amount'=>'106',
|
95
|
+
'orderSource'=>'ecommerce',
|
96
|
+
'CustomerInfo'=>{'ssn'=>'12345','incomeAmount'=>'12345','incomeCurrency'=>'dollar','yearsAtResidence'=>'2'},
|
97
|
+
'card'=>{
|
98
|
+
'type'=>'VI',
|
99
|
+
'number' =>'4100000000000000',
|
100
|
+
'expDate' =>'1210'
|
101
|
+
}}
|
102
|
+
response= LitleOnlineRequest.new.sale(hash)
|
103
|
+
assert_equal('Valid Format', response.message)
|
104
|
+
end
|
105
|
+
|
106
|
+
def test_simple_bill_to_address
|
107
|
+
hash = {
|
108
|
+
'merchantId' => '101',
|
109
|
+
'version'=>'8.8',
|
110
|
+
'reportGroup'=>'Planets',
|
111
|
+
'orderId'=>'12344',
|
112
|
+
'amount'=>'106',
|
113
|
+
'orderSource'=>'ecommerce',
|
114
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
|
115
|
+
'card'=>{
|
116
|
+
'type'=>'VI',
|
117
|
+
'number' =>'4100000000000000',
|
118
|
+
'expDate' =>'1210'
|
119
|
+
}}
|
120
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
121
|
+
assert_equal('Valid Format', response.message)
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_processing_instructions
|
125
|
+
hash = {
|
126
|
+
'merchantId' => '101',
|
127
|
+
'version'=>'8.8',
|
128
|
+
'reportGroup'=>'Planets',
|
129
|
+
'orderId'=>'12344',
|
130
|
+
'amount'=>'106',
|
131
|
+
'orderSource'=>'ecommerce',
|
132
|
+
'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
133
|
+
'card'=>{
|
134
|
+
'type'=>'VI',
|
135
|
+
'number' =>'4100000000000000',
|
136
|
+
'expDate' =>'1210'
|
137
|
+
}}
|
138
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
139
|
+
assert_equal('Valid Format', response.message)
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_pos
|
143
|
+
hash = {
|
144
|
+
'merchantId' => '101',
|
145
|
+
'version'=>'8.8',
|
146
|
+
'reportGroup'=>'Planets',
|
147
|
+
'orderId'=>'12344',
|
148
|
+
'amount'=>'106',
|
149
|
+
'orderSource'=>'ecommerce',
|
150
|
+
'pos'=>{'capability'=>'notused','entryMode'=>'track1','cardholderId'=>'pin'},
|
151
|
+
'card'=>{
|
152
|
+
'type'=>'VI',
|
153
|
+
'number' =>'4100000000000000',
|
154
|
+
'expDate' =>'1210'
|
155
|
+
}}
|
156
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
157
|
+
assert_equal('Valid Format', response.message)
|
158
|
+
end
|
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
|
+
def test_amex_data
|
179
|
+
hash = {
|
180
|
+
'merchantId' => '101',
|
181
|
+
'version'=>'8.8',
|
182
|
+
'reportGroup'=>'Planets',
|
183
|
+
'orderId'=>'12344',
|
184
|
+
'amount'=>'106',
|
185
|
+
'card'=>{
|
186
|
+
'type'=>'VI',
|
187
|
+
'number' =>'4100000000000000',
|
188
|
+
'expDate' =>'1210'},
|
189
|
+
'orderSource'=>'ecommerce',
|
190
|
+
'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234','sellerId'=>'1234Id'}
|
525
191
|
}
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
},
|
544
|
-
'enhancedData'=>
|
545
|
-
{
|
546
|
-
'detailTax'=>[
|
547
|
-
{'taxIncludedInTotal'=>'true', 'taxAmount'=>'0'},
|
548
|
-
{'taxIncludedInTotal'=>'false', 'taxAmount'=>'1'}
|
549
|
-
]
|
192
|
+
response= LitleOnlineRequest.new.credit(hash)
|
193
|
+
assert_equal('Valid Format', response.message)
|
194
|
+
end
|
195
|
+
|
196
|
+
def test_amex_data_missing_seller_id
|
197
|
+
hash = {
|
198
|
+
'merchantId' => '101',
|
199
|
+
'version'=>'8.8',
|
200
|
+
'reportGroup'=>'Planets',
|
201
|
+
'orderId'=>'12344',
|
202
|
+
'amount'=>'106',
|
203
|
+
'orderSource'=>'ecommerce',
|
204
|
+
'card'=>{
|
205
|
+
'type'=>'VI',
|
206
|
+
'number' =>'4100000000000001',
|
207
|
+
'expDate' =>'1210'},
|
208
|
+
'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234'}
|
550
209
|
}
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
end
|
555
|
-
|
556
|
-
def test_detail_tax_in_lineItem
|
557
|
-
hash = {
|
558
|
-
'merchantId' => '101',
|
559
|
-
'version'=>'8.8',
|
560
|
-
'reportGroup'=>'Planets',
|
561
|
-
'orderId'=>'1',
|
562
|
-
'amount'=>'2',
|
563
|
-
'orderSource'=>'ecommerce',
|
564
|
-
'card'=>{
|
565
|
-
'type'=>'VI',
|
566
|
-
'number' =>'4100000000000001',
|
567
|
-
'expDate' =>'1210'
|
568
|
-
},
|
569
|
-
'enhancedData'=>
|
570
|
-
{
|
571
|
-
'lineItemData'=>[
|
572
|
-
{'itemSequenceNumber'=>'1', 'itemDescription'=>'desc1','detailTax'=>[
|
573
|
-
{'taxAmount'=>'1'},
|
574
|
-
{'taxAmount'=>'2'}]
|
575
|
-
},
|
576
|
-
{'itemSequenceNumber'=>'2', 'itemDescription'=>'desc2','detailTax'=>[
|
577
|
-
{'taxAmount'=>'3'},
|
578
|
-
{'taxAmount'=>'4'}]
|
579
|
-
}],
|
580
|
-
'detailTax'=>[
|
581
|
-
{'taxAmount'=>'5'},
|
582
|
-
{'taxAmount'=>'6'}
|
583
|
-
]}
|
584
|
-
}
|
585
|
-
response= LitleOnlineRequest.new.authorization(hash)
|
586
|
-
assert_equal('Valid Format', response.message)
|
587
|
-
end
|
210
|
+
response= LitleOnlineRequest.new.credit(hash)
|
211
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
212
|
+
end
|
588
213
|
|
589
|
-
|
590
|
-
|
214
|
+
def test_simple_enhanced_data
|
215
|
+
hash = {
|
216
|
+
'merchantId' => '101',
|
217
|
+
'version'=>'8.8',
|
218
|
+
'reportGroup'=>'Planets',
|
219
|
+
'orderId'=>'12344',
|
220
|
+
'amount'=>'106',
|
221
|
+
'card'=>{
|
222
|
+
'type'=>'VI',
|
223
|
+
'number' =>'4100000000000000',
|
224
|
+
'expDate' =>'1210'},
|
225
|
+
'orderSource'=>'ecommerce',
|
226
|
+
'enhancedData'=>{
|
227
|
+
'customerReference'=>'Litle',
|
228
|
+
'salesTax'=>'50',
|
229
|
+
'deliveryType'=>'TBD',
|
230
|
+
'restriction'=>'DIG',
|
231
|
+
'shipFromPostalCode'=>'01741',
|
232
|
+
'destinationPostalCode'=>'01742'}
|
233
|
+
}
|
234
|
+
response= LitleOnlineRequest.new.credit(hash)
|
235
|
+
assert_equal('Valid Format', response.message)
|
236
|
+
end
|
237
|
+
|
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
|
+
def test_enhanced_data_with_detail_tax
|
263
|
+
hash = {
|
264
|
+
'merchantId' => '101',
|
265
|
+
'version'=>'8.8',
|
266
|
+
'reportGroup'=>'Planets',
|
267
|
+
'orderId'=>'12344',
|
268
|
+
'amount'=>'106',
|
269
|
+
'card'=>{
|
270
|
+
'type'=>'VI',
|
271
|
+
'number' =>'4100000000000000',
|
272
|
+
'expDate' =>'1210'},
|
273
|
+
'orderSource'=>'ecommerce',
|
274
|
+
'enhancedData'=>{
|
275
|
+
'detailtax'=>{'taxAmount'=>'1234','tax'=>'50'},
|
276
|
+
'customerReference'=>'Litle',
|
277
|
+
'salesTax'=>'50',
|
278
|
+
'deliveryType'=>'TBD',
|
279
|
+
'restriction'=>'DIG',
|
280
|
+
'shipFromPostalCode'=>'01741',
|
281
|
+
'destinationPostalCode'=>'01742'}
|
282
|
+
}
|
283
|
+
response= LitleOnlineRequest.new.credit(hash)
|
284
|
+
assert_equal('Valid Format', response.message)
|
285
|
+
end
|
286
|
+
|
287
|
+
def test_enhanced_data_with_line_item
|
288
|
+
hash = {
|
289
|
+
'merchantId' => '101',
|
290
|
+
'version'=>'8.8',
|
291
|
+
'reportGroup'=>'Planets',
|
292
|
+
'orderId'=>'12344',
|
293
|
+
'amount'=>'106',
|
294
|
+
'card'=>{
|
295
|
+
'type'=>'VI',
|
296
|
+
'number' =>'4100000000000000',
|
297
|
+
'expDate' =>'1210'}, 'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
298
|
+
'orderSource'=>'ecommerce',
|
299
|
+
'lineItemData'=>{
|
300
|
+
'itemSequenceNumber'=>'98765',
|
301
|
+
'itemDescription'=>'VERYnice',
|
302
|
+
'productCode'=>'10010100',
|
303
|
+
'quantity'=>'7',
|
304
|
+
'unitOfMeasure'=>'pounds',
|
305
|
+
'enhancedData'=>{
|
306
|
+
'detailtax'=>{'taxAmount'=>'1234','tax'=>'50'}},
|
307
|
+
'customerReference'=>'Litle',
|
308
|
+
'salesTax'=>'50',
|
309
|
+
'deliveryType'=>'TBD',
|
310
|
+
'restriction'=>'DIG',
|
311
|
+
'shipFromPostalCode'=>'01741',
|
312
|
+
'destinationPostalCode'=>'01742'}
|
313
|
+
}
|
314
|
+
response= LitleOnlineRequest.new.credit(hash)
|
315
|
+
assert_equal('Valid Format', response.message)
|
316
|
+
end
|
317
|
+
|
318
|
+
def test_simple_token
|
319
|
+
hash = {
|
320
|
+
'merchantId' => '101',
|
321
|
+
'version'=>'8.8',
|
322
|
+
'reportGroup'=>'Planets',
|
323
|
+
'orderId'=>'12344',
|
324
|
+
'amount'=>'106',
|
325
|
+
'orderSource'=>'ecommerce',
|
326
|
+
'token'=> {
|
327
|
+
'litleToken'=>'123456789101112',
|
328
|
+
'expDate'=>'1210',
|
329
|
+
'cardValidationNum'=>'555',
|
330
|
+
'type'=>'VI'
|
331
|
+
}}
|
332
|
+
response= LitleOnlineRequest.new.credit(hash)
|
333
|
+
assert_equal('Valid Format', response.message)
|
334
|
+
end
|
335
|
+
|
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
|
+
def test_token_missing_exp_dat_and_valid_num
|
355
|
+
hash = {
|
356
|
+
'merchantId' => '101',
|
357
|
+
'version'=>'8.8',
|
358
|
+
'reportGroup'=>'Planets',
|
359
|
+
'orderId'=>'12344',
|
360
|
+
'amount'=>'106',
|
361
|
+
'orderSource'=>'ecommerce',
|
362
|
+
'token'=> {
|
363
|
+
'litleToken'=>'123456789101112',
|
364
|
+
'type'=>'VI'
|
365
|
+
}}
|
366
|
+
response= LitleOnlineRequest.new.credit(hash)
|
367
|
+
assert_equal('Valid Format', response.message)
|
368
|
+
end
|
369
|
+
|
370
|
+
def test_simple_paypage
|
371
|
+
hash = {
|
372
|
+
'merchantId' => '101',
|
373
|
+
'version'=>'8.8',
|
374
|
+
'reportGroup'=>'Planets',
|
375
|
+
'orderId'=>'12344',
|
376
|
+
'amount'=>'106',
|
377
|
+
'orderSource'=>'ecommerce',
|
378
|
+
'paypage'=> {
|
379
|
+
'paypageRegistrationId'=>'123456789101112',
|
380
|
+
'expDate'=>'1210',
|
381
|
+
'cardValidationNum'=>'555',
|
382
|
+
'type'=>'VI'
|
383
|
+
}}
|
384
|
+
response= LitleOnlineRequest.new.credit(hash)
|
385
|
+
assert_equal('Valid Format', response.message)
|
386
|
+
end
|
387
|
+
|
388
|
+
def test_paypage_missing_exp_dat_and_valid_num
|
389
|
+
hash = {
|
390
|
+
'merchantId' => '101',
|
391
|
+
'version'=>'8.8',
|
392
|
+
'reportGroup'=>'Planets',
|
393
|
+
'orderId'=>'12344',
|
394
|
+
'amount'=>'106',
|
395
|
+
'orderSource'=>'ecommerce',
|
396
|
+
'paypage'=> {
|
397
|
+
'paypageRegistrationId'=>'123456789101112',
|
398
|
+
'type'=>'VI'
|
399
|
+
}}
|
400
|
+
response= LitleOnlineRequest.new.credit(hash)
|
401
|
+
assert_equal('Valid Format', response.message)
|
402
|
+
end
|
403
|
+
|
404
|
+
def test_cardbothtypeandtrack
|
405
|
+
hash = {
|
406
|
+
'merchantId' => '101',
|
407
|
+
'version'=>'8.8',
|
408
|
+
'reportGroup'=>'Planets',
|
409
|
+
'litleTxnId'=>'123456',
|
410
|
+
'orderId'=>'12344',
|
411
|
+
'amount'=>'106',
|
412
|
+
'orderSource'=>'ecommerce',
|
413
|
+
'card'=>{
|
414
|
+
'type'=>'VI',
|
415
|
+
'track'=>'1234',
|
416
|
+
'number' =>'4100000000000001',
|
417
|
+
'expDate' =>'1210'
|
418
|
+
}}
|
419
|
+
response= LitleOnlineRequest.new.credit(hash)
|
420
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
421
|
+
end
|
422
|
+
|
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
|
+
def test_line_item_data
|
508
|
+
hash = {
|
509
|
+
'merchantId' => '101',
|
510
|
+
'version'=>'8.8',
|
511
|
+
'reportGroup'=>'Planets',
|
512
|
+
'orderId'=>'1',
|
513
|
+
'amount'=>'2',
|
514
|
+
'orderSource'=>'ecommerce',
|
515
|
+
'card'=>{
|
516
|
+
'type'=>'VI',
|
517
|
+
'number' =>'4100000000000001',
|
518
|
+
'expDate' =>'1210'
|
519
|
+
},
|
520
|
+
'enhancedData'=>
|
521
|
+
{
|
522
|
+
'lineItemData'=>[
|
523
|
+
{'itemSequenceNumber'=>'1', 'itemDescription'=>'desc1'},
|
524
|
+
{'itemSequenceNumber'=>'2', 'itemDescription'=>'desc2'}
|
525
|
+
]
|
526
|
+
}
|
527
|
+
}
|
528
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
529
|
+
assert_equal('Valid Format', response.message)
|
530
|
+
end
|
531
|
+
|
532
|
+
def test_detail_tax
|
533
|
+
hash = {
|
534
|
+
'merchantId' => '101',
|
535
|
+
'version'=>'8.8',
|
536
|
+
'reportGroup'=>'Planets',
|
537
|
+
'orderId'=>'1',
|
538
|
+
'amount'=>'2',
|
539
|
+
'orderSource'=>'ecommerce',
|
540
|
+
'card'=>{
|
541
|
+
'type'=>'VI',
|
542
|
+
'number' =>'4100000000000001',
|
543
|
+
'expDate' =>'1210'
|
544
|
+
},
|
545
|
+
'enhancedData'=>
|
546
|
+
{
|
547
|
+
'detailTax'=>[
|
548
|
+
{'taxIncludedInTotal'=>'true', 'taxAmount'=>'0'},
|
549
|
+
{'taxIncludedInTotal'=>'false', 'taxAmount'=>'1'}
|
550
|
+
]
|
551
|
+
}
|
552
|
+
}
|
553
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
554
|
+
assert_equal('Valid Format', response.message)
|
555
|
+
end
|
556
|
+
|
557
|
+
def test_detail_tax_in_lineItem
|
558
|
+
hash = {
|
559
|
+
'merchantId' => '101',
|
560
|
+
'version'=>'8.8',
|
561
|
+
'reportGroup'=>'Planets',
|
562
|
+
'orderId'=>'1',
|
563
|
+
'amount'=>'2',
|
564
|
+
'orderSource'=>'ecommerce',
|
565
|
+
'card'=>{
|
566
|
+
'type'=>'VI',
|
567
|
+
'number' =>'4100000000000001',
|
568
|
+
'expDate' =>'1210'
|
569
|
+
},
|
570
|
+
'enhancedData'=>
|
571
|
+
{
|
572
|
+
'lineItemData'=>[
|
573
|
+
{'itemSequenceNumber'=>'1', 'itemDescription'=>'desc1','detailTax'=>[
|
574
|
+
{'taxAmount'=>'1'},
|
575
|
+
{'taxAmount'=>'2'}]
|
576
|
+
},
|
577
|
+
{'itemSequenceNumber'=>'2', 'itemDescription'=>'desc2','detailTax'=>[
|
578
|
+
{'taxAmount'=>'3'},
|
579
|
+
{'taxAmount'=>'4'}]
|
580
|
+
}],
|
581
|
+
'detailTax'=>[
|
582
|
+
{'taxAmount'=>'5'},
|
583
|
+
{'taxAmount'=>'6'}
|
584
|
+
]}
|
585
|
+
}
|
586
|
+
response= LitleOnlineRequest.new.authorization(hash)
|
587
|
+
assert_equal('Valid Format', response.message)
|
588
|
+
end
|
589
|
+
end
|
590
|
+
end
|