LitleOnline 8.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/DESCRIPTION +5 -0
  2. data/LICENSE +22 -0
  3. data/README.md +69 -0
  4. data/Rakefile +92 -0
  5. data/SETUP.md +47 -0
  6. data/bin/Setup.rb +103 -0
  7. data/bin/sample_driver.rb +49 -0
  8. data/index.html +176 -0
  9. data/index.html.1 +176 -0
  10. data/lib/Checker.rb +56 -0
  11. data/lib/Communications.rb +85 -0
  12. data/lib/Configuration.rb +45 -0
  13. data/lib/LitleOnline.rb +52 -0
  14. data/lib/LitleOnlineRequest.rb +399 -0
  15. data/lib/LitleXmlMapper.rb +48 -0
  16. data/lib/Obj2xml.rb +37 -0
  17. data/lib/XMLFields.rb +378 -0
  18. data/test/certification/certTest1_base.rb +948 -0
  19. data/test/certification/certTest2_authenhanced.rb +571 -0
  20. data/test/certification/certTest3_authreversal.rb +184 -0
  21. data/test/certification/certTest4_echeck.rb +279 -0
  22. data/test/certification/certTest5_token.rb +222 -0
  23. data/test/certification/ts_all.rb +31 -0
  24. data/test/functional/test_auth.rb +135 -0
  25. data/test/functional/test_authReversal.rb +68 -0
  26. data/test/functional/test_capture.rb +71 -0
  27. data/test/functional/test_captureGivenAuth.rb +161 -0
  28. data/test/functional/test_credit.rb +154 -0
  29. data/test/functional/test_echeckCredit.rb +116 -0
  30. data/test/functional/test_echeckRedeposit.rb +78 -0
  31. data/test/functional/test_echeckSale.rb +157 -0
  32. data/test/functional/test_echeckVerification.rb +92 -0
  33. data/test/functional/test_forceCapture.rb +105 -0
  34. data/test/functional/test_sale.rb +198 -0
  35. data/test/functional/test_token.rb +102 -0
  36. data/test/functional/test_xmlfields.rb +403 -0
  37. data/test/functional/ts_all.rb +39 -0
  38. data/test/unit/test_Checker.rb +58 -0
  39. data/test/unit/test_LitleOnlineRequest.rb +288 -0
  40. data/test/unit/test_auth.rb +168 -0
  41. data/test/unit/test_authReversal.rb +41 -0
  42. data/test/unit/test_capture.rb +40 -0
  43. data/test/unit/test_captureGivenAuth.rb +108 -0
  44. data/test/unit/test_credit.rb +117 -0
  45. data/test/unit/test_echeckCredit.rb +45 -0
  46. data/test/unit/test_echeckRedeposit.rb +76 -0
  47. data/test/unit/test_echeckSale.rb +45 -0
  48. data/test/unit/test_echeckVerification.rb +75 -0
  49. data/test/unit/test_forceCapture.rb +122 -0
  50. data/test/unit/test_sale.rb +249 -0
  51. data/test/unit/test_token.rb +70 -0
  52. data/test/unit/test_xmlfields.rb +173 -0
  53. data/test/unit/ts_unit.rb +41 -0
  54. metadata +166 -0
@@ -0,0 +1,184 @@
1
+ require 'lib/LitleOnline'
2
+ require 'test/unit'
3
+
4
+ class Litle_certTest3 < Test::Unit::TestCase
5
+ #test auth reversal
6
+ @@merchant_hash = {'reportGroup'=>'Planets','id'=>'321','customerId'=>'123',
7
+ 'merchantId'=>'101'
8
+ }
9
+
10
+ def test_32
11
+ customer_hash = {
12
+ 'orderId' => '32',
13
+ 'amount' => '10010',
14
+ 'orderSource'=>'ecommerce',
15
+ 'billToAddress'=>{
16
+ 'name' => 'John Smith',
17
+ 'addressLine1' => '1 Main St.',
18
+ 'city' => 'Burlington',
19
+ 'state' => 'MA',
20
+ 'zip' => '01803-3747',
21
+ 'country' => 'US'},
22
+ 'card'=>{
23
+ 'number' =>'4457010000000009',
24
+ 'expDate' => '0112',
25
+ 'cardValidationNum' => '349',
26
+ 'type' => 'VI'}
27
+ }
28
+ hash = customer_hash.merge(@@merchant_hash)
29
+ auth_response = LitleOnlineRequest.new.authorization(hash)
30
+ assert_equal('000', auth_response.authorizationResponse.response)
31
+ assert_equal('Approved', auth_response.authorizationResponse.message)
32
+ assert_equal('11111 ', auth_response.authorizationResponse.authCode)
33
+ assert_equal('01', auth_response.authorizationResponse.fraudResult.avsResult)
34
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
35
+
36
+ #test 32A
37
+ capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '5005'}
38
+ hash1a = capture_hash.merge(@@merchant_hash)
39
+ capture_response = LitleOnlineRequest.new.capture(hash1a)
40
+ assert_equal('000', capture_response.captureResponse.response)
41
+ assert_equal('Approved', capture_response.captureResponse.message)
42
+
43
+ # #test 32B
44
+ # authR_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId }
45
+ # hash1b = authR_hash.merge(@@merchant_hash)
46
+ # authR_response = LitleOnlineRequest.new.authReversal(hash1b)
47
+ # assert_equal('111', authR_response.authReversalResponse.response)
48
+ # assert_equal('Authorization amount has already been depleted', authR_response.authReversalResponse.message)
49
+ end
50
+
51
+ def test_33
52
+ customer_hash = {
53
+ 'orderId' => '33',
54
+ 'amount' => '20020',
55
+ 'orderSource'=>'ecommerce',
56
+ 'billToAddress'=>{
57
+ 'name' => 'Mike J. Hammer',
58
+ 'addressLine1' => '2 Main St.',
59
+ 'addressLine2' => 'Apt. 222',
60
+ 'city' => 'Riverside',
61
+ 'state' => 'RI',
62
+ 'zip' => '02915',
63
+ 'country' => 'US'},
64
+ 'card'=>{
65
+ 'number' =>'5112010000000003',
66
+ 'expDate' => '0212',
67
+ 'cardValidationNum' => '261',
68
+ 'type' => 'MC'},
69
+ 'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
70
+ }
71
+ hash = customer_hash.merge(@@merchant_hash)
72
+ auth_response = LitleOnlineRequest.new.authorization(hash)
73
+ assert_equal('000', auth_response.authorizationResponse.response)
74
+ assert_equal('Approved', auth_response.authorizationResponse.message)
75
+ assert_equal('22222', auth_response.authorizationResponse.authCode)
76
+ assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
77
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
78
+
79
+ # #test 33A
80
+ # authReversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
81
+ # hash1a = authReversal_hash.merge(@@merchant_hash)
82
+ # authReversal_response = LitleOnlineRequest.new.authReversal(hash1a)
83
+ # assert_equal('000', authReversal_response.authReversalResponse.response)
84
+ # assert_equal('Approved', authReversal_response.authReversalResponse.message)
85
+ end
86
+
87
+ def test_34
88
+ customer_hash = {
89
+ 'orderId' => '34',
90
+ 'amount' => '30030',
91
+ 'orderSource'=>'ecommerce',
92
+ 'billToAddress'=>{
93
+ 'name' => 'Eileen Jones',
94
+ 'addressLine1' => '3 Main St.',
95
+ 'city' => 'Bloomfield',
96
+ 'state' => 'CT',
97
+ 'zip' => '06002',
98
+ 'country' => 'US'},
99
+ 'card'=>{
100
+ 'number' =>'6011010000000003',
101
+ 'expDate' => '0312',
102
+ 'cardValidationNum' => '758',
103
+ 'type' => 'DI'}
104
+ }
105
+ hash = customer_hash.merge(@@merchant_hash)
106
+ auth_response = LitleOnlineRequest.new.authorization(hash)
107
+ assert_equal('000', auth_response.authorizationResponse.response)
108
+ assert_equal('Approved', auth_response.authorizationResponse.message)
109
+ assert_equal('33333', auth_response.authorizationResponse.authCode)
110
+ assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
111
+ assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
112
+
113
+ # #test 34A
114
+ # authReversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
115
+ # hash1a = authReversal_hash.merge(@@merchant_hash)
116
+ # authReversal_response = LitleOnlineRequest.new.authReversal(hash1a)
117
+ # assert_equal('000', authReversal_response.authReversalResponse.response)
118
+ # assert_equal('Approved', authReversal_response.authReversalResponse.message)
119
+ end
120
+
121
+ def test_35
122
+ customer_hash = {
123
+ 'orderId' => '35',
124
+ 'amount' => '40040',
125
+ 'orderSource'=>'ecommerce',
126
+ 'billToAddress'=>{
127
+ 'name' => 'Bob Black',
128
+ 'addressLine1' => '4 Main St.',
129
+ 'city' => 'Laurel',
130
+ 'state' => 'MD',
131
+ 'zip' => '20708',
132
+ 'country' => 'US'},
133
+ 'card'=>{
134
+ 'number' =>'375001000000005',
135
+ 'expDate' => '0412',
136
+ 'type' => 'AX'}
137
+ }
138
+ hash = customer_hash.merge(@@merchant_hash)
139
+ auth_response = LitleOnlineRequest.new.authorization(hash)
140
+ assert_equal('000', auth_response.authorizationResponse.response)
141
+ assert_equal('Approved', auth_response.authorizationResponse.message)
142
+ assert_equal('44444', auth_response.authorizationResponse.authCode)
143
+ assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
144
+
145
+ # #test 35A
146
+ capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
147
+ hash1a = capture_hash.merge(@@merchant_hash)
148
+ capture_response = LitleOnlineRequest.new.capture(hash1a)
149
+ assert_equal('000', capture_response.captureResponse.response)
150
+ assert_equal('Approved', capture_response.captureResponse.message)
151
+
152
+ # # #test 35B
153
+ # authReversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
154
+ # #authReversal_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId, 'amount' => '20020'}
155
+ # hash2a = authReversal_hash.merge(@@merchant_hash)
156
+ # authReversal_response = LitleOnlineRequest.new.authReversal(hash2a)
157
+ # assert_equal('000', authReversal_response.authReversalResponse.response)
158
+ # assert_equal('Approved', authReversal_response.authReversalResponse.message)
159
+ end
160
+
161
+ def test_36
162
+ customer_hash = {
163
+ 'orderId' => '36',
164
+ 'amount' => '20500',
165
+ 'orderSource'=>'ecommerce',
166
+ 'card'=>{
167
+ 'number' =>'375000026600004',
168
+ 'expDate' => '0512',
169
+ 'type' => 'AX'}
170
+ }
171
+ hash = customer_hash.merge(@@merchant_hash)
172
+ auth_response = LitleOnlineRequest.new.authorization(hash)
173
+ assert_equal('000', auth_response.authorizationResponse.response)
174
+ assert_equal('Approved', auth_response.authorizationResponse.message)
175
+
176
+ #test 36A
177
+ authReversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '10000'}
178
+ hash1a = authReversal_hash.merge(@@merchant_hash)
179
+ authReversal_response = LitleOnlineRequest.new.authReversal(hash1a)
180
+ assert_equal('336', authReversal_response.authReversalResponse.response)
181
+ assert_equal('Reversal Amount does not match Authorization amount', authReversal_response.authReversalResponse.message)
182
+ end
183
+
184
+ end
@@ -0,0 +1,279 @@
1
+ require 'lib/LitleOnline'
2
+ require 'test/unit'
3
+
4
+ class Litle_certTest4 < Test::Unit::TestCase
5
+ # test echeck
6
+ @@merchant_hash = {'reportGroup'=>'Planets',
7
+ 'merchantId'=>'101'
8
+ }
9
+
10
+ # test 37-49 merchant authorizate to do echeck using 087901 with same username IMPTEST, password cert3d6Z
11
+ # test 37-40 echeckVerification
12
+ def test_37
13
+ customer_hash = {
14
+ 'orderId' => '37',
15
+ 'amount' => '3001',
16
+ 'orderSource'=>'telephone',
17
+ 'billToAddress'=>{
18
+ 'firstName' => 'Tom',
19
+ 'lastName' => 'Black'},
20
+
21
+ 'echeck'=>{
22
+ 'accNum' =>'10@BC99999',
23
+ 'accType' => 'Checking',
24
+ 'routingNum' => '053100300'}
25
+ }
26
+ hash = customer_hash.merge(@@merchant_hash)
27
+ echeck_response = LitleOnlineRequest.new.echeckVerification(hash)
28
+ assert_equal('301', echeck_response.echeckVerificationResponse.response)
29
+ assert_equal('Invalid Account Number', echeck_response.echeckVerificationResponse.message)
30
+ end
31
+
32
+ def test_38
33
+ customer_hash = {
34
+ 'orderId' => '38',
35
+ 'amount' => '3002',
36
+ 'orderSource'=>'telephone',
37
+ 'billToAddress'=>{
38
+ 'firstName' => 'John',
39
+ 'lastName' => 'Smith',
40
+ 'phone' => '999-999-9999'
41
+ },
42
+
43
+ 'echeck'=>{
44
+ 'accNum' =>'1099999999',
45
+ 'accType' => 'Checking',
46
+ 'routingNum' => '053000219'}
47
+ }
48
+ hash = customer_hash.merge(@@merchant_hash)
49
+ echeck_response = LitleOnlineRequest.new.echeckVerification(hash)
50
+ assert_equal('000', echeck_response.echeckVerificationResponse.response)
51
+ assert_equal('Approved', echeck_response.echeckVerificationResponse.message)
52
+ end
53
+
54
+ def test_39
55
+ customer_hash = {
56
+ 'orderId' => '39',
57
+ 'amount' => '3003',
58
+ 'orderSource'=>'telephone',
59
+ 'billToAddress'=>{
60
+ 'firstName' => 'Robert',
61
+ 'lastName' => 'Jones',
62
+ 'companyName' => 'Good Goods Inc',
63
+ 'phone' => '9999999999'
64
+ },
65
+
66
+ 'echeck'=>{
67
+ 'accNum' =>'3099999999',
68
+ 'accType' => 'Corporate',
69
+ 'routingNum' => '053100300'}
70
+ }
71
+ hash = customer_hash.merge(@@merchant_hash)
72
+ echeck_response = LitleOnlineRequest.new.echeckVerification(hash)
73
+ assert_equal('950', echeck_response.echeckVerificationResponse.response)
74
+ assert_equal('Declined - Negative Information on File', echeck_response.echeckVerificationResponse.message)
75
+ end
76
+
77
+ def test_40
78
+ customer_hash = {
79
+ 'orderId' => '40',
80
+ 'amount' => '3004',
81
+ 'orderSource'=>'telephone',
82
+ 'billToAddress'=>{
83
+ 'firstName' => 'Peter',
84
+ 'lastName' => 'Green',
85
+ 'companyName' => 'Green Co',
86
+ 'phone' => '9999999999'
87
+ },
88
+
89
+ 'echeck'=>{
90
+ 'accNum' =>'8099999999',
91
+ 'accType' => 'Corporate',
92
+ 'routingNum' => '063102152'}
93
+ }
94
+ hash = customer_hash.merge(@@merchant_hash)
95
+ echeck_response = LitleOnlineRequest.new.echeckVerification(hash)
96
+ assert_equal('951', echeck_response.echeckVerificationResponse.response)
97
+ assert_equal('Absolute Decline', echeck_response.echeckVerificationResponse.message)
98
+ end
99
+
100
+ # #test 41-44 echeckSales
101
+ def test_41
102
+ customer_hash = {
103
+ 'orderId' => '41',
104
+ 'amount' => '2008',
105
+ 'orderSource'=>'telephone',
106
+ 'billToAddress'=>{
107
+ 'firstName' => 'Mike',
108
+ 'middleInitial' => 'J',
109
+ 'lastName' => 'Hammer'
110
+ },
111
+ 'echeck'=>{
112
+ 'accNum' =>'10@BC99999',
113
+ 'accType' => 'Checking',
114
+ 'routingNum' => '053100300'}
115
+ }
116
+ hash = customer_hash.merge(@@merchant_hash)
117
+ echeck_response = LitleOnlineRequest.new.echeckSale(hash)
118
+
119
+ assert_equal('301', echeck_response.echeckSalesResponse.response)
120
+ assert_equal('Invalid Account Number', echeck_response.echeckSalesResponse.message)
121
+ end
122
+
123
+ def test_42
124
+ customer_hash = {
125
+ 'orderId' => '42',
126
+ 'amount' => '2004',
127
+ 'orderSource'=>'telephone',
128
+ 'billToAddress'=>{
129
+ 'firstName' => 'Tom',
130
+ 'lastName' => 'Black'
131
+ },
132
+ 'echeck'=>{
133
+ 'accNum' =>'4099999992',
134
+ 'accType' => 'Checking',
135
+ 'routingNum' => '211370545'}
136
+ }
137
+ hash = customer_hash.merge(@@merchant_hash)
138
+ echeck_response = LitleOnlineRequest.new.echeckSale(hash)
139
+
140
+ assert_equal('000', echeck_response.echeckSalesResponse.response)
141
+ assert_equal('Approved', echeck_response.echeckSalesResponse.message)
142
+ end
143
+
144
+ def test_43
145
+ customer_hash = {
146
+ 'orderId' => '43',
147
+ 'amount' => '2007',
148
+ 'orderSource'=>'telephone',
149
+ 'billToAddress'=>{
150
+ 'firstName' => 'Peter',
151
+ 'lastName' => 'Green',
152
+ 'companyName' => 'Green Co'
153
+ },
154
+
155
+ 'echeck'=>{
156
+ 'accNum' =>'6099999992',
157
+ 'accType' => 'Corporate',
158
+ 'routingNum' => '211370545'}
159
+ }
160
+ hash = customer_hash.merge(@@merchant_hash)
161
+ echeck_response = LitleOnlineRequest.new.echeckSale(hash)
162
+
163
+ assert_equal('000', echeck_response.echeckSalesResponse.response)
164
+ assert_equal('Approved', echeck_response.echeckSalesResponse.message)
165
+ end
166
+
167
+ def test_44
168
+ customer_hash = {
169
+ 'orderId' => '44',
170
+ 'amount' => '2009',
171
+ 'orderSource'=>'telephone',
172
+ 'billToAddress'=>{
173
+ 'firstName' => 'Peter',
174
+ 'lastName' => 'Green',
175
+ 'companyName' => 'Green Co'
176
+ },
177
+
178
+ 'echeck'=>{
179
+ 'accNum' =>'9099999992',
180
+ 'accType' => 'Corporate',
181
+ 'routingNum' => '053133052'}
182
+ }
183
+ hash = customer_hash.merge(@@merchant_hash)
184
+ echeck_response = LitleOnlineRequest.new.echeckSale(hash)
185
+
186
+ assert_equal('900', echeck_response.echeckSalesResponse.response)
187
+ assert_equal('Invalid Bank Routing Number', echeck_response.echeckSalesResponse.message)
188
+ end
189
+
190
+ # #test 45-49 echeckCredit
191
+ def test_45
192
+ customer_hash = {
193
+ 'orderId' => '45',
194
+ 'amount' => '1001',
195
+ 'orderSource'=>'telephone',
196
+ 'billToAddress'=>{
197
+ 'firstName' => 'John',
198
+ 'lastName' => 'Smith'
199
+ },
200
+ 'echeck'=>{
201
+ 'accNum' =>'10@BC99999',
202
+ 'accType' => 'Checking',
203
+ 'routingNum' => '053100300'}
204
+ }
205
+ hash = customer_hash.merge(@@merchant_hash)
206
+ echeck_response = LitleOnlineRequest.new.echeckCredit(hash)
207
+
208
+ assert_equal('301', echeck_response.echeckCreditResponse.response)
209
+ # assert_equal('InValid Account Number', echeck_response.echeckCreditResponse.message)
210
+ end
211
+
212
+ def test_46
213
+ customer_hash = {
214
+ 'orderId' => '46',
215
+ 'amount' => '1003',
216
+ 'orderSource'=>'telephone',
217
+ 'billToAddress'=>{
218
+ 'firstName' => 'Robert',
219
+ 'lastName' => 'Jones',
220
+ 'companyName' => 'Widget Inc'
221
+ },
222
+ 'echeck'=>{
223
+ 'accNum' =>'3099999999',
224
+ 'accType' => 'Corporate',
225
+ 'routingNum' => '063102152'}
226
+ }
227
+ hash = customer_hash.merge(@@merchant_hash)
228
+ echeck_response = LitleOnlineRequest.new.echeckCredit(hash)
229
+
230
+ assert_equal('000', echeck_response.echeckCreditResponse.response)
231
+ assert_equal('Approved', echeck_response.echeckCreditResponse.message)
232
+ end
233
+
234
+ def test_47
235
+ customer_hash = {
236
+ 'orderId' => '47',
237
+ 'amount' => '1007',
238
+ 'orderSource'=>'telephone',
239
+ 'billToAddress'=>{
240
+ 'firstName' => 'Peter',
241
+ 'lastName' => 'Green',
242
+ 'companyName' => 'Green Co'
243
+ },
244
+ 'echeck'=>{
245
+ 'accNum' =>'6099999993',
246
+ 'accType' => 'Corporate',
247
+ 'routingNum' => '211370545'}
248
+ }
249
+ hash = customer_hash.merge(@@merchant_hash)
250
+ echeck_response = LitleOnlineRequest.new.echeckCredit(hash)
251
+
252
+ assert_equal('000', echeck_response.echeckCreditResponse.response)
253
+ assert_equal('Approved', echeck_response.echeckCreditResponse.message)
254
+ end
255
+
256
+ def test_48
257
+ customer_hash = {
258
+ #'orderId' => '48',
259
+ 'litleTxnId' => '430000000000000001'
260
+ }
261
+ hash = customer_hash.merge(@@merchant_hash)
262
+ echeck_response = LitleOnlineRequest.new.echeckCredit(hash)
263
+
264
+ assert_equal('000', echeck_response.echeckCreditResponse.response)
265
+ assert_equal('Approved', echeck_response.echeckCreditResponse.message)
266
+ end
267
+
268
+ def test_49
269
+ customer_hash = {
270
+ #'orderId' => '49',
271
+ 'litleTxnId' => '2'
272
+ }
273
+ hash = customer_hash.merge(@@merchant_hash)
274
+ echeck_response = LitleOnlineRequest.new.echeckCredit(hash)
275
+
276
+ assert_equal('360', echeck_response.echeckCreditResponse.response)
277
+ assert_equal('No transaction found with specified litleTxnId', echeck_response.echeckCreditResponse.message)
278
+ end
279
+ end