LitleOnline 8.10.0 → 8.10.1
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/Rakefile +1 -1
- data/lib/Communications.rb +3 -4
- data/lib/Configuration.rb +1 -1
- data/lib/LitleOnlineRequest.rb +170 -139
- data/lib/XMLFields.rb +29 -29
- data/test/certification/certTest1_base.rb +602 -606
- data/test/certification/certTest2_authenhanced.rb +6 -6
- data/test/certification/certTest3_authreversal.rb +29 -30
- data/test/certification/certTest4_echeck.rb +13 -16
- data/test/certification/certTest5_token.rb +11 -31
- data/test/functional/test_auth.rb +6 -6
- data/test/functional/test_authReversal.rb +6 -6
- data/test/functional/test_capture.rb +3 -3
- data/test/functional/test_captureGivenAuth.rb +12 -12
- data/test/functional/test_credit.rb +7 -7
- data/test/functional/test_echeckCredit.rb +11 -11
- data/test/functional/test_echeckRedeposit.rb +8 -8
- data/test/functional/test_echeckSale.rb +34 -32
- data/test/functional/test_echeckVerification.rb +8 -8
- data/test/functional/test_forceCapture.rb +8 -8
- data/test/functional/test_sale.rb +9 -11
- data/test/functional/test_token.rb +12 -12
- data/test/functional/test_xmlfields.rb +18 -18
- data/test/unit/test_LitleOnlineRequest.rb +26 -17
- data/test/unit/test_auth.rb +22 -10
- data/test/unit/test_authReversal.rb +2 -2
- data/test/unit/test_capture.rb +1 -1
- data/test/unit/test_captureGivenAuth.rb +6 -6
- data/test/unit/test_credit.rb +4 -7
- data/test/unit/test_echeckCredit.rb +2 -2
- data/test/unit/test_echeckRedeposit.rb +8 -8
- data/test/unit/test_echeckSale.rb +2 -2
- data/test/unit/test_echeckVerification.rb +8 -8
- data/test/unit/test_forceCapture.rb +8 -8
- data/test/unit/test_sale.rb +9 -9
- data/test/unit/test_token.rb +4 -4
- data/test/unit/test_xmlfields.rb +7 -9
- metadata +12 -12
data/lib/XMLFields.rb
CHANGED
@@ -49,7 +49,7 @@ class XMLFields
|
|
49
49
|
return hash_out
|
50
50
|
end
|
51
51
|
|
52
|
-
def XMLFields.
|
52
|
+
def XMLFields.customer_info(hash_in)
|
53
53
|
hash_out={
|
54
54
|
:ssn=>hash_in['ssn'],
|
55
55
|
:dob=>hash_in['dob'],
|
@@ -69,7 +69,7 @@ class XMLFields
|
|
69
69
|
return hash_out
|
70
70
|
end
|
71
71
|
|
72
|
-
def XMLFields.
|
72
|
+
def XMLFields.bill_me_later_request(hash_in)
|
73
73
|
hash_out = {
|
74
74
|
:bmlMerchantId=>hash_in['bmlMerchantId'],
|
75
75
|
:termsAndConditions=>hash_in['termsAndConditions'],
|
@@ -90,7 +90,7 @@ class XMLFields
|
|
90
90
|
return hash_out
|
91
91
|
end
|
92
92
|
|
93
|
-
def XMLFields.
|
93
|
+
def XMLFields.fraud_check_type(hash_in)
|
94
94
|
hash_out = {
|
95
95
|
:authenticationValue=>hash_in['authenticationValue'],
|
96
96
|
:authenticationTransactionId=>hash_in['authenticationTransactionId'],
|
@@ -102,11 +102,11 @@ class XMLFields
|
|
102
102
|
return hash_out
|
103
103
|
end
|
104
104
|
|
105
|
-
def XMLFields.
|
105
|
+
def XMLFields.auth_information(hash_in)
|
106
106
|
hash_out = {
|
107
107
|
:authDate=>(hash_in['authDate'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
108
108
|
:authCode=>(hash_in['authCode'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
109
|
-
:fraudResult=>
|
109
|
+
:fraudResult=>fraud_result((hash_in['detailTax'] or ' ')),
|
110
110
|
:authAmount=>hash_in['authAmount']
|
111
111
|
}
|
112
112
|
Checker.purge_null(hash_out)
|
@@ -114,7 +114,7 @@ class XMLFields
|
|
114
114
|
return hash_out
|
115
115
|
end
|
116
116
|
|
117
|
-
def XMLFields.
|
117
|
+
def XMLFields.fraud_result(hash_in)
|
118
118
|
hash_out= {
|
119
119
|
:avsResult=>hash_in['avsResult'],
|
120
120
|
:cardValidationResult=>hash_in['cardValidationResult'],
|
@@ -126,7 +126,7 @@ class XMLFields
|
|
126
126
|
return hash_out
|
127
127
|
end
|
128
128
|
|
129
|
-
def XMLFields.
|
129
|
+
def XMLFields.healthcare_amounts(hash_in)
|
130
130
|
hash_out = {
|
131
131
|
:totalHealthcareAmount=>hash_in['totalHealthcareAmount'],
|
132
132
|
:RxAmount=>hash_in['RxAmount'],
|
@@ -139,9 +139,9 @@ class XMLFields
|
|
139
139
|
return hash_out
|
140
140
|
end
|
141
141
|
|
142
|
-
def XMLFields.
|
142
|
+
def XMLFields.healthcare_iias(hash_in)
|
143
143
|
hash_out ={
|
144
|
-
:healthcareAmounts=>
|
144
|
+
:healthcareAmounts=>healthcare_amounts((hash_in['healthcareAmounts'] or ' ')),
|
145
145
|
:IIASFlag=>hash_in['IIASFlag']
|
146
146
|
}
|
147
147
|
Checker.purge_null(hash_out)
|
@@ -160,7 +160,7 @@ class XMLFields
|
|
160
160
|
return hash_out
|
161
161
|
end
|
162
162
|
|
163
|
-
def XMLFields.
|
163
|
+
def XMLFields.detail_tax(hash_in)
|
164
164
|
hash_out ={
|
165
165
|
:taxIncludedInTotal=>hash_in['taxIncludedInTotal'],
|
166
166
|
:taxAmount=>hash_in['taxAmount'],
|
@@ -173,7 +173,7 @@ class XMLFields
|
|
173
173
|
return hash_out
|
174
174
|
end
|
175
175
|
|
176
|
-
def XMLFields.
|
176
|
+
def XMLFields.line_item_data(hash_in)
|
177
177
|
hash_out = {
|
178
178
|
:itemSequenceNumber=>hash_in['itemSequenceNumber'],
|
179
179
|
:itemDescription=>hash_in['itemDescription'],
|
@@ -186,14 +186,14 @@ class XMLFields
|
|
186
186
|
:itemDiscountAmount=>hash_in['itemDiscountAmount'],
|
187
187
|
:commodityCode=>hash_in['commodityCode'],
|
188
188
|
:unitCost=>hash_in['unitCost'],
|
189
|
-
:detailTax =>
|
189
|
+
:detailTax => detail_tax((hash_in['detailTax'] or ' '))
|
190
190
|
}
|
191
191
|
Checker.purge_null(hash_out)
|
192
192
|
Checker.required_missing(hash_out)
|
193
193
|
return hash_out
|
194
194
|
end
|
195
195
|
|
196
|
-
def XMLFields.
|
196
|
+
def XMLFields.enhanced_data(hash_in)
|
197
197
|
hash_out = {
|
198
198
|
:customerReference=>hash_in['customerReference'],
|
199
199
|
:salesTax=>hash_in['salesTax'],
|
@@ -207,15 +207,15 @@ class XMLFields
|
|
207
207
|
:destinationCountryCode=>hash_in['destinationCountryCode'],
|
208
208
|
:invoiceReferenceNumber=>hash_in['invoiceReferenceNumber'],
|
209
209
|
:orderDate=>hash_in['orderDate'],
|
210
|
-
:detailTax=>
|
211
|
-
:lineItemData=>
|
210
|
+
:detailTax=> detail_tax((hash_in['detailTax'] or ' ')),
|
211
|
+
:lineItemData=> line_item_data((hash_in['lineItemData'] or ' '))
|
212
212
|
}
|
213
213
|
Checker.purge_null(hash_out)
|
214
214
|
Checker.required_missing(hash_out)
|
215
215
|
return hash_out
|
216
216
|
end
|
217
217
|
|
218
|
-
def XMLFields.
|
218
|
+
def XMLFields.amex_aggregator_data(hash_in)
|
219
219
|
hash_out ={
|
220
220
|
:sellerId=>hash_in['sellerId'],
|
221
221
|
:sellerMerchantCategoryCode=>hash_in['sellerMerchantCategoryCode']
|
@@ -225,7 +225,7 @@ class XMLFields
|
|
225
225
|
return hash_out
|
226
226
|
end
|
227
227
|
|
228
|
-
def XMLFields.
|
228
|
+
def XMLFields.card_type(hash_in)
|
229
229
|
hash_out= {
|
230
230
|
:type=>hash_in['type'] ,
|
231
231
|
:track=>hash_in['track'],
|
@@ -239,7 +239,7 @@ class XMLFields
|
|
239
239
|
return hash_out
|
240
240
|
end
|
241
241
|
|
242
|
-
def XMLFields.
|
242
|
+
def XMLFields.card_token_type(hash_in)
|
243
243
|
hash_out = {
|
244
244
|
:litleToken=>(hash_in['litleToken'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
245
245
|
:expDate=>hash_in['expDate'],
|
@@ -251,7 +251,7 @@ class XMLFields
|
|
251
251
|
return hash_out
|
252
252
|
end
|
253
253
|
|
254
|
-
def XMLFields.
|
254
|
+
def XMLFields.card_paypage_type(hash_in)
|
255
255
|
hash_out = {
|
256
256
|
:paypageRegistrationId=>(hash_in['paypageRegistrationId'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
257
257
|
:expDate=>hash_in['expDate'] ,
|
@@ -263,7 +263,7 @@ class XMLFields
|
|
263
263
|
return hash_out
|
264
264
|
end
|
265
265
|
|
266
|
-
def XMLFields.
|
266
|
+
def XMLFields.pay_pal(hash_in)
|
267
267
|
hash_out = {
|
268
268
|
:payerId=>(hash_in['payerId'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
269
269
|
:token=>hash_in['token'],
|
@@ -274,7 +274,7 @@ class XMLFields
|
|
274
274
|
return hash_out
|
275
275
|
end
|
276
276
|
|
277
|
-
def XMLFields.
|
277
|
+
def XMLFields.credit_pay_pal(hash_in)
|
278
278
|
hash_out = {
|
279
279
|
:payerId=>(hash_in['payerId'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
280
280
|
:payerEmail => (hash_in['payerEmail'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
@@ -286,7 +286,7 @@ class XMLFields
|
|
286
286
|
return hash_out
|
287
287
|
end
|
288
288
|
|
289
|
-
def XMLFields.
|
289
|
+
def XMLFields.custom_billing(hash_in)
|
290
290
|
hash_out = {
|
291
291
|
:phone=>hash_in['phone'],
|
292
292
|
:city=>hash_in['city'],
|
@@ -301,7 +301,7 @@ class XMLFields
|
|
301
301
|
|
302
302
|
end
|
303
303
|
|
304
|
-
def XMLFields.
|
304
|
+
def XMLFields.tax_billing(hash_in)
|
305
305
|
hash_out = {
|
306
306
|
:taxAuthority=>(hash_in['taxAuthority'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
307
307
|
:state=>(hash_in['state'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
@@ -312,7 +312,7 @@ class XMLFields
|
|
312
312
|
return hash_out
|
313
313
|
end
|
314
314
|
|
315
|
-
def XMLFields.
|
315
|
+
def XMLFields.processing_instructions(hash_in)
|
316
316
|
hash_out ={
|
317
317
|
:bypassVelocityCheck=>hash_in['bypassVelocityCheck']
|
318
318
|
}
|
@@ -321,7 +321,7 @@ class XMLFields
|
|
321
321
|
return hash_out
|
322
322
|
end
|
323
323
|
|
324
|
-
def XMLFields.
|
324
|
+
def XMLFields.echeck_for_token_type(hash_in)
|
325
325
|
hash_out = {
|
326
326
|
:accNum=>(hash_in['accNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
327
327
|
:routingNum=>(hash_in['routingNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag'))
|
@@ -331,7 +331,7 @@ class XMLFields
|
|
331
331
|
return hash_out
|
332
332
|
end
|
333
333
|
|
334
|
-
def XMLFields.
|
334
|
+
def XMLFields.filtering_type(hash_in)
|
335
335
|
hash_out = {
|
336
336
|
:prepaid=>hash_in['prepaid'],
|
337
337
|
:international=>hash_in['international'],
|
@@ -342,7 +342,7 @@ class XMLFields
|
|
342
342
|
return hash_out
|
343
343
|
end
|
344
344
|
|
345
|
-
def XMLFields.
|
345
|
+
def XMLFields.echeck_type(hash_in)
|
346
346
|
hash_out= {
|
347
347
|
:accType=>(hash_in['accType'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
348
348
|
:accNum=>(hash_in['accNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
@@ -354,7 +354,7 @@ class XMLFields
|
|
354
354
|
return hash_out
|
355
355
|
end
|
356
356
|
|
357
|
-
def XMLFields.
|
357
|
+
def XMLFields.echeck_token_type(hash_in)
|
358
358
|
hash_out= {
|
359
359
|
:litleToken=>(hash_in['litleToken'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
360
360
|
:routingNum=>(hash_in['routingNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
@@ -366,7 +366,7 @@ class XMLFields
|
|
366
366
|
return hash_out
|
367
367
|
end
|
368
368
|
|
369
|
-
def XMLFields.
|
369
|
+
def XMLFields.recycling_request_type(hash_in)
|
370
370
|
hash_out= {
|
371
371
|
:recyleBy=>(hash_in['recyleBy'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
372
372
|
}
|
@@ -7,7 +7,8 @@ class Litle_certTest < Test::Unit::TestCase
|
|
7
7
|
@@merchant_hash = {'reportGroup'=>'Planets',
|
8
8
|
'merchantId'=>'101'
|
9
9
|
}
|
10
|
-
|
10
|
+
|
11
|
+
def test_1_auth
|
11
12
|
customer_hash = {
|
12
13
|
'orderId' => '1',
|
13
14
|
'amount' => '10010',
|
@@ -54,7 +55,7 @@ class Litle_certTest < Test::Unit::TestCase
|
|
54
55
|
assert_equal('000', void_response.voidResponse.response)
|
55
56
|
assert_equal('Approved', void_response.voidResponse.message)
|
56
57
|
end
|
57
|
-
|
58
|
+
|
58
59
|
def test_1_AVS
|
59
60
|
customer_hash = {
|
60
61
|
'orderId' => '1',
|
@@ -81,8 +82,8 @@ class Litle_certTest < Test::Unit::TestCase
|
|
81
82
|
assert_equal('01', auth_response.authorizationResponse.fraudResult.avsResult)
|
82
83
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
83
84
|
end
|
84
|
-
|
85
|
-
def
|
85
|
+
|
86
|
+
def test_1_sale
|
86
87
|
customer_hash = {
|
87
88
|
'orderId' => '1',
|
88
89
|
'amount' => '10010',
|
@@ -123,297 +124,294 @@ class Litle_certTest < Test::Unit::TestCase
|
|
123
124
|
assert_equal('Approved', void_response.voidResponse.message)
|
124
125
|
end
|
125
126
|
|
127
|
+
def test_2_auth
|
128
|
+
customer_hash = {
|
129
|
+
'orderId' => '2',
|
130
|
+
'amount' => '20020',
|
131
|
+
'orderSource'=>'ecommerce',
|
132
|
+
'billToAddress'=>{
|
133
|
+
'name' => 'Mike J. Hammer',
|
134
|
+
'addressLine1' => '2 Main St.',
|
135
|
+
'addressLine2' => 'Apt. 222',
|
136
|
+
'city' => 'Riverside',
|
137
|
+
'state' => 'RI',
|
138
|
+
'zip' => '02915',
|
139
|
+
'country' => 'US'},
|
140
|
+
'card'=>{
|
141
|
+
'number' =>'5112010000000003',
|
142
|
+
'expDate' => '0212',
|
143
|
+
'cardValidationNum' => '261',
|
144
|
+
'type' => 'MC'
|
145
|
+
},
|
146
|
+
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
147
|
+
}
|
148
|
+
hash = customer_hash.merge(@@merchant_hash)
|
149
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
150
|
+
assert_equal('000', auth_response.authorizationResponse.response)
|
151
|
+
assert_equal('Approved', auth_response.authorizationResponse.message)
|
152
|
+
assert_equal('22222', auth_response.authorizationResponse.authCode)
|
153
|
+
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
154
|
+
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
155
|
+
|
156
|
+
#test 2A
|
157
|
+
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
158
|
+
hash2a = capture_hash.merge(@@merchant_hash)
|
159
|
+
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
160
|
+
assert_equal('000', capture_response.captureResponse.response)
|
161
|
+
assert_equal('Approved', capture_response.captureResponse.message)
|
162
|
+
|
163
|
+
#test 2B
|
164
|
+
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
165
|
+
hash2b = credit_hash.merge(@@merchant_hash)
|
166
|
+
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
167
|
+
assert_equal('000', credit_response.creditResponse.response)
|
168
|
+
assert_equal('Approved', credit_response.creditResponse.message)
|
169
|
+
|
170
|
+
#test 2C
|
171
|
+
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
172
|
+
hash2c = void_hash.merge(@@merchant_hash)
|
173
|
+
void_response = LitleOnlineRequest.new.void(hash2c)
|
174
|
+
assert_equal('000', void_response.voidResponse.response)
|
175
|
+
assert_equal('Approved', void_response.voidResponse.message)
|
176
|
+
end
|
177
|
+
|
178
|
+
def test_2_avs
|
179
|
+
customer_hash = {
|
180
|
+
'orderId' => '2',
|
181
|
+
'amount' => '000',
|
182
|
+
'orderSource'=>'ecommerce',
|
183
|
+
'billToAddress'=>{
|
184
|
+
'name' => 'Mike J. Hammer',
|
185
|
+
'addressLine1' => '2 Main St.',
|
186
|
+
'addressLine2' => 'Apt. 222',
|
187
|
+
'city' => 'Riverside',
|
188
|
+
'state' => 'RI',
|
189
|
+
'zip' => '02915',
|
190
|
+
'country' => 'US'},
|
191
|
+
'card'=>{
|
192
|
+
'number' =>'5112010000000003',
|
193
|
+
'expDate' => '0212',
|
194
|
+
'cardValidationNum' => '261',
|
195
|
+
'type' => 'MC'
|
196
|
+
},
|
197
|
+
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
198
|
+
}
|
199
|
+
hash = customer_hash.merge(@@merchant_hash)
|
200
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
201
|
+
assert_equal('000', auth_response.authorizationResponse.response)
|
202
|
+
assert_equal('Approved', auth_response.authorizationResponse.message)
|
203
|
+
assert_equal('22222', auth_response.authorizationResponse.authCode)
|
204
|
+
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
205
|
+
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
206
|
+
end
|
126
207
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
auth_response = LitleOnlineRequest.new.authorization(hash)
|
150
|
-
assert_equal('000', auth_response.authorizationResponse.response)
|
151
|
-
assert_equal('Approved', auth_response.authorizationResponse.message)
|
152
|
-
assert_equal('22222', auth_response.authorizationResponse.authCode)
|
153
|
-
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
154
|
-
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
155
|
-
|
156
|
-
#test 2A
|
157
|
-
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
158
|
-
hash2a = capture_hash.merge(@@merchant_hash)
|
159
|
-
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
160
|
-
assert_equal('000', capture_response.captureResponse.response)
|
161
|
-
assert_equal('Approved', capture_response.captureResponse.message)
|
162
|
-
|
163
|
-
#test 2B
|
164
|
-
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
165
|
-
hash2b = credit_hash.merge(@@merchant_hash)
|
166
|
-
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
167
|
-
assert_equal('000', credit_response.creditResponse.response)
|
168
|
-
assert_equal('Approved', credit_response.creditResponse.message)
|
169
|
-
|
170
|
-
#test 2C
|
171
|
-
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
172
|
-
hash2c = void_hash.merge(@@merchant_hash)
|
173
|
-
void_response = LitleOnlineRequest.new.void(hash2c)
|
174
|
-
assert_equal('000', void_response.voidResponse.response)
|
175
|
-
assert_equal('Approved', void_response.voidResponse.message)
|
176
|
-
end
|
177
|
-
|
178
|
-
def test_2_Avs
|
179
|
-
customer_hash = {
|
180
|
-
'orderId' => '2',
|
181
|
-
'amount' => '000',
|
182
|
-
'orderSource'=>'ecommerce',
|
183
|
-
'billToAddress'=>{
|
184
|
-
'name' => 'Mike J. Hammer',
|
185
|
-
'addressLine1' => '2 Main St.',
|
186
|
-
'addressLine2' => 'Apt. 222',
|
187
|
-
'city' => 'Riverside',
|
188
|
-
'state' => 'RI',
|
189
|
-
'zip' => '02915',
|
190
|
-
'country' => 'US'},
|
191
|
-
'card'=>{
|
192
|
-
'number' =>'5112010000000003',
|
193
|
-
'expDate' => '0212',
|
194
|
-
'cardValidationNum' => '261',
|
195
|
-
'type' => 'MC'
|
196
|
-
},
|
197
|
-
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
198
|
-
}
|
199
|
-
hash = customer_hash.merge(@@merchant_hash)
|
200
|
-
auth_response = LitleOnlineRequest.new.authorization(hash)
|
201
|
-
assert_equal('000', auth_response.authorizationResponse.response)
|
202
|
-
assert_equal('Approved', auth_response.authorizationResponse.message)
|
203
|
-
assert_equal('22222', auth_response.authorizationResponse.authCode)
|
204
|
-
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
205
|
-
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
206
|
-
end
|
207
|
-
|
208
|
-
def test_2_Sale
|
209
|
-
customer_hash = {
|
210
|
-
'orderId' => '2',
|
211
|
-
'amount' => '20020',
|
212
|
-
'orderSource'=>'ecommerce',
|
213
|
-
'billToAddress'=>{
|
214
|
-
'name' => 'Mike J. Hammer',
|
215
|
-
'addressLine1' => '2 Main St.',
|
216
|
-
'addressLine2' => 'Apt. 222',
|
217
|
-
'city' => 'Riverside',
|
218
|
-
'state' => 'RI',
|
219
|
-
'zip' => '02915',
|
220
|
-
'country' => 'US'},
|
221
|
-
'card'=>{
|
222
|
-
'number' =>'5112010000000003',
|
223
|
-
'expDate' => '0212',
|
224
|
-
'cardValidationNum' => '261',
|
225
|
-
'type' => 'MC'
|
226
|
-
},
|
227
|
-
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
228
|
-
}
|
229
|
-
hash = customer_hash.merge(@@merchant_hash)
|
230
|
-
sale_response = LitleOnlineRequest.new.sale(hash)
|
231
|
-
assert_equal('000', sale_response.saleResponse.response)
|
232
|
-
assert_equal('Approved', sale_response.saleResponse.message)
|
233
|
-
assert_equal('22222', sale_response.saleResponse.authCode)
|
234
|
-
assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
|
235
|
-
assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
|
236
|
-
|
237
|
-
#test 2B
|
238
|
-
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
239
|
-
hash2b = credit_hash.merge(@@merchant_hash)
|
240
|
-
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
241
|
-
assert_equal('000', credit_response.creditResponse.response)
|
242
|
-
assert_equal('Approved', credit_response.creditResponse.message)
|
243
|
-
|
244
|
-
#test 2C
|
245
|
-
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
246
|
-
hash2c = void_hash.merge(@@merchant_hash)
|
247
|
-
void_response = LitleOnlineRequest.new.void(hash2c)
|
248
|
-
assert_equal('000', void_response.voidResponse.response)
|
249
|
-
assert_equal('Approved', void_response.voidResponse.message)
|
250
|
-
end
|
251
|
-
|
252
|
-
def test_3_Auth
|
253
|
-
customer_hash = {
|
254
|
-
'orderId' => '3',
|
255
|
-
'amount' => '30030',
|
256
|
-
'orderSource'=>'ecommerce',
|
257
|
-
'billToAddress'=>{
|
258
|
-
'name' => 'Eileen Jones',
|
259
|
-
'addressLine1' => '3 Main St.',
|
260
|
-
'city' => 'Bloomfield',
|
261
|
-
'state' => 'CT',
|
262
|
-
'zip' => '06002',
|
263
|
-
'country' => 'US'},
|
264
|
-
'card'=>{
|
265
|
-
'number' =>'6011010000000003',
|
266
|
-
'expDate' => '0312',
|
267
|
-
'type' => 'DI',
|
268
|
-
'cardValidationNum' => '758'},
|
269
|
-
}
|
270
|
-
hash = customer_hash.merge(@@merchant_hash)
|
271
|
-
auth_response = LitleOnlineRequest.new.authorization(hash)
|
272
|
-
assert_equal('000', auth_response.authorizationResponse.response)
|
273
|
-
assert_equal('Approved', auth_response.authorizationResponse.message)
|
274
|
-
assert_equal('33333', auth_response.authorizationResponse.authCode)
|
275
|
-
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
276
|
-
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
277
|
-
|
278
|
-
#test 3A
|
279
|
-
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
280
|
-
hash2a = capture_hash.merge(@@merchant_hash)
|
281
|
-
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
282
|
-
assert_equal('000', capture_response.captureResponse.response)
|
283
|
-
assert_equal('Approved', capture_response.captureResponse.message)
|
284
|
-
|
285
|
-
|
286
|
-
#test 3B
|
287
|
-
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
288
|
-
hash2b = credit_hash.merge(@@merchant_hash)
|
289
|
-
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
290
|
-
assert_equal('000', credit_response.creditResponse.response)
|
291
|
-
assert_equal('Approved', credit_response.creditResponse.message)
|
292
|
-
|
293
|
-
#test 3C
|
294
|
-
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
295
|
-
hash2c = void_hash.merge(@@merchant_hash)
|
296
|
-
void_response = LitleOnlineRequest.new.void(hash2c)
|
297
|
-
assert_equal('000', void_response.voidResponse.response)
|
298
|
-
assert_equal('Approved', void_response.voidResponse.message)
|
299
|
-
end
|
300
|
-
|
301
|
-
def test_3_Avs
|
302
|
-
customer_hash = {
|
303
|
-
'orderId' => '3',
|
304
|
-
'amount' => '000',
|
305
|
-
'orderSource'=>'ecommerce',
|
306
|
-
'billToAddress'=>{
|
307
|
-
'name' => 'Eileen Jones',
|
308
|
-
'addressLine1' => '3 Main St.',
|
309
|
-
'city' => 'Bloomfield',
|
310
|
-
'state' => 'CT',
|
311
|
-
'zip' => '06002',
|
312
|
-
'country' => 'US'},
|
313
|
-
'card'=>{
|
314
|
-
'number' =>'6011010000000003',
|
315
|
-
'expDate' => '0312',
|
316
|
-
'type' => 'DI',
|
317
|
-
'cardValidationNum' => '758'},
|
318
|
-
}
|
319
|
-
hash = customer_hash.merge(@@merchant_hash)
|
320
|
-
auth_response = LitleOnlineRequest.new.authorization(hash)
|
321
|
-
assert_equal('000', auth_response.authorizationResponse.response)
|
322
|
-
assert_equal('Approved', auth_response.authorizationResponse.message)
|
323
|
-
assert_equal('33333', auth_response.authorizationResponse.authCode)
|
324
|
-
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
325
|
-
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
326
|
-
end
|
327
|
-
|
328
|
-
def test_3_Sale
|
329
|
-
customer_hash = {
|
330
|
-
'orderId' => '3',
|
331
|
-
'amount' => '30030',
|
332
|
-
'orderSource'=>'ecommerce',
|
333
|
-
'billToAddress'=>{
|
334
|
-
'name' => 'Eileen Jones',
|
335
|
-
'addressLine1' => '3 Main St.',
|
336
|
-
'city' => 'Bloomfield',
|
337
|
-
'state' => 'CT',
|
338
|
-
'zip' => '06002',
|
339
|
-
'country' => 'US'},
|
340
|
-
'card'=>{
|
341
|
-
'number' =>'6011010000000003',
|
342
|
-
'expDate' => '0312',
|
343
|
-
'type' => 'DI',
|
344
|
-
'cardValidationNum' => '758'},
|
345
|
-
}
|
346
|
-
hash = customer_hash.merge(@@merchant_hash)
|
208
|
+
def test_2_sale
|
209
|
+
customer_hash = {
|
210
|
+
'orderId' => '2',
|
211
|
+
'amount' => '20020',
|
212
|
+
'orderSource'=>'ecommerce',
|
213
|
+
'billToAddress'=>{
|
214
|
+
'name' => 'Mike J. Hammer',
|
215
|
+
'addressLine1' => '2 Main St.',
|
216
|
+
'addressLine2' => 'Apt. 222',
|
217
|
+
'city' => 'Riverside',
|
218
|
+
'state' => 'RI',
|
219
|
+
'zip' => '02915',
|
220
|
+
'country' => 'US'},
|
221
|
+
'card'=>{
|
222
|
+
'number' =>'5112010000000003',
|
223
|
+
'expDate' => '0212',
|
224
|
+
'cardValidationNum' => '261',
|
225
|
+
'type' => 'MC'
|
226
|
+
},
|
227
|
+
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
228
|
+
}
|
229
|
+
hash = customer_hash.merge(@@merchant_hash)
|
347
230
|
sale_response = LitleOnlineRequest.new.sale(hash)
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
231
|
+
assert_equal('000', sale_response.saleResponse.response)
|
232
|
+
assert_equal('Approved', sale_response.saleResponse.message)
|
233
|
+
assert_equal('22222', sale_response.saleResponse.authCode)
|
234
|
+
assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
|
235
|
+
assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
|
236
|
+
|
237
|
+
#test 2B
|
238
|
+
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
239
|
+
hash2b = credit_hash.merge(@@merchant_hash)
|
240
|
+
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
241
|
+
assert_equal('000', credit_response.creditResponse.response)
|
242
|
+
assert_equal('Approved', credit_response.creditResponse.message)
|
243
|
+
|
244
|
+
#test 2C
|
245
|
+
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
246
|
+
hash2c = void_hash.merge(@@merchant_hash)
|
247
|
+
void_response = LitleOnlineRequest.new.void(hash2c)
|
248
|
+
assert_equal('000', void_response.voidResponse.response)
|
249
|
+
assert_equal('Approved', void_response.voidResponse.message)
|
250
|
+
end
|
251
|
+
|
252
|
+
def test_3_auth
|
253
|
+
customer_hash = {
|
254
|
+
'orderId' => '3',
|
255
|
+
'amount' => '30030',
|
256
|
+
'orderSource'=>'ecommerce',
|
257
|
+
'billToAddress'=>{
|
258
|
+
'name' => 'Eileen Jones',
|
259
|
+
'addressLine1' => '3 Main St.',
|
260
|
+
'city' => 'Bloomfield',
|
261
|
+
'state' => 'CT',
|
262
|
+
'zip' => '06002',
|
263
|
+
'country' => 'US'},
|
264
|
+
'card'=>{
|
265
|
+
'number' =>'6011010000000003',
|
266
|
+
'expDate' => '0312',
|
267
|
+
'type' => 'DI',
|
268
|
+
'cardValidationNum' => '758'},
|
269
|
+
}
|
270
|
+
hash = customer_hash.merge(@@merchant_hash)
|
271
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
272
|
+
assert_equal('000', auth_response.authorizationResponse.response)
|
273
|
+
assert_equal('Approved', auth_response.authorizationResponse.message)
|
274
|
+
assert_equal('33333', auth_response.authorizationResponse.authCode)
|
275
|
+
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
276
|
+
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
277
|
+
|
278
|
+
#test 3A
|
279
|
+
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
280
|
+
hash2a = capture_hash.merge(@@merchant_hash)
|
281
|
+
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
282
|
+
assert_equal('000', capture_response.captureResponse.response)
|
283
|
+
assert_equal('Approved', capture_response.captureResponse.message)
|
284
|
+
|
285
|
+
#test 3B
|
286
|
+
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
287
|
+
hash2b = credit_hash.merge(@@merchant_hash)
|
288
|
+
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
289
|
+
assert_equal('000', credit_response.creditResponse.response)
|
290
|
+
assert_equal('Approved', credit_response.creditResponse.message)
|
291
|
+
|
292
|
+
#test 3C
|
293
|
+
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
294
|
+
hash2c = void_hash.merge(@@merchant_hash)
|
295
|
+
void_response = LitleOnlineRequest.new.void(hash2c)
|
296
|
+
assert_equal('000', void_response.voidResponse.response)
|
297
|
+
assert_equal('Approved', void_response.voidResponse.message)
|
298
|
+
end
|
299
|
+
|
300
|
+
def test_3_avs
|
301
|
+
customer_hash = {
|
302
|
+
'orderId' => '3',
|
303
|
+
'amount' => '000',
|
304
|
+
'orderSource'=>'ecommerce',
|
305
|
+
'billToAddress'=>{
|
306
|
+
'name' => 'Eileen Jones',
|
307
|
+
'addressLine1' => '3 Main St.',
|
308
|
+
'city' => 'Bloomfield',
|
309
|
+
'state' => 'CT',
|
310
|
+
'zip' => '06002',
|
311
|
+
'country' => 'US'},
|
312
|
+
'card'=>{
|
313
|
+
'number' =>'6011010000000003',
|
314
|
+
'expDate' => '0312',
|
315
|
+
'type' => 'DI',
|
316
|
+
'cardValidationNum' => '758'},
|
317
|
+
}
|
318
|
+
hash = customer_hash.merge(@@merchant_hash)
|
319
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
320
|
+
assert_equal('000', auth_response.authorizationResponse.response)
|
321
|
+
assert_equal('Approved', auth_response.authorizationResponse.message)
|
322
|
+
assert_equal('33333', auth_response.authorizationResponse.authCode)
|
323
|
+
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
324
|
+
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
325
|
+
end
|
326
|
+
|
327
|
+
def test_3_sale
|
328
|
+
customer_hash = {
|
329
|
+
'orderId' => '3',
|
330
|
+
'amount' => '30030',
|
331
|
+
'orderSource'=>'ecommerce',
|
332
|
+
'billToAddress'=>{
|
333
|
+
'name' => 'Eileen Jones',
|
334
|
+
'addressLine1' => '3 Main St.',
|
335
|
+
'city' => 'Bloomfield',
|
336
|
+
'state' => 'CT',
|
337
|
+
'zip' => '06002',
|
338
|
+
'country' => 'US'},
|
339
|
+
'card'=>{
|
340
|
+
'number' =>'6011010000000003',
|
341
|
+
'expDate' => '0312',
|
342
|
+
'type' => 'DI',
|
343
|
+
'cardValidationNum' => '758'},
|
344
|
+
}
|
345
|
+
hash = customer_hash.merge(@@merchant_hash)
|
346
|
+
sale_response = LitleOnlineRequest.new.sale(hash)
|
347
|
+
assert_equal('000', sale_response.saleResponse.response)
|
348
|
+
assert_equal('Approved', sale_response.saleResponse.message)
|
349
|
+
assert_equal('33333', sale_response.saleResponse.authCode)
|
350
|
+
assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
|
351
|
+
assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
|
352
|
+
|
353
|
+
#test 3B
|
354
|
+
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
355
|
+
hash2b = credit_hash.merge(@@merchant_hash)
|
356
|
+
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
357
|
+
assert_equal('000', credit_response.creditResponse.response)
|
358
|
+
assert_equal('Approved', credit_response.creditResponse.message)
|
359
|
+
|
360
|
+
#test 3C
|
361
|
+
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
362
|
+
hash2c = void_hash.merge(@@merchant_hash)
|
363
|
+
void_response = LitleOnlineRequest.new.void(hash2c)
|
364
|
+
assert_equal('000', void_response.voidResponse.response)
|
365
|
+
assert_equal('Approved', void_response.voidResponse.message)
|
366
|
+
end
|
367
|
+
|
368
|
+
def test_4_auth
|
369
|
+
customer_hash = {
|
370
|
+
'orderId' => '4',
|
371
|
+
'amount' => '40040',
|
372
|
+
'orderSource'=>'ecommerce',
|
373
|
+
'billToAddress'=>{
|
374
|
+
'name' => 'Bob Black',
|
375
|
+
'addressLine1' => '4 Main St.',
|
376
|
+
'city' => 'Laurel',
|
377
|
+
'state' => 'MD',
|
378
|
+
'zip' => '20708',
|
379
|
+
'country' => 'US'},
|
380
|
+
'card'=>{
|
381
|
+
'number' =>'375001000000005',
|
382
|
+
'expDate' => '0412',
|
383
|
+
'type' => 'AX'
|
384
|
+
},
|
385
|
+
}
|
386
|
+
hash = customer_hash.merge(@@merchant_hash)
|
387
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
388
|
+
assert_equal('000', auth_response.authorizationResponse.response)
|
389
|
+
assert_equal('Approved', auth_response.authorizationResponse.message)
|
390
|
+
assert_equal('44444', auth_response.authorizationResponse.authCode)
|
391
|
+
assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
|
392
|
+
|
393
|
+
#test 4A
|
394
|
+
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
395
|
+
hash2a = capture_hash.merge(@@merchant_hash)
|
396
|
+
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
397
|
+
assert_equal('Approved', capture_response.captureResponse.message)
|
398
|
+
|
399
|
+
#test 4B
|
400
|
+
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
401
|
+
hash2b = credit_hash.merge(@@merchant_hash)
|
402
|
+
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
403
|
+
assert_equal('000', credit_response.creditResponse.response)
|
404
|
+
assert_equal('Approved', credit_response.creditResponse.message)
|
405
|
+
|
406
|
+
#test 4C
|
407
|
+
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
408
|
+
hash2c = void_hash.merge(@@merchant_hash)
|
409
|
+
void_response = LitleOnlineRequest.new.void(hash2c)
|
410
|
+
assert_equal('000', void_response.voidResponse.response)
|
411
|
+
assert_equal('Approved', void_response.voidResponse.message)
|
412
|
+
end
|
413
|
+
|
414
|
+
def test_4_avs
|
417
415
|
customer_hash = {
|
418
416
|
'orderId' => '4',
|
419
417
|
'amount' => '000',
|
@@ -438,8 +436,8 @@ class Litle_certTest < Test::Unit::TestCase
|
|
438
436
|
assert_equal('44444', auth_response.authorizationResponse.authCode)
|
439
437
|
assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
|
440
438
|
end
|
441
|
-
|
442
|
-
def
|
439
|
+
|
440
|
+
def test_4_sale
|
443
441
|
customer_hash = {
|
444
442
|
'orderId' => '4',
|
445
443
|
'amount' => '40040',
|
@@ -479,131 +477,131 @@ class Litle_certTest < Test::Unit::TestCase
|
|
479
477
|
assert_equal('Approved', void_response.voidResponse.message)
|
480
478
|
end
|
481
479
|
|
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
|
-
def
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
def
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
def
|
480
|
+
def test_5_auth
|
481
|
+
customer_hash = {
|
482
|
+
'orderId' => '5',
|
483
|
+
'amount' => '50050',
|
484
|
+
'orderSource'=>'ecommerce',
|
485
|
+
'card'=>{
|
486
|
+
'number' =>'4457010200000007',
|
487
|
+
'expDate' => '0512',
|
488
|
+
'cardValidationNum' => '463',
|
489
|
+
'type' => 'VI'},
|
490
|
+
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
491
|
+
}
|
492
|
+
hash = customer_hash.merge(@@merchant_hash)
|
493
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
494
|
+
assert_equal('000', auth_response.authorizationResponse.response)
|
495
|
+
assert_equal('Approved', auth_response.authorizationResponse.message)
|
496
|
+
assert_equal('55555 ', auth_response.authorizationResponse.authCode)
|
497
|
+
assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
|
498
|
+
assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
499
|
+
|
500
|
+
#test 5A
|
501
|
+
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
502
|
+
hash2a = capture_hash.merge(@@merchant_hash)
|
503
|
+
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
504
|
+
assert_equal('000', capture_response.captureResponse.response)
|
505
|
+
assert_equal('Approved', capture_response.captureResponse.message)
|
506
|
+
|
507
|
+
#test 5B
|
508
|
+
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
509
|
+
hash2b = credit_hash.merge(@@merchant_hash)
|
510
|
+
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
511
|
+
assert_equal('000', credit_response.creditResponse.response)
|
512
|
+
assert_equal('Approved', credit_response.creditResponse.message)
|
513
|
+
|
514
|
+
#test 5C
|
515
|
+
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
516
|
+
hash2c = void_hash.merge(@@merchant_hash)
|
517
|
+
void_response = LitleOnlineRequest.new.void(hash2c)
|
518
|
+
assert_equal('000', void_response.voidResponse.response)
|
519
|
+
assert_equal('Approved', void_response.voidResponse.message)
|
520
|
+
end
|
521
|
+
|
522
|
+
def test_5_avs
|
523
|
+
customer_hash = {
|
524
|
+
'orderId' => '5',
|
525
|
+
'amount' => '000',
|
526
|
+
'orderSource'=>'ecommerce',
|
527
|
+
'card'=>{
|
528
|
+
'number' =>'4457010200000007',
|
529
|
+
'expDate' => '0512',
|
530
|
+
'cardValidationNum' => '463',
|
531
|
+
'type' => 'VI'},
|
532
|
+
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
533
|
+
}
|
534
|
+
hash = customer_hash.merge(@@merchant_hash)
|
535
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
536
|
+
assert_equal('000', auth_response.authorizationResponse.response)
|
537
|
+
assert_equal('Approved', auth_response.authorizationResponse.message)
|
538
|
+
assert_equal('55555 ', auth_response.authorizationResponse.authCode)
|
539
|
+
assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
|
540
|
+
assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
541
|
+
end
|
542
|
+
|
543
|
+
def test_5_sale
|
544
|
+
customer_hash = {
|
545
|
+
'orderId' => '5',
|
546
|
+
'amount' => '50050',
|
547
|
+
'orderSource'=>'ecommerce',
|
548
|
+
'card'=>{
|
549
|
+
'number' =>'4457010200000007',
|
550
|
+
'expDate' => '0512',
|
551
|
+
'cardValidationNum' => '463',
|
552
|
+
'type' => 'VI'},
|
553
|
+
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
554
|
+
}
|
555
|
+
hash = customer_hash.merge(@@merchant_hash)
|
556
|
+
sale_response = LitleOnlineRequest.new.sale(hash)
|
557
|
+
assert_equal('000', sale_response.saleResponse.response)
|
558
|
+
assert_equal('Approved', sale_response.saleResponse.message)
|
559
|
+
assert_equal('55555 ', sale_response.saleResponse.authCode)
|
560
|
+
assert_equal('32', sale_response.saleResponse.fraudResult.avsResult)
|
561
|
+
assert_equal('N', sale_response.saleResponse.fraudResult.cardValidationResult)
|
562
|
+
|
563
|
+
#test 5B
|
564
|
+
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
565
|
+
hash2b = credit_hash.merge(@@merchant_hash)
|
566
|
+
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
567
|
+
assert_equal('000', credit_response.creditResponse.response)
|
568
|
+
assert_equal('Approved', credit_response.creditResponse.message)
|
569
|
+
|
570
|
+
#test 5C
|
571
|
+
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
572
|
+
hash2c = void_hash.merge(@@merchant_hash)
|
573
|
+
void_response = LitleOnlineRequest.new.void(hash2c)
|
574
|
+
assert_equal('000', void_response.voidResponse.response)
|
575
|
+
assert_equal('Approved', void_response.voidResponse.message)
|
576
|
+
end
|
577
|
+
|
578
|
+
def test_6_auth
|
579
|
+
customer_hash = {
|
580
|
+
'orderId' => '6',
|
581
|
+
'amount' => '60060',
|
582
|
+
'orderSource'=>'ecommerce',
|
583
|
+
'billToAddress'=>{
|
584
|
+
'name' => 'Joe Green',
|
585
|
+
'addressLine1' => '6 Main St.',
|
586
|
+
'city' => 'Derry',
|
587
|
+
'state' => 'NH',
|
588
|
+
'zip' => '03038',
|
589
|
+
'country' => 'US'},
|
590
|
+
'card'=>{
|
591
|
+
'number' =>'4457010100000008',
|
592
|
+
'expDate' => '0612',
|
593
|
+
'type' => 'VI',
|
594
|
+
'cardValidationNum' => '992'}
|
595
|
+
}
|
596
|
+
hash = customer_hash.merge(@@merchant_hash)
|
597
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
598
|
+
assert_equal('110', auth_response.authorizationResponse.response)
|
599
|
+
assert_equal('Insufficient Funds', auth_response.authorizationResponse.message)
|
600
|
+
assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
|
601
|
+
assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
602
|
+
end
|
603
|
+
|
604
|
+
def test_6_sale
|
607
605
|
customer_hash = {
|
608
606
|
'orderId' => '6',
|
609
607
|
'amount' => '60060',
|
@@ -636,34 +634,33 @@ class Litle_certTest < Test::Unit::TestCase
|
|
636
634
|
assert_equal('No transaction found with specified litleTxnId', void_response.voidResponse.message)
|
637
635
|
end
|
638
636
|
|
637
|
+
def test_7_auth
|
638
|
+
customer_hash = {
|
639
|
+
'orderId' => '7',
|
640
|
+
'amount' => '70070',
|
641
|
+
'orderSource'=>'ecommerce',
|
642
|
+
'billToAddress'=>{
|
643
|
+
'name' => 'Jane Murray',
|
644
|
+
'addressLine1' => '7 Main St.',
|
645
|
+
'city' => 'Amesbury',
|
646
|
+
'state' => 'MA',
|
647
|
+
'zip' => '01913',
|
648
|
+
'country' => 'US'},
|
649
|
+
'card'=>{
|
650
|
+
'number' =>'5112010100000002',
|
651
|
+
'expDate' => '0712',
|
652
|
+
'cardValidationNum' => '251',
|
653
|
+
'type' => 'MC'}
|
654
|
+
}
|
655
|
+
hash = customer_hash.merge(@@merchant_hash)
|
656
|
+
authorization_response = LitleOnlineRequest.new.authorization(hash)
|
657
|
+
assert_equal('301', authorization_response.authorizationResponse.response)
|
658
|
+
assert_equal('Invalid Account Number', authorization_response.authorizationResponse.message)
|
659
|
+
assert_equal('34', authorization_response.authorizationResponse.fraudResult.avsResult)
|
660
|
+
assert_equal('N', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
|
661
|
+
end
|
639
662
|
|
640
|
-
|
641
|
-
customer_hash = {
|
642
|
-
'orderId' => '7',
|
643
|
-
'amount' => '70070',
|
644
|
-
'orderSource'=>'ecommerce',
|
645
|
-
'billToAddress'=>{
|
646
|
-
'name' => 'Jane Murray',
|
647
|
-
'addressLine1' => '7 Main St.',
|
648
|
-
'city' => 'Amesbury',
|
649
|
-
'state' => 'MA',
|
650
|
-
'zip' => '01913',
|
651
|
-
'country' => 'US'},
|
652
|
-
'card'=>{
|
653
|
-
'number' =>'5112010100000002',
|
654
|
-
'expDate' => '0712',
|
655
|
-
'cardValidationNum' => '251',
|
656
|
-
'type' => 'MC'}
|
657
|
-
}
|
658
|
-
hash = customer_hash.merge(@@merchant_hash)
|
659
|
-
authorization_response = LitleOnlineRequest.new.authorization(hash)
|
660
|
-
assert_equal('301', authorization_response.authorizationResponse.response)
|
661
|
-
assert_equal('Invalid Account Number', authorization_response.authorizationResponse.message)
|
662
|
-
assert_equal('34', authorization_response.authorizationResponse.fraudResult.avsResult)
|
663
|
-
assert_equal('N', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
|
664
|
-
end
|
665
|
-
|
666
|
-
def test_7_Avs
|
663
|
+
def test_7_avs
|
667
664
|
customer_hash = {
|
668
665
|
'orderId' => '7',
|
669
666
|
'amount' => '000',
|
@@ -715,33 +712,33 @@ class Litle_certTest < Test::Unit::TestCase
|
|
715
712
|
assert_equal('N', sale_response.saleResponse.fraudResult.cardValidationResult)
|
716
713
|
end
|
717
714
|
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
def
|
715
|
+
def test_8_auth
|
716
|
+
customer_hash = {
|
717
|
+
'orderId' => '8',
|
718
|
+
'amount' => '80080',
|
719
|
+
'orderSource'=>'ecommerce',
|
720
|
+
'billToAddress'=>{
|
721
|
+
'name' => 'Mark Johnson',
|
722
|
+
'addressLine1' => '8 Main St.',
|
723
|
+
'city' => 'Manchester',
|
724
|
+
'state' => 'NH',
|
725
|
+
'zip' => '03101',
|
726
|
+
'country' => 'US'},
|
727
|
+
'card'=>{
|
728
|
+
'number' =>'6011010100000002',
|
729
|
+
'expDate' => '0812',
|
730
|
+
'type' => 'DI',
|
731
|
+
'cardValidationNum' => '184'}
|
732
|
+
}
|
733
|
+
hash = customer_hash.merge(@@merchant_hash)
|
734
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
735
|
+
assert_equal('123', auth_response.authorizationResponse.response)
|
736
|
+
assert_equal('Call Discover', auth_response.authorizationResponse.message)
|
737
|
+
assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
738
|
+
assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
|
739
|
+
end
|
740
|
+
|
741
|
+
def test_8_avs
|
745
742
|
customer_hash = {
|
746
743
|
'orderId' => '8',
|
747
744
|
'amount' => '000',
|
@@ -767,7 +764,7 @@ class Litle_certTest < Test::Unit::TestCase
|
|
767
764
|
assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
|
768
765
|
end
|
769
766
|
|
770
|
-
def
|
767
|
+
def test_8_sale
|
771
768
|
customer_hash = {
|
772
769
|
'orderId' => '8',
|
773
770
|
'amount' => '80080',
|
@@ -793,140 +790,139 @@ class Litle_certTest < Test::Unit::TestCase
|
|
793
790
|
assert_equal('34', sale_response.saleResponse.fraudResult.avsResult)
|
794
791
|
end
|
795
792
|
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
793
|
+
def test_9_auth
|
794
|
+
customer_hash = {
|
795
|
+
'orderId' => '9',
|
796
|
+
'amount' => '90090',
|
797
|
+
'orderSource'=>'ecommerce',
|
798
|
+
'billToAddress'=>{
|
799
|
+
'name' => 'James Miller',
|
800
|
+
'addressLine1' => '9 Main St.',
|
801
|
+
'city' => 'Boston',
|
802
|
+
'state' => 'MA',
|
803
|
+
'zip' => '02134',
|
804
|
+
'country' => 'US'},
|
805
|
+
'card'=>{
|
806
|
+
'number' =>'375001010000003',
|
807
|
+
'expDate' => '0912',
|
808
|
+
'cardValidationNum' => '0421',
|
809
|
+
'type' => 'AX'
|
810
|
+
}
|
811
|
+
}
|
812
|
+
hash = customer_hash.merge(@@merchant_hash)
|
813
|
+
response = LitleOnlineRequest.new.authorization(hash)
|
814
|
+
assert_equal('303', response.authorizationResponse.response)
|
815
|
+
assert_equal('Pick Up Card', response.authorizationResponse.message)
|
816
|
+
assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
|
817
|
+
end
|
818
|
+
|
822
819
|
def test_9_avs
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
820
|
+
customer_hash = {
|
821
|
+
'orderId' => '9',
|
822
|
+
'amount' => '000',
|
823
|
+
'orderSource'=>'ecommerce',
|
824
|
+
'billToAddress'=>{
|
825
|
+
'name' => 'James Miller',
|
826
|
+
'addressLine1' => '9 Main St.',
|
827
|
+
'city' => 'Boston',
|
828
|
+
'state' => 'MA',
|
829
|
+
'zip' => '02134',
|
830
|
+
'country' => 'US'},
|
831
|
+
'card'=>{
|
832
|
+
'number' =>'375001010000003',
|
833
|
+
'expDate' => '0912',
|
834
|
+
'cardValidationNum' => '0421',
|
835
|
+
'type' => 'AX'
|
836
|
+
}
|
837
|
+
}
|
838
|
+
hash = customer_hash.merge(@@merchant_hash)
|
839
|
+
response = LitleOnlineRequest.new.authorization(hash)
|
840
|
+
assert_equal('303', response.authorizationResponse.response)
|
841
|
+
assert_equal('Pick Up Card', response.authorizationResponse.message)
|
842
|
+
assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
|
843
|
+
end
|
847
844
|
|
848
845
|
def test_9_sale
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
end
|
846
|
+
customer_hash = {
|
847
|
+
'orderId' => '9',
|
848
|
+
'amount' => '90090',
|
849
|
+
'orderSource'=>'ecommerce',
|
850
|
+
'billToAddress'=>{
|
851
|
+
'name' => 'James Miller',
|
852
|
+
'addressLine1' => '9 Main St.',
|
853
|
+
'city' => 'Boston',
|
854
|
+
'state' => 'MA',
|
855
|
+
'zip' => '02134',
|
856
|
+
'country' => 'US'},
|
857
|
+
'card'=>{
|
858
|
+
'number' =>'375001010000003',
|
859
|
+
'expDate' => '0912',
|
860
|
+
'cardValidationNum' => '0421',
|
861
|
+
'type' => 'AX'
|
862
|
+
}
|
863
|
+
}
|
864
|
+
hash = customer_hash.merge(@@merchant_hash)
|
865
|
+
response = LitleOnlineRequest.new.sale(hash)
|
866
|
+
assert_equal('303', response.saleResponse.response)
|
867
|
+
assert_equal('Pick Up Card', response.saleResponse.message)
|
868
|
+
assert_equal('34', response.saleResponse.fraudResult.avsResult)
|
869
|
+
end
|
870
|
+
|
871
|
+
def test_10
|
872
|
+
customer_hash = {
|
873
|
+
'orderId' => '10',
|
874
|
+
'amount' => '40000',
|
875
|
+
'orderSource'=>'ecommerce',
|
876
|
+
'card'=>{
|
877
|
+
'number' =>'4457010140000141',
|
878
|
+
'expDate' => '0912',
|
879
|
+
'type' => 'VI'
|
880
|
+
},
|
881
|
+
'allowPartialAuth' => 'true'
|
882
|
+
}
|
883
|
+
hash = customer_hash.merge(@@merchant_hash)
|
884
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
885
|
+
assert_equal('010', auth_response.authorizationResponse.response)
|
886
|
+
assert_equal('Partially Approved', auth_response.authorizationResponse.message)
|
887
|
+
assert_equal('32000', auth_response.authorizationResponse.approvedAmount)
|
888
|
+
end
|
889
|
+
|
890
|
+
def test_11
|
891
|
+
customer_hash = {
|
892
|
+
'orderId' => '11',
|
893
|
+
'amount' => '60000',
|
894
|
+
'orderSource'=>'ecommerce',
|
895
|
+
'card'=>{
|
896
|
+
'number' =>'5112010140000004',
|
897
|
+
'expDate' => '1111',
|
898
|
+
'type' => 'MC'
|
899
|
+
},
|
900
|
+
'allowPartialAuth' => 'true'
|
901
|
+
}
|
902
|
+
hash = customer_hash.merge(@@merchant_hash)
|
903
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
904
|
+
assert_equal('010', auth_response.authorizationResponse.response)
|
905
|
+
assert_equal('Partially Approved', auth_response.authorizationResponse.message)
|
906
|
+
assert_equal('48000', auth_response.authorizationResponse.approvedAmount)
|
907
|
+
end
|
908
|
+
|
909
|
+
def test_12
|
910
|
+
customer_hash = {
|
911
|
+
'orderId' => '12',
|
912
|
+
'amount' => '50000',
|
913
|
+
'orderSource'=>'ecommerce',
|
914
|
+
'card'=>{
|
915
|
+
'number' =>'375001014000009',
|
916
|
+
'expDate' => '0412',
|
917
|
+
'type' => 'AX'},
|
918
|
+
'allowPartialAuth' => 'true'
|
919
|
+
}
|
920
|
+
hash = customer_hash.merge(@@merchant_hash)
|
921
|
+
auth_response = LitleOnlineRequest.new.authorization(hash)
|
922
|
+
assert_equal('010', auth_response.authorizationResponse.response)
|
923
|
+
assert_equal('Partially Approved', auth_response.authorizationResponse.message)
|
924
|
+
assert_equal('40000', auth_response.authorizationResponse.approvedAmount)
|
925
|
+
end
|
930
926
|
|
931
927
|
def test_13
|
932
928
|
customer_hash = {
|