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.
Files changed (38) hide show
  1. data/Rakefile +1 -1
  2. data/lib/Communications.rb +3 -4
  3. data/lib/Configuration.rb +1 -1
  4. data/lib/LitleOnlineRequest.rb +170 -139
  5. data/lib/XMLFields.rb +29 -29
  6. data/test/certification/certTest1_base.rb +602 -606
  7. data/test/certification/certTest2_authenhanced.rb +6 -6
  8. data/test/certification/certTest3_authreversal.rb +29 -30
  9. data/test/certification/certTest4_echeck.rb +13 -16
  10. data/test/certification/certTest5_token.rb +11 -31
  11. data/test/functional/test_auth.rb +6 -6
  12. data/test/functional/test_authReversal.rb +6 -6
  13. data/test/functional/test_capture.rb +3 -3
  14. data/test/functional/test_captureGivenAuth.rb +12 -12
  15. data/test/functional/test_credit.rb +7 -7
  16. data/test/functional/test_echeckCredit.rb +11 -11
  17. data/test/functional/test_echeckRedeposit.rb +8 -8
  18. data/test/functional/test_echeckSale.rb +34 -32
  19. data/test/functional/test_echeckVerification.rb +8 -8
  20. data/test/functional/test_forceCapture.rb +8 -8
  21. data/test/functional/test_sale.rb +9 -11
  22. data/test/functional/test_token.rb +12 -12
  23. data/test/functional/test_xmlfields.rb +18 -18
  24. data/test/unit/test_LitleOnlineRequest.rb +26 -17
  25. data/test/unit/test_auth.rb +22 -10
  26. data/test/unit/test_authReversal.rb +2 -2
  27. data/test/unit/test_capture.rb +1 -1
  28. data/test/unit/test_captureGivenAuth.rb +6 -6
  29. data/test/unit/test_credit.rb +4 -7
  30. data/test/unit/test_echeckCredit.rb +2 -2
  31. data/test/unit/test_echeckRedeposit.rb +8 -8
  32. data/test/unit/test_echeckSale.rb +2 -2
  33. data/test/unit/test_echeckVerification.rb +8 -8
  34. data/test/unit/test_forceCapture.rb +8 -8
  35. data/test/unit/test_sale.rb +9 -9
  36. data/test/unit/test_token.rb +4 -4
  37. data/test/unit/test_xmlfields.rb +7 -9
  38. 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.customerInfo(hash_in)
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.billMeLaterRequest(hash_in)
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.fraudCheckType(hash_in)
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.authInformation(hash_in)
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=>fraudResult((hash_in['detailTax'] or ' ')),
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.fraudResult(hash_in)
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.healthcareAmounts(hash_in)
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.healthcareIIAS(hash_in)
142
+ def XMLFields.healthcare_iias(hash_in)
143
143
  hash_out ={
144
- :healthcareAmounts=>healthcareAmounts((hash_in['healthcareAmounts'] or ' ')),
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.detailTax(hash_in)
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.lineItemData(hash_in)
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 => detailTax((hash_in['detailTax'] or ' '))
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.enhancedData(hash_in)
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=> detailTax((hash_in['detailTax'] or ' ')),
211
- :lineItemData=> lineItemData((hash_in['lineItemData'] or ' '))
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.amexAggregatorData(hash_in)
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.cardType(hash_in)
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.cardTokenType(hash_in)
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.cardPaypageType(hash_in)
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.payPal(hash_in)
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.credit_payPal(hash_in)
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.customBilling(hash_in)
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.taxBilling(hash_in)
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.processingInstructions(hash_in)
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.echeckForTokenType(hash_in)
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.filteringType(hash_in)
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.echeckType(hash_in)
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.echeckTokenType(hash_in)
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.recyclingRequestType(hash_in)
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
- def test_1_Auth
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 test_1_Sale
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
- 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
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
- assert_equal('000', sale_response.saleResponse.response)
349
- assert_equal('Approved', sale_response.saleResponse.message)
350
- assert_equal('33333', sale_response.saleResponse.authCode)
351
- assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
352
- assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
353
-
354
- #test 3B
355
- credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
356
- hash2b = credit_hash.merge(@@merchant_hash)
357
- credit_response = LitleOnlineRequest.new.credit(hash2b)
358
- assert_equal('000', credit_response.creditResponse.response)
359
- assert_equal('Approved', credit_response.creditResponse.message)
360
-
361
- #test 3C
362
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
363
- hash2c = void_hash.merge(@@merchant_hash)
364
- void_response = LitleOnlineRequest.new.void(hash2c)
365
- assert_equal('000', void_response.voidResponse.response)
366
- assert_equal('Approved', void_response.voidResponse.message)
367
- end
368
-
369
- def test_4_Auth
370
- customer_hash = {
371
- 'orderId' => '4',
372
- 'amount' => '40040',
373
- 'orderSource'=>'ecommerce',
374
- 'billToAddress'=>{
375
- 'name' => 'Bob Black',
376
- 'addressLine1' => '4 Main St.',
377
- 'city' => 'Laurel',
378
- 'state' => 'MD',
379
- 'zip' => '20708',
380
- 'country' => 'US'},
381
- 'card'=>{
382
- 'number' =>'375001000000005',
383
- 'expDate' => '0412',
384
- 'type' => 'AX'
385
- },
386
- }
387
- hash = customer_hash.merge(@@merchant_hash)
388
- auth_response = LitleOnlineRequest.new.authorization(hash)
389
- assert_equal('000', auth_response.authorizationResponse.response)
390
- assert_equal('Approved', auth_response.authorizationResponse.message)
391
- assert_equal('44444', auth_response.authorizationResponse.authCode)
392
- assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
393
-
394
- #test 4A
395
- capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
396
- hash2a = capture_hash.merge(@@merchant_hash)
397
- capture_response = LitleOnlineRequest.new.capture(hash2a)
398
- #assert_equal('000', cardholderAuthenticationcapture_response.captureResponse.response)
399
- assert_equal('Approved', capture_response.captureResponse.message)
400
-
401
- #test 4B
402
- credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
403
- hash2b = credit_hash.merge(@@merchant_hash)
404
- credit_response = LitleOnlineRequest.new.credit(hash2b)
405
- assert_equal('000', credit_response.creditResponse.response)
406
- assert_equal('Approved', credit_response.creditResponse.message)
407
-
408
- #test 4C
409
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
410
- hash2c = void_hash.merge(@@merchant_hash)
411
- void_response = LitleOnlineRequest.new.void(hash2c)
412
- assert_equal('000', void_response.voidResponse.response)
413
- assert_equal('Approved', void_response.voidResponse.message)
414
- end
415
-
416
- def test_4_Avs
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 test_4_Sale
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
- def test_5_Auth
483
- customer_hash = {
484
- 'orderId' => '5',
485
- 'amount' => '50050',
486
- 'orderSource'=>'ecommerce',
487
- 'card'=>{
488
- 'number' =>'4457010200000007',
489
- 'expDate' => '0512',
490
- 'cardValidationNum' => '463',
491
- 'type' => 'VI'},
492
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
493
- }
494
- hash = customer_hash.merge(@@merchant_hash)
495
- auth_response = LitleOnlineRequest.new.authorization(hash)
496
- assert_equal('000', auth_response.authorizationResponse.response)
497
- assert_equal('Approved', auth_response.authorizationResponse.message)
498
- assert_equal('55555 ', auth_response.authorizationResponse.authCode)
499
- assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
500
- assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
501
-
502
- #test 5A
503
- capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
504
- hash2a = capture_hash.merge(@@merchant_hash)
505
- capture_response = LitleOnlineRequest.new.capture(hash2a)
506
- assert_equal('000', capture_response.captureResponse.response)
507
- assert_equal('Approved', capture_response.captureResponse.message)
508
-
509
- #test 5B
510
- credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
511
- hash2b = credit_hash.merge(@@merchant_hash)
512
- credit_response = LitleOnlineRequest.new.credit(hash2b)
513
- assert_equal('000', credit_response.creditResponse.response)
514
- assert_equal('Approved', credit_response.creditResponse.message)
515
-
516
- #test 5C
517
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
518
- hash2c = void_hash.merge(@@merchant_hash)
519
- void_response = LitleOnlineRequest.new.void(hash2c)
520
- assert_equal('000', void_response.voidResponse.response)
521
- assert_equal('Approved', void_response.voidResponse.message)
522
- end
523
-
524
- def test_5_Avs
525
- customer_hash = {
526
- 'orderId' => '5',
527
- 'amount' => '000',
528
- 'orderSource'=>'ecommerce',
529
- 'card'=>{
530
- 'number' =>'4457010200000007',
531
- 'expDate' => '0512',
532
- 'cardValidationNum' => '463',
533
- 'type' => 'VI'},
534
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
535
- }
536
- hash = customer_hash.merge(@@merchant_hash)
537
- auth_response = LitleOnlineRequest.new.authorization(hash)
538
- assert_equal('000', auth_response.authorizationResponse.response)
539
- assert_equal('Approved', auth_response.authorizationResponse.message)
540
- assert_equal('55555 ', auth_response.authorizationResponse.authCode)
541
- assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
542
- assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
543
- end
544
-
545
- def test_5_Sale
546
- customer_hash = {
547
- 'orderId' => '5',
548
- 'amount' => '50050',
549
- 'orderSource'=>'ecommerce',
550
- 'card'=>{
551
- 'number' =>'4457010200000007',
552
- 'expDate' => '0512',
553
- 'cardValidationNum' => '463',
554
- 'type' => 'VI'},
555
- 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
556
- }
557
- hash = customer_hash.merge(@@merchant_hash)
558
- sale_response = LitleOnlineRequest.new.sale(hash)
559
- assert_equal('000', sale_response.saleResponse.response)
560
- assert_equal('Approved', sale_response.saleResponse.message)
561
- assert_equal('55555 ', sale_response.saleResponse.authCode)
562
- assert_equal('32', sale_response.saleResponse.fraudResult.avsResult)
563
- assert_equal('N', sale_response.saleResponse.fraudResult.cardValidationResult)
564
-
565
- #test 5B
566
- credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
567
- hash2b = credit_hash.merge(@@merchant_hash)
568
- credit_response = LitleOnlineRequest.new.credit(hash2b)
569
- assert_equal('000', credit_response.creditResponse.response)
570
- assert_equal('Approved', credit_response.creditResponse.message)
571
-
572
- #test 5C
573
- void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
574
- hash2c = void_hash.merge(@@merchant_hash)
575
- void_response = LitleOnlineRequest.new.void(hash2c)
576
- assert_equal('000', void_response.voidResponse.response)
577
- assert_equal('Approved', void_response.voidResponse.message)
578
- end
579
-
580
- def test_6_Auth
581
- customer_hash = {
582
- 'orderId' => '6',
583
- 'amount' => '60060',
584
- 'orderSource'=>'ecommerce',
585
- 'billToAddress'=>{
586
- 'name' => 'Joe Green',
587
- 'addressLine1' => '6 Main St.',
588
- 'city' => 'Derry',
589
- 'state' => 'NH',
590
- 'zip' => '03038',
591
- 'country' => 'US'},
592
- 'card'=>{
593
- 'number' =>'4457010100000008',
594
- 'expDate' => '0612',
595
- 'type' => 'VI',
596
- 'cardValidationNum' => '992'}
597
- }
598
- hash = customer_hash.merge(@@merchant_hash)
599
- auth_response = LitleOnlineRequest.new.authorization(hash)
600
- assert_equal('110', auth_response.authorizationResponse.response)
601
- assert_equal('Insufficient Funds', auth_response.authorizationResponse.message)
602
- assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
603
- assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
604
- end
605
-
606
- def test_6_Sale
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
- def test_7_Auth
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
- def test_8_Auth
719
- customer_hash = {
720
- 'orderId' => '8',
721
- 'amount' => '80080',
722
- 'orderSource'=>'ecommerce',
723
- 'billToAddress'=>{
724
- 'name' => 'Mark Johnson',
725
- 'addressLine1' => '8 Main St.',
726
- 'city' => 'Manchester',
727
- 'state' => 'NH',
728
- 'zip' => '03101',
729
- 'country' => 'US'},
730
- 'card'=>{
731
- 'number' =>'6011010100000002',
732
- 'expDate' => '0812',
733
- 'type' => 'DI',
734
- 'cardValidationNum' => '184'}
735
- }
736
- hash = customer_hash.merge(@@merchant_hash)
737
- auth_response = LitleOnlineRequest.new.authorization(hash)
738
- assert_equal('123', auth_response.authorizationResponse.response)
739
- assert_equal('Call Discover', auth_response.authorizationResponse.message)
740
- assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
741
- assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
742
- end
743
-
744
- def test_8_Avs
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 test_8_Sale
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
- def test_9_auth
797
- customer_hash = {
798
- 'orderId' => '9',
799
- 'amount' => '90090',
800
- 'orderSource'=>'ecommerce',
801
- 'billToAddress'=>{
802
- 'name' => 'James Miller',
803
- 'addressLine1' => '9 Main St.',
804
- 'city' => 'Boston',
805
- 'state' => 'MA',
806
- 'zip' => '02134',
807
- 'country' => 'US'},
808
- 'card'=>{
809
- 'number' =>'375001010000003',
810
- 'expDate' => '0912',
811
- 'cardValidationNum' => '0421',
812
- 'type' => 'AX'
813
- }
814
- }
815
- hash = customer_hash.merge(@@merchant_hash)
816
- response = LitleOnlineRequest.new.authorization(hash)
817
- assert_equal('303', response.authorizationResponse.response)
818
- assert_equal('Pick Up Card', response.authorizationResponse.message)
819
- assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
820
- end
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
- customer_hash = {
824
- 'orderId' => '9',
825
- 'amount' => '000',
826
- 'orderSource'=>'ecommerce',
827
- 'billToAddress'=>{
828
- 'name' => 'James Miller',
829
- 'addressLine1' => '9 Main St.',
830
- 'city' => 'Boston',
831
- 'state' => 'MA',
832
- 'zip' => '02134',
833
- 'country' => 'US'},
834
- 'card'=>{
835
- 'number' =>'375001010000003',
836
- 'expDate' => '0912',
837
- 'cardValidationNum' => '0421',
838
- 'type' => 'AX'
839
- }
840
- }
841
- hash = customer_hash.merge(@@merchant_hash)
842
- response = LitleOnlineRequest.new.authorization(hash)
843
- assert_equal('303', response.authorizationResponse.response)
844
- assert_equal('Pick Up Card', response.authorizationResponse.message)
845
- assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
846
- end
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
- customer_hash = {
850
- 'orderId' => '9',
851
- 'amount' => '90090',
852
- 'orderSource'=>'ecommerce',
853
- 'billToAddress'=>{
854
- 'name' => 'James Miller',
855
- 'addressLine1' => '9 Main St.',
856
- 'city' => 'Boston',
857
- 'state' => 'MA',
858
- 'zip' => '02134',
859
- 'country' => 'US'},
860
- 'card'=>{
861
- 'number' =>'375001010000003',
862
- 'expDate' => '0912',
863
- 'cardValidationNum' => '0421',
864
- 'type' => 'AX'
865
- }
866
- }
867
- hash = customer_hash.merge(@@merchant_hash)
868
- response = LitleOnlineRequest.new.sale(hash)
869
- assert_equal('303', response.saleResponse.response)
870
- assert_equal('Pick Up Card', response.saleResponse.message)
871
- assert_equal('34', response.saleResponse.fraudResult.avsResult)
872
- end
873
-
874
-
875
- def test_10
876
- customer_hash = {
877
- 'orderId' => '10',
878
- 'amount' => '40000',
879
- 'orderSource'=>'ecommerce',
880
- 'card'=>{
881
- 'number' =>'4457010140000141',
882
- 'expDate' => '0912',
883
- 'type' => 'VI'
884
- },
885
- 'allowPartialAuth' => 'true'
886
- }
887
- hash = customer_hash.merge(@@merchant_hash)
888
- auth_response = LitleOnlineRequest.new.authorization(hash)
889
- assert_equal('010', auth_response.authorizationResponse.response)
890
- assert_equal('Partially Approved', auth_response.authorizationResponse.message)
891
- assert_equal('32000', auth_response.authorizationResponse.approvedAmount)
892
- end
893
-
894
- def test_11
895
- customer_hash = {
896
- 'orderId' => '11',
897
- 'amount' => '60000',
898
- 'orderSource'=>'ecommerce',
899
- 'card'=>{
900
- 'number' =>'5112010140000004',
901
- 'expDate' => '1111',
902
- 'type' => 'MC'
903
- },
904
- 'allowPartialAuth' => 'true'
905
- }
906
- hash = customer_hash.merge(@@merchant_hash)
907
- auth_response = LitleOnlineRequest.new.authorization(hash)
908
- assert_equal('010', auth_response.authorizationResponse.response)
909
- assert_equal('Partially Approved', auth_response.authorizationResponse.message)
910
- assert_equal('48000', auth_response.authorizationResponse.approvedAmount)
911
- end
912
-
913
- def test_12
914
- customer_hash = {
915
- 'orderId' => '12',
916
- 'amount' => '50000',
917
- 'orderSource'=>'ecommerce',
918
- 'card'=>{
919
- 'number' =>'375001014000009',
920
- 'expDate' => '0412',
921
- 'type' => 'AX'},
922
- 'allowPartialAuth' => 'true'
923
- }
924
- hash = customer_hash.merge(@@merchant_hash)
925
- auth_response = LitleOnlineRequest.new.authorization(hash)
926
- assert_equal('010', auth_response.authorizationResponse.response)
927
- assert_equal('Partially Approved', auth_response.authorizationResponse.message)
928
- assert_equal('40000', auth_response.authorizationResponse.approvedAmount)
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 = {