LitleOnline 8.12.0 → 8.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/CHANGELOG +28 -0
  2. data/Rakefile +2 -3
  3. data/lib/Communications.rb +14 -12
  4. data/lib/LitleOnline.rb +11 -2
  5. data/lib/LitleOnlineRequest.rb +435 -284
  6. data/lib/LitleXmlMapper.rb +1 -2
  7. data/lib/XMLFields.rb +900 -307
  8. data/lib/cacert.pem +3331 -0
  9. data/test/certification/certTest2_authenhanced.rb +7 -7
  10. data/test/certification/certTest5_token.rb +8 -8
  11. data/test/functional/test_auth.rb +106 -3
  12. data/test/functional/test_authReversal.rb +5 -6
  13. data/test/functional/test_capture.rb +12 -1
  14. data/test/functional/test_captureGivenAuth.rb +25 -5
  15. data/test/functional/test_credit.rb +1 -1
  16. data/test/functional/test_echeckRedeposit.rb +34 -0
  17. data/test/functional/test_echeckVerification.rb +33 -0
  18. data/test/functional/test_forceCapture.rb +35 -0
  19. data/test/functional/test_sale.rb +45 -13
  20. data/test/functional/test_xmlfields.rb +197 -10
  21. data/test/functional/ts_all.rb +2 -0
  22. data/test/unit/test_LitleOnlineRequest.rb +2 -59
  23. data/test/unit/test_auth.rb +2 -51
  24. data/test/unit/test_authReversal.rb +10 -5
  25. data/test/unit/test_capture.rb +5 -7
  26. data/test/unit/test_captureGivenAuth.rb +0 -19
  27. data/test/unit/test_credit.rb +1 -0
  28. data/test/unit/test_echeckCredit.rb +0 -2
  29. data/test/unit/test_echeckRedeposit.rb +0 -34
  30. data/test/unit/test_echeckSale.rb +0 -1
  31. data/test/unit/test_echeckVerification.rb +0 -33
  32. data/test/unit/test_forceCapture.rb +0 -35
  33. data/test/unit/test_sale.rb +20 -51
  34. data/test/unit/test_xmlfields.rb +44 -84
  35. data/test/unit/ts_unit.rb +1 -1
  36. metadata +13 -26
  37. data/index.html +0 -176
  38. data/index.html.1 +0 -176
  39. data/lib/Checker.rb +0 -56
  40. data/test/unit/test_Checker.rb +0 -58
@@ -23,7 +23,7 @@ class Litle_certTest2 < Test::Unit::TestCase
23
23
  auth_response = LitleOnlineRequest.new.authorization(hash)
24
24
  assert_equal('000', auth_response.authorizationResponse.response)
25
25
  assert_equal('Approved', auth_response.authorizationResponse.message)
26
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.type)
26
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type']) #Ruby 1.8.7 has type as an attribute of Object
27
27
  assert_equal('2000', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
28
28
  assert_equal('NO', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
29
29
  assert_equal('GIFT', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
@@ -44,7 +44,7 @@ class Litle_certTest2 < Test::Unit::TestCase
44
44
  auth_response = LitleOnlineRequest.new.authorization(hash)
45
45
  assert_equal('000', auth_response.authorizationResponse.response)
46
46
  assert_equal('Approved', auth_response.authorizationResponse.message)
47
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.type)
47
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
48
48
  assert_equal('2000', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
49
49
  assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
50
50
  assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
@@ -65,7 +65,7 @@ class Litle_certTest2 < Test::Unit::TestCase
65
65
  auth_response = LitleOnlineRequest.new.authorization(hash)
66
66
  assert_equal('000', auth_response.authorizationResponse.response)
67
67
  assert_equal('Approved', auth_response.authorizationResponse.message)
68
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.type)
68
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
69
69
  assert_equal('0', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
70
70
  assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
71
71
  assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
@@ -86,7 +86,7 @@ class Litle_certTest2 < Test::Unit::TestCase
86
86
  auth_response = LitleOnlineRequest.new.authorization(hash)
87
87
  assert_equal('000', auth_response.authorizationResponse.response)
88
88
  assert_equal('Approved', auth_response.authorizationResponse.message)
89
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.type)
89
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
90
90
  assert_equal('6500', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
91
91
  assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
92
92
  assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
@@ -107,7 +107,7 @@ class Litle_certTest2 < Test::Unit::TestCase
107
107
  auth_response = LitleOnlineRequest.new.authorization(hash)
108
108
  assert_equal('000', auth_response.authorizationResponse.response)
109
109
  assert_equal('Approved', auth_response.authorizationResponse.message)
110
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.type)
110
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
111
111
  assert_equal('12200', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
112
112
  assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
113
113
  assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
@@ -128,7 +128,7 @@ class Litle_certTest2 < Test::Unit::TestCase
128
128
  auth_response = LitleOnlineRequest.new.authorization(hash)
129
129
  assert_equal('000', auth_response.authorizationResponse.response)
130
130
  assert_equal('Approved', auth_response.authorizationResponse.message)
131
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.type)
131
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
132
132
  assert_equal('20000', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
133
133
  assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
134
134
  assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
@@ -149,7 +149,7 @@ class Litle_certTest2 < Test::Unit::TestCase
149
149
  auth_response = LitleOnlineRequest.new.authorization(hash)
150
150
  assert_equal('000', auth_response.authorizationResponse.response)
151
151
  assert_equal('Approved', auth_response.authorizationResponse.message)
152
- assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.type)
152
+ assert_equal('PREPAID', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource['type'])
153
153
  assert_equal('10050', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.availableBalance)
154
154
  assert_equal('YES', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.reloadable)
155
155
  assert_equal('PAYROLL', auth_response.authorizationResponse.enhancedAuthResponse.fundingSource.prepaidCardType)
@@ -14,7 +14,7 @@ class Litle_certTest5 < Test::Unit::TestCase
14
14
  hash = customer_hash.merge(@@merchant_hash)
15
15
  token_response = LitleOnlineRequest.new.register_token_request(hash)
16
16
  assert_equal('445711', token_response.registerTokenResponse.bin)
17
- assert_equal('VI', token_response.registerTokenResponse.type)
17
+ assert_equal('VI', token_response.registerTokenResponse['type'])
18
18
  assert_equal('801', token_response.registerTokenResponse.response)
19
19
  assert_equal('1111222233330123', token_response.registerTokenResponse.litleToken)
20
20
  assert_equal('Account number was successfully registered', token_response.registerTokenResponse.message)
@@ -39,7 +39,7 @@ class Litle_certTest5 < Test::Unit::TestCase
39
39
  hash = customer_hash.merge(@@merchant_hash)
40
40
  token_response = LitleOnlineRequest.new.register_token_request(hash)
41
41
  assert_equal('445711', token_response.registerTokenResponse.bin)
42
- assert_equal('VI', token_response.registerTokenResponse.type)
42
+ assert_equal('VI', token_response.registerTokenResponse['type'])
43
43
  assert_equal('802', token_response.registerTokenResponse.response)
44
44
  assert_equal('1111222233330123', token_response.registerTokenResponse.litleToken)
45
45
  assert_equal('Account number was previously registered', token_response.registerTokenResponse.message)
@@ -52,7 +52,7 @@ class Litle_certTest5 < Test::Unit::TestCase
52
52
  }
53
53
  hash = customer_hash.merge(@@merchant_hash)
54
54
  token_response = LitleOnlineRequest.new.register_token_request(hash)
55
- assert_equal('EC', token_response.registerTokenResponse.type)
55
+ assert_equal('EC', token_response.registerTokenResponse['type'])
56
56
  assert_equal('998', token_response.registerTokenResponse.eCheckAccountSuffix)
57
57
  assert_equal('801', token_response.registerTokenResponse.response)
58
58
  assert_equal('Account number was successfully registered', token_response.registerTokenResponse.message)
@@ -83,7 +83,7 @@ class Litle_certTest5 < Test::Unit::TestCase
83
83
  assert_equal('Approved', token_response.authorizationResponse.message)
84
84
  assert_equal('801', token_response.authorizationResponse.tokenResponse.tokenResponseCode)
85
85
  assert_equal('Account number was successfully registered', token_response.authorizationResponse.tokenResponse.tokenMessage)
86
- assert_equal('MC', token_response.authorizationResponse.tokenResponse.type)
86
+ assert_equal('MC', token_response.authorizationResponse.tokenResponse['type'])
87
87
  assert_equal('543510', token_response.authorizationResponse.tokenResponse.bin)
88
88
  end
89
89
 
@@ -113,7 +113,7 @@ class Litle_certTest5 < Test::Unit::TestCase
113
113
  assert_equal('Approved', token_response.authorizationResponse.message)
114
114
  assert_equal('802', token_response.authorizationResponse.tokenResponse.tokenResponseCode)
115
115
  assert_equal('Account number was previously registered', token_response.authorizationResponse.tokenResponse.tokenMessage)
116
- assert_equal('MC', token_response.authorizationResponse.tokenResponse.type)
116
+ assert_equal('MC', token_response.authorizationResponse.tokenResponse['type'])
117
117
  assert_equal('543510', token_response.authorizationResponse.tokenResponse.bin)
118
118
  end
119
119
 
@@ -157,7 +157,7 @@ class Litle_certTest5 < Test::Unit::TestCase
157
157
  token_response = LitleOnlineRequest.new.echeck_sale(hash)
158
158
  assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
159
159
  assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
160
- assert_equal('EC', token_response.echeckSalesResponse.tokenResponse.type)
160
+ assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
161
161
  assert_equal('003', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
162
162
  assert_equal('111922223333444003', token_response.echeckSalesResponse.tokenResponse.litleToken)
163
163
  end
@@ -176,7 +176,7 @@ class Litle_certTest5 < Test::Unit::TestCase
176
176
  token_response = LitleOnlineRequest.new.echeck_sale(hash)
177
177
  assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
178
178
  assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
179
- assert_equal('EC', token_response.echeckSalesResponse.tokenResponse.type)
179
+ assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
180
180
  assert_equal('999', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
181
181
  assert_equal('111922223333444999', token_response.echeckSalesResponse.tokenResponse.litleToken)
182
182
  end
@@ -195,7 +195,7 @@ class Litle_certTest5 < Test::Unit::TestCase
195
195
  token_response = LitleOnlineRequest.new.echeck_sale(hash)
196
196
  assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
197
197
  assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
198
- assert_equal('EC', token_response.echeckSalesResponse.tokenResponse.type)
198
+ assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
199
199
  assert_equal('999', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
200
200
  assert_equal('111922223333555999', token_response.echeckSalesResponse.tokenResponse.litleToken)
201
201
  end
@@ -37,7 +37,7 @@ class TestAuth < Test::Unit::TestCase
37
37
  'orderSource'=>'ecommerce',
38
38
  'card'=>{
39
39
  'type'=>'VI',
40
- 'number' =>'4100000000000002',
40
+ 'number' =>'4100000000000000',
41
41
  'expDate' =>'1210'
42
42
  }}
43
43
  response= LitleOnlineRequest.new.authorization(hash)
@@ -86,7 +86,7 @@ class TestAuth < Test::Unit::TestCase
86
86
  'orderId'=>'12344',
87
87
  'card'=>{
88
88
  'type'=>'VI',
89
- 'number' =>'4100000000000002',
89
+ 'number' =>'4100000000000000',
90
90
  'expDate' =>'1210'
91
91
  },
92
92
  'orderSource'=>'ecommerce',
@@ -107,7 +107,7 @@ class TestAuth < Test::Unit::TestCase
107
107
  'card'=>{
108
108
  'NOexistantField' => 'ShouldNotCauseError',
109
109
  'type'=>'VI',
110
- 'number' =>'4100000000000002',
110
+ 'number' =>'4100000000000000',
111
111
  'expDate' =>'1210'
112
112
  }}
113
113
  response= LitleOnlineRequest.new.authorization(hash)
@@ -131,5 +131,108 @@ class TestAuth < Test::Unit::TestCase
131
131
  response= LitleOnlineRequest.new.authorization(hash)
132
132
  assert(response.message =~ /Error validating xml data against the schema/)
133
133
  end
134
+
135
+ def test_no_order_id
136
+ hash = {
137
+ 'merchantId' => '101',
138
+ 'version'=>'8.8',
139
+ 'reportGroup'=>'Planets',
140
+ 'amount'=>'106',
141
+ 'orderSource'=>'ecommerce',
142
+ 'card'=>{
143
+ 'type'=>'VI',
144
+ 'number' =>'4100000000000001',
145
+ 'expDate' =>'1210'
146
+ }}
147
+ response= LitleOnlineRequest.new.authorization(hash)
148
+ assert(response.message =~ /Error validating xml data against the schema/)
149
+ end
150
+
151
+ def test_no_amount
152
+ hash = {
153
+ 'merchantId' => '101',
154
+ 'version'=>'8.8',
155
+ 'reportGroup'=>'Planets',
156
+ 'orderId'=>'12344',
157
+ 'orderSource'=>'ecommerce',
158
+ 'card'=>{
159
+ 'type'=>'VI',
160
+ 'number' =>'4100000000000001',
161
+ 'expDate' =>'1210'
162
+ }}
163
+ response= LitleOnlineRequest.new.authorization(hash)
164
+ assert(response.message =~ /Error validating xml data against the schema/)
165
+ end
166
+
167
+ def test_no_order_source
168
+ hash = {
169
+ 'merchantId' => '101',
170
+ 'version'=>'8.8',
171
+ 'reportGroup'=>'Planets',
172
+ # 'litleTxnId'=>'123456',
173
+ 'orderId'=>'12344',
174
+ 'amount'=>'106',
175
+ 'card'=>{
176
+ 'type'=>'VI',
177
+ 'number' =>'4100000000000001',
178
+ 'expDate' =>'1210'
179
+ }}
180
+ response= LitleOnlineRequest.new.authorization(hash)
181
+ assert(response.message =~ /Error validating xml data against the schema/)
182
+ end
183
+
184
+ def test_authorization_missing_attributes
185
+ hash={
186
+ 'reportGroup'=>'Planets',
187
+ 'amount'=>'106',
188
+
189
+ 'orderSource'=>'ecommerce',
190
+ 'card'=>{
191
+ 'type'=>'VI',
192
+ 'number' =>'4100000000000001',
193
+ 'expDate' =>'1210'
194
+ }}
195
+
196
+ response= LitleOnlineRequest.new.authorization(hash)
197
+ assert(response.message =~ /Error validating xml data against the schema/)
198
+ end
199
+
200
+ def test_orderId_required
201
+ start_hash = {
202
+ 'merchantId'=>'101',
203
+ 'reportGroup'=>'Planets',
204
+ 'amount'=>'101',
205
+ 'orderSource'=>'ecommerce',
206
+ 'card' => {
207
+ 'type' => 'VI',
208
+ 'number' => '1111222233334444'
209
+ }
210
+ }
211
+ response= LitleOnlineRequest.new.authorization(start_hash)
212
+ assert(response.message =~ /Error validating xml data against the schema/)
213
+
214
+ response = LitleOnlineRequest.new.authorization(start_hash.merge({'orderId'=>'1234'}))
215
+ assert_equal('000', response.authorizationResponse.response)
216
+ end
217
+
218
+ def test_ssn_optional
219
+ start_hash = {
220
+ 'orderId'=>'12344',
221
+ 'merchantId'=>'101',
222
+ 'reportGroup'=>'Planets',
223
+ 'amount'=>'101',
224
+ 'orderSource'=>'ecommerce',
225
+ 'card' => {
226
+ 'type' => 'VI',
227
+ 'number' => '1111222233334444'
228
+ },
229
+ }
230
+ response = LitleOnlineRequest.new.authorization(start_hash)
231
+ assert_equal('000', response.authorizationResponse.response)
232
+
233
+ response = LitleOnlineRequest.new.authorization(start_hash.merge({'customerInfo'=>{'ssn'=>'000112222'} }))
234
+ assert_equal('000', response.authorizationResponse.response)
235
+ end
236
+
134
237
  end
135
238
 
@@ -52,17 +52,16 @@ class TestAuthReversal < Test::Unit::TestCase
52
52
  assert_equal('Valid Format', response.message)
53
53
  end
54
54
 
55
- def test_invalid_field
55
+ def test_no_litle_txn_id
56
56
  hash = {
57
57
  'merchantId' => '101',
58
58
  'version'=>'8.8',
59
- 'litleTxnId'=>'12345678000',
60
- 'NonexistentField'=>'none',
61
- 'payPalNotes'=>'Notes',
59
+ 'reportGroup'=>'12345678',
62
60
  'amount'=>'106',
63
- 'reportGroup'=>'Planets',
61
+ 'payPalNotes'=>'Notes'
64
62
  }
65
63
  response= LitleOnlineRequest.new.auth_reversal(hash)
66
- assert_equal('Valid Format', response.message)
64
+ assert(response.message =~ /Error validating xml data against the schema/)
67
65
  end
66
+
68
67
  end
@@ -67,5 +67,16 @@ class Test_capture < Test::Unit::TestCase
67
67
  response= LitleOnlineRequest.new.capture(hash)
68
68
  assert_equal('Valid Format', response.message)
69
69
  end
70
- end
70
+
71
+ def test_no_txn_id
72
+ hash = {
73
+ 'merchantId' => '101',
74
+ 'version'=>'8.8',
75
+ 'reportGroup'=>'Planets',
76
+ 'amount'=>'106',
77
+ }
78
+ response= LitleOnlineRequest.new.capture(hash)
79
+ assert(response.message =~ /Error validating xml data against the schema/)
80
+ end
71
81
 
82
+ end
@@ -40,7 +40,7 @@ class TestcaptureGivenAuth < Test::Unit::TestCase
40
40
  'orderSource'=>'ecommerce',
41
41
  'card'=>{
42
42
  'type'=>'VI',
43
- 'number' =>'4100000000000001',
43
+ 'number' =>'4100000000000000',
44
44
  'expDate' =>'1210'
45
45
  }}
46
46
  response= LitleOnlineRequest.new.capture_given_auth(hash)
@@ -81,7 +81,7 @@ class TestcaptureGivenAuth < Test::Unit::TestCase
81
81
  'amount'=>'106',
82
82
  'card'=>{
83
83
  'type'=>'VI',
84
- 'number' =>'4100000000000001',
84
+ 'number' =>'4100000000000000',
85
85
  'expDate' =>'1210'
86
86
  },
87
87
  'reportGroup'=>'Planets',
@@ -106,7 +106,7 @@ class TestcaptureGivenAuth < Test::Unit::TestCase
106
106
  'card'=>{
107
107
  'NOexistantField' => 'ShouldNotCauseError',
108
108
  'type'=>'VI',
109
- 'number' =>'4100000000000001',
109
+ 'number' =>'4100000000000000',
110
110
  'expDate' =>'1210'
111
111
  }}
112
112
  response= LitleOnlineRequest.new.capture_given_auth(hash)
@@ -129,7 +129,7 @@ class TestcaptureGivenAuth < Test::Unit::TestCase
129
129
  'orderSource'=>'ecommerce',
130
130
  'card'=>{
131
131
  'type'=>'VI',
132
- 'number' =>'4100000000000001',
132
+ 'number' =>'4100000000000000',
133
133
  'expDate' =>'1210'
134
134
  }}
135
135
  response= LitleOnlineRequest.new.capture_given_auth(hash)
@@ -151,11 +151,31 @@ class TestcaptureGivenAuth < Test::Unit::TestCase
151
151
  'orderSource'=>'ecommerce',
152
152
  'card'=>{
153
153
  'type'=>'VI',
154
- 'number' =>'4100000000000001',
154
+ 'number' =>'4100000000000000',
155
155
  'expDate' =>'1210'
156
156
  }}
157
157
  response= LitleOnlineRequest.new.capture_given_auth(hash)
158
158
  assert_equal('Valid Format', response.message)
159
159
  end
160
+
161
+ def test_no_amount
162
+ hash = {
163
+ 'merchantId' => '101',
164
+ 'version'=>'8.8',
165
+ 'reportGroup'=>'Planets',
166
+ 'orderId'=>'12344',
167
+ 'authInformation' => {
168
+ 'authDate'=>'2002-10-09','authCode'=>'543216',
169
+ 'authAmount'=>'12345'
170
+ },
171
+ 'orderSource'=>'ecommerce',
172
+ 'card'=>{
173
+ 'type'=>'VI',
174
+ 'number' =>'4100000000000001',
175
+ 'expDate' =>'1210'
176
+ }}
177
+ response= LitleOnlineRequest.new.capture_given_auth(hash)
178
+ assert(response.message =~ /Error validating xml data against the schema/)
179
+ end
160
180
  end
161
181
 
@@ -56,7 +56,7 @@ class TestCredit < Test::Unit::TestCase
56
56
  'transactionId'=>'1234',
57
57
  }}
58
58
  response= LitleOnlineRequest.new.credit(hash)
59
- assert(response.message =~ /Error validating xml data against the schema/)
59
+ assert_equal('Valid Format', response.message)
60
60
  end
61
61
 
62
62
  def test_illegal_order_id
@@ -74,5 +74,39 @@ class Test_echeckRedeposit < Test::Unit::TestCase
74
74
  assert_equal('Valid Format', response.message)
75
75
  end
76
76
 
77
+ def test_no_txn_id
78
+ hash = {
79
+ 'merchantId' => '101',
80
+ 'version'=>'8.8',
81
+ 'reportGroup'=>'Planets',
82
+ }
83
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
84
+ assert(response.message =~ /Error validating xml data against the schema/)
85
+ end
86
+
87
+ def test_echeck_redeposit_withecheckmissingfield
88
+ hash = {
89
+ 'merchantId' => '101',
90
+ 'version'=>'8.8',
91
+ 'reportGroup'=>'Planets',
92
+ 'litleTxnId'=>'123456',
93
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','checkNum'=>'123455'}
94
+ }
95
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
96
+ assert(response.message =~ /Error validating xml data against the schema/)
97
+ end
98
+
99
+ def test_echeck_redeposit_with_echeck_token_missing_field
100
+ hash = {
101
+ 'merchantId' => '101',
102
+ 'version'=>'8.8',
103
+ 'reportGroup'=>'Planets',
104
+ 'litleTxnId'=>'123456',
105
+ 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','checkNum'=>'123455'}
106
+ }
107
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
108
+ assert(response.message =~ /Error validating xml data against the schema/)
109
+ end
110
+
77
111
  end
78
112
 
@@ -87,6 +87,39 @@ class Test_echeckVerification < Test::Unit::TestCase
87
87
  response= LitleOnlineRequest.new.echeck_verification(hash)
88
88
  assert(response.message =~ /Error validating xml data against the schema/)
89
89
  end
90
+
91
+ def test_no_amount
92
+ hash = {
93
+ 'merchantId' => '101',
94
+ 'version'=>'8.8',
95
+ 'reportGroup'=>'Planets',
96
+ 'orderId'=>'12345'
97
+ }
98
+ response= LitleOnlineRequest.new.echeck_verification(hash)
99
+ assert(response.message =~ /Error validating xml data against the schema/)
100
+ end
101
+
102
+ def test_no_order_id
103
+ hash = {
104
+ 'merchantId' => '101',
105
+ 'version'=>'8.8',
106
+ 'reportGroup'=>'Planets',
107
+ }
108
+ response= LitleOnlineRequest.new.echeck_verification(hash)
109
+ assert(response.message =~ /Error validating xml data against the schema/)
110
+ end
111
+
112
+ def test_no_order_source
113
+ hash = {
114
+ 'merchantId' => '101',
115
+ 'version'=>'8.8',
116
+ 'reportGroup'=>'Planets',
117
+ 'amount'=>'123456',
118
+ 'orderId'=>'12345'
119
+ }
120
+ response= LitleOnlineRequest.new.echeck_verification(hash)
121
+ assert(response.message =~ /Error validating xml data against the schema/)
122
+ end
90
123
 
91
124
  end
92
125