LitleOnline 8.12.3 → 8.12.4

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