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
@@ -25,130 +25,130 @@ OTHER DEALINGS IN THE SOFTWARE.
25
25
  require 'lib/LitleOnline'
26
26
  require 'test/unit'
27
27
 
28
- class TestCredit < Test::Unit::TestCase
29
- def test_simple_credit_with_card
30
- hash = {
31
- 'merchantId' => '101',
32
- 'version'=>'8.8',
33
- 'reportGroup'=>'Planets',
34
- 'orderId'=>'12344',
35
- 'amount'=>'106',
36
- 'orderSource'=>'ecommerce',
37
- 'card'=>{
38
- 'type'=>'VI',
39
- 'number' =>'4100000000000001',
40
- 'expDate' =>'1210'
41
- }}
42
- response= LitleOnlineRequest.new.credit(hash)
43
- assert_equal('Valid Format', response.message)
28
+ module LitleOnline
29
+ class TestCredit < Test::Unit::TestCase
30
+ def test_simple_credit_with_card
31
+ hash = {
32
+ 'merchantId' => '101',
33
+ 'version'=>'8.8',
34
+ 'reportGroup'=>'Planets',
35
+ 'orderId'=>'12344',
36
+ 'amount'=>'106',
37
+ 'orderSource'=>'ecommerce',
38
+ 'card'=>{
39
+ 'type'=>'VI',
40
+ 'number' =>'4100000000000001',
41
+ 'expDate' =>'1210'
42
+ }}
43
+ response= LitleOnlineRequest.new.credit(hash)
44
+ assert_equal('Valid Format', response.message)
45
+ end
46
+
47
+ def test_simple_credit_with_paypal
48
+ hash = {
49
+ 'merchantId' => '101',
50
+ 'version'=>'8.8',
51
+ 'reportGroup'=>'Planets',
52
+ 'amount'=>'106',
53
+ 'orderId'=>'123456',
54
+ 'orderSource'=>'ecommerce',
55
+ 'paypal'=>{
56
+ 'payerId'=>'1234',
57
+ 'transactionId'=>'1234',
58
+ }}
59
+ response= LitleOnlineRequest.new.credit(hash)
60
+ assert_equal('Valid Format', response.message)
61
+ end
62
+
63
+ def test_illegal_order_id
64
+ hash = {
65
+ 'merchantId' => '101',
66
+ 'version'=>'8.8',
67
+ 'reportGroup'=>'Planets',
68
+ 'orderId'=>'12344',
69
+ 'litleTxnId' => '12345456',
70
+ 'amount'=>'106',
71
+ 'orderSource'=>'ecomerce',
72
+ 'card'=>{
73
+ 'type'=>'VI',
74
+ 'number' =>'4100000000000001',
75
+ 'expDate' =>'1210'
76
+ }}
77
+ response= LitleOnlineRequest.new.credit(hash)
78
+ assert(response.message =~ /Error validating xml data against the schema/)
79
+ end
80
+
81
+ def test_fields_out_of_order
82
+ hash = {
83
+ 'merchantId' => '101',
84
+ 'version'=>'8.8',
85
+ 'reportGroup'=>'Planets',
86
+ 'orderId'=>'12344',
87
+ 'card'=>{
88
+ 'type'=>'VI',
89
+ 'number' =>'4100000000000001',
90
+ 'expDate' =>'1210'
91
+ },
92
+ 'orderSource'=>'ecommerce',
93
+ 'amount'=>'106'
94
+ }
95
+ response= LitleOnlineRequest.new.credit(hash)
96
+ assert_equal('Valid Format', response.message)
97
+ end
98
+
99
+ def test_invalid_field
100
+ hash = {
101
+ 'merchantId' => '101',
102
+ 'version'=>'8.8',
103
+ 'reportGroup'=>'Planets',
104
+ 'orderId'=>'12344',
105
+ 'amount'=>'106',
106
+ 'orderSource'=>'ecommerce',
107
+ 'card'=>{
108
+ 'NOexistantField' => 'ShouldNotCauseError',
109
+ 'type'=>'VI',
110
+ 'number' =>'4100000000000001',
111
+ 'expDate' =>'1210'
112
+ }}
113
+ response= LitleOnlineRequest.new.credit(hash)
114
+ assert_equal('Valid Format', response.message)
115
+ end
116
+
117
+ def test_pay_pal_notes
118
+ hash = {
119
+ 'merchantId' => '101',
120
+ 'version'=>'8.8',
121
+ 'reportGroup'=>'Planets',
122
+ 'orderId'=>'12344',
123
+ 'amount'=>'106',
124
+ 'payPalNotes'=>'Hello',
125
+ 'orderSource'=>'ecommerce',
126
+ 'card'=>{
127
+ 'type'=>'VI',
128
+ 'number' =>'4100000000000001',
129
+ 'expDate' =>'1210'
130
+ }}
131
+ response= LitleOnlineRequest.new.credit(hash)
132
+ assert_equal('Valid Format', response.message)
133
+ end
134
+
135
+ def test_processing_instructions_and_amex_data
136
+ hash = {
137
+ 'merchantId' => '101',
138
+ 'version'=>'8.8',
139
+ 'reportGroup'=>'Planets',
140
+ 'amount'=>'2000',
141
+ 'orderId'=>'12344',
142
+ 'orderSource'=>'ecommerce',
143
+ 'processingInstuctions'=>{'bypassVelocityCheck'=>'yes'},
144
+ 'card'=>{
145
+ 'type'=>'VI',
146
+ 'number' =>'4100000000000001',
147
+ 'expDate' =>'1210'},
148
+ 'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234','sellerId'=>'1234Id'}
149
+ }
150
+ response= LitleOnlineRequest.new.credit(hash)
151
+ assert_equal('Valid Format', response.message)
152
+ end
44
153
  end
45
-
46
- def test_simple_credit_with_paypal
47
- hash = {
48
- 'merchantId' => '101',
49
- 'version'=>'8.8',
50
- 'reportGroup'=>'Planets',
51
- 'amount'=>'106',
52
- 'orderId'=>'123456',
53
- 'orderSource'=>'ecommerce',
54
- 'paypal'=>{
55
- 'payerId'=>'1234',
56
- 'transactionId'=>'1234',
57
- }}
58
- response= LitleOnlineRequest.new.credit(hash)
59
- assert_equal('Valid Format', response.message)
60
- end
61
-
62
- def test_illegal_order_id
63
- hash = {
64
- 'merchantId' => '101',
65
- 'version'=>'8.8',
66
- 'reportGroup'=>'Planets',
67
- 'orderId'=>'12344',
68
- 'litleTxnId' => '12345456',
69
- 'amount'=>'106',
70
- 'orderSource'=>'ecomerce',
71
- 'card'=>{
72
- 'type'=>'VI',
73
- 'number' =>'4100000000000001',
74
- 'expDate' =>'1210'
75
- }}
76
- response= LitleOnlineRequest.new.credit(hash)
77
- assert(response.message =~ /Error validating xml data against the schema/)
78
- end
79
-
80
- def test_fields_out_of_order
81
- hash = {
82
- 'merchantId' => '101',
83
- 'version'=>'8.8',
84
- 'reportGroup'=>'Planets',
85
- 'orderId'=>'12344',
86
- 'card'=>{
87
- 'type'=>'VI',
88
- 'number' =>'4100000000000001',
89
- 'expDate' =>'1210'
90
- },
91
- 'orderSource'=>'ecommerce',
92
- 'amount'=>'106'
93
- }
94
- response= LitleOnlineRequest.new.credit(hash)
95
- assert_equal('Valid Format', response.message)
96
- end
97
-
98
- def test_invalid_field
99
- hash = {
100
- 'merchantId' => '101',
101
- 'version'=>'8.8',
102
- 'reportGroup'=>'Planets',
103
- 'orderId'=>'12344',
104
- 'amount'=>'106',
105
- 'orderSource'=>'ecommerce',
106
- 'card'=>{
107
- 'NOexistantField' => 'ShouldNotCauseError',
108
- 'type'=>'VI',
109
- 'number' =>'4100000000000001',
110
- 'expDate' =>'1210'
111
- }}
112
- response= LitleOnlineRequest.new.credit(hash)
113
- assert_equal('Valid Format', response.message)
114
- end
115
-
116
- def test_pay_pal_notes
117
- hash = {
118
- 'merchantId' => '101',
119
- 'version'=>'8.8',
120
- 'reportGroup'=>'Planets',
121
- 'orderId'=>'12344',
122
- 'amount'=>'106',
123
- 'payPalNotes'=>'Hello',
124
- 'orderSource'=>'ecommerce',
125
- 'card'=>{
126
- 'type'=>'VI',
127
- 'number' =>'4100000000000001',
128
- 'expDate' =>'1210'
129
- }}
130
- response= LitleOnlineRequest.new.credit(hash)
131
- assert_equal('Valid Format', response.message)
132
- end
133
-
134
- def test_processing_instructions_and_amex_data
135
- hash = {
136
- 'merchantId' => '101',
137
- 'version'=>'8.8',
138
- 'reportGroup'=>'Planets',
139
- 'amount'=>'2000',
140
- 'orderId'=>'12344',
141
- 'orderSource'=>'ecommerce',
142
- 'processingInstuctions'=>{'bypassVelocityCheck'=>'yes'},
143
- 'card'=>{
144
- 'type'=>'VI',
145
- 'number' =>'4100000000000001',
146
- 'expDate' =>'1210'},
147
- 'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234','sellerId'=>'1234Id'}
148
- }
149
- response= LitleOnlineRequest.new.credit(hash)
150
- assert_equal('Valid Format', response.message)
151
- end
152
-
153
- end
154
-
154
+ end
@@ -25,92 +25,93 @@ OTHER DEALINGS IN THE SOFTWARE.
25
25
  require 'lib/LitleOnline'
26
26
  require 'test/unit'
27
27
 
28
- class Test_echeckCredit < Test::Unit::TestCase
29
- def test_simple_echeckcredit
30
- hash = {
31
- 'merchantId' => '101',
32
- 'version'=>'8.8',
33
- 'reportGroup'=>'Planets',
34
- 'litleTxnId'=>'123456789101112',
35
- 'amount'=>'12'
36
- }
37
- response= LitleOnlineRequest.new.echeck_credit(hash)
38
- assert_equal('Valid Format', response.message)
39
- end
40
-
41
- def test_no_amount
42
- hash = {
43
- 'merchantId' => '101',
44
- 'version'=>'8.8',
45
- 'reportGroup'=>'Planets',
46
- }
47
- response = LitleOnlineRequest.new.echeck_credit(hash)
48
- assert_match /The content of element 'echeckCredit' is not complete/, response.message
49
- end
50
-
51
- def test_echeck_credit_with_echeck
52
- hash = {
53
- 'merchantId' => '101',
54
- 'version'=>'8.8',
55
- 'reportGroup'=>'Planets',
56
- 'amount'=>'123456',
57
- 'verify'=>'true',
58
- 'orderId'=>'12345',
59
- 'orderSource'=>'ecommerce',
60
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
61
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
62
- }
63
- response= LitleOnlineRequest.new.echeck_credit(hash)
64
- assert_equal('Valid Format', response.message)
65
- end
66
-
67
- def test_echeck_credit_with_echeck_token
68
- hash = {
69
- 'merchantId' => '101',
70
- 'version'=>'8.8',
71
- 'reportGroup'=>'Planets',
72
- 'amount'=>'123456',
73
- 'verify'=>'true',
74
- 'orderId'=>'12345',
75
- 'orderSource'=>'ecommerce',
76
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
77
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
78
- }
79
- response= LitleOnlineRequest.new.echeck_credit(hash)
80
- assert_equal('Valid Format', response.message)
81
- end
82
-
83
- def test_extra_field_and_incorrect_order
84
- hash = {
85
- 'merchantId' => '101',
86
- 'version'=>'8.8',
87
- 'reportGroup'=>'Planets',
88
- 'amount'=>'123',
89
- 'invalidfield'=>'nonexistant',
90
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
91
- 'verify'=>'true',
92
- 'orderId'=>'12345',
93
- 'orderSource'=>'ecommerce',
94
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
95
- }
96
- response= LitleOnlineRequest.new.echeck_credit(hash)
97
- assert_equal('Valid Format', response.message)
98
- end
99
-
100
- def test_extra_field_and_missing_billing
101
- hash = {
102
- 'merchantId' => '101',
103
- 'version'=>'8.8',
104
- 'reportGroup'=>'Planets',
105
- 'amount'=>'123',
106
- 'invalidfield'=>'nonexistant',
107
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
108
- 'verify'=>'true',
109
- 'orderId'=>'12345',
110
- 'orderSource'=>'ecommerce',
111
- }
112
- response= LitleOnlineRequest.new.echeck_credit(hash)
113
- assert(response.message =~ /Error validating xml data against the schema/)
28
+ module LitleOnline
29
+ class Test_echeckCredit < Test::Unit::TestCase
30
+ def test_simple_echeckcredit
31
+ hash = {
32
+ 'merchantId' => '101',
33
+ 'version'=>'8.8',
34
+ 'reportGroup'=>'Planets',
35
+ 'litleTxnId'=>'123456789101112',
36
+ 'amount'=>'12'
37
+ }
38
+ response= LitleOnlineRequest.new.echeck_credit(hash)
39
+ assert_equal('Valid Format', response.message)
40
+ end
41
+
42
+ def test_no_amount
43
+ hash = {
44
+ 'merchantId' => '101',
45
+ 'version'=>'8.8',
46
+ 'reportGroup'=>'Planets',
47
+ }
48
+ response = LitleOnlineRequest.new.echeck_credit(hash)
49
+ assert_match /The content of element 'echeckCredit' is not complete/, response.message
50
+ end
51
+
52
+ def test_echeck_credit_with_echeck
53
+ hash = {
54
+ 'merchantId' => '101',
55
+ 'version'=>'8.8',
56
+ 'reportGroup'=>'Planets',
57
+ 'amount'=>'123456',
58
+ 'verify'=>'true',
59
+ 'orderId'=>'12345',
60
+ 'orderSource'=>'ecommerce',
61
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
62
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
63
+ }
64
+ response= LitleOnlineRequest.new.echeck_credit(hash)
65
+ assert_equal('Valid Format', response.message)
66
+ end
67
+
68
+ def test_echeck_credit_with_echeck_token
69
+ hash = {
70
+ 'merchantId' => '101',
71
+ 'version'=>'8.8',
72
+ 'reportGroup'=>'Planets',
73
+ 'amount'=>'123456',
74
+ 'verify'=>'true',
75
+ 'orderId'=>'12345',
76
+ 'orderSource'=>'ecommerce',
77
+ 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
78
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
79
+ }
80
+ response= LitleOnlineRequest.new.echeck_credit(hash)
81
+ assert_equal('Valid Format', response.message)
82
+ end
83
+
84
+ def test_extra_field_and_incorrect_order
85
+ hash = {
86
+ 'merchantId' => '101',
87
+ 'version'=>'8.8',
88
+ 'reportGroup'=>'Planets',
89
+ 'amount'=>'123',
90
+ 'invalidfield'=>'nonexistant',
91
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
92
+ 'verify'=>'true',
93
+ 'orderId'=>'12345',
94
+ 'orderSource'=>'ecommerce',
95
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
96
+ }
97
+ response= LitleOnlineRequest.new.echeck_credit(hash)
98
+ assert_equal('Valid Format', response.message)
99
+ end
100
+
101
+ def test_extra_field_and_missing_billing
102
+ hash = {
103
+ 'merchantId' => '101',
104
+ 'version'=>'8.8',
105
+ 'reportGroup'=>'Planets',
106
+ 'amount'=>'123',
107
+ 'invalidfield'=>'nonexistant',
108
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
109
+ 'verify'=>'true',
110
+ 'orderId'=>'12345',
111
+ 'orderSource'=>'ecommerce',
112
+ }
113
+ response= LitleOnlineRequest.new.echeck_credit(hash)
114
+ assert(response.message =~ /Error validating xml data against the schema/)
115
+ end
114
116
  end
115
117
  end
116
-
@@ -25,88 +25,89 @@ OTHER DEALINGS IN THE SOFTWARE.
25
25
  require 'lib/LitleOnline'
26
26
  require 'test/unit'
27
27
 
28
- class Test_echeckRedeposit < Test::Unit::TestCase
29
- def test_simple_echeck_redeposit
30
- hash = {
31
- 'merchantId' => '101',
32
- 'version'=>'8.8',
33
- 'reportGroup'=>'Planets',
34
- 'litleTxnId'=>'123456'
35
- }
36
- response= LitleOnlineRequest.new.echeck_redeposit(hash)
37
- assert_equal('Valid Format', response.message)
28
+ module LitleOnline
29
+ class Test_echeckRedeposit < Test::Unit::TestCase
30
+ def test_simple_echeck_redeposit
31
+ hash = {
32
+ 'merchantId' => '101',
33
+ 'version'=>'8.8',
34
+ 'reportGroup'=>'Planets',
35
+ 'litleTxnId'=>'123456'
36
+ }
37
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
38
+ assert_equal('Valid Format', response.message)
39
+ end
40
+
41
+ def test_echeck_redeposit_with_echeck
42
+ hash = {
43
+ 'merchantId' => '101',
44
+ 'version'=>'8.8',
45
+ 'reportGroup'=>'Planets',
46
+ 'litleTxnId'=>'123456',
47
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
48
+ }
49
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
50
+ assert_equal('Valid Format', response.message)
51
+ end
52
+
53
+ def test_echeck_redeposit_with_echeck_token
54
+ hash = {
55
+ 'merchantId' => '101',
56
+ 'version'=>'8.8',
57
+ 'reportGroup'=>'Planets',
58
+ 'litleTxnId'=>'123456',
59
+ 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'}
60
+ }
61
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
62
+ assert_equal('Valid Format', response.message)
63
+ end
64
+
65
+ def test_extra_field_and_incorrect_order
66
+ hash = {
67
+ 'merchantId' => '101',
68
+ 'version'=>'8.8',
69
+ 'reportGroup'=>'Planets',
70
+ 'invalidfield'=>'nonexistant',
71
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
72
+ 'litleTxnId'=>'123456'
73
+ }
74
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
75
+ assert_equal('Valid Format', response.message)
76
+ end
77
+
78
+ def test_no_txn_id
79
+ hash = {
80
+ 'merchantId' => '101',
81
+ 'version'=>'8.8',
82
+ 'reportGroup'=>'Planets',
83
+ }
84
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
85
+ assert(response.message =~ /Error validating xml data against the schema/)
86
+ end
87
+
88
+ def test_echeck_redeposit_withecheckmissingfield
89
+ hash = {
90
+ 'merchantId' => '101',
91
+ 'version'=>'8.8',
92
+ 'reportGroup'=>'Planets',
93
+ 'litleTxnId'=>'123456',
94
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','checkNum'=>'123455'}
95
+ }
96
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
97
+ assert(response.message =~ /Error validating xml data against the schema/)
98
+ end
99
+
100
+ def test_echeck_redeposit_with_echeck_token_missing_field
101
+ hash = {
102
+ 'merchantId' => '101',
103
+ 'version'=>'8.8',
104
+ 'reportGroup'=>'Planets',
105
+ 'litleTxnId'=>'123456',
106
+ 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','checkNum'=>'123455'}
107
+ }
108
+ response= LitleOnlineRequest.new.echeck_redeposit(hash)
109
+ assert(response.message =~ /Error validating xml data against the schema/)
110
+ end
111
+
38
112
  end
39
-
40
- def test_echeck_redeposit_with_echeck
41
- hash = {
42
- 'merchantId' => '101',
43
- 'version'=>'8.8',
44
- 'reportGroup'=>'Planets',
45
- 'litleTxnId'=>'123456',
46
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
47
- }
48
- response= LitleOnlineRequest.new.echeck_redeposit(hash)
49
- assert_equal('Valid Format', response.message)
50
- end
51
-
52
- def test_echeck_redeposit_with_echeck_token
53
- hash = {
54
- 'merchantId' => '101',
55
- 'version'=>'8.8',
56
- 'reportGroup'=>'Planets',
57
- 'litleTxnId'=>'123456',
58
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'}
59
- }
60
- response= LitleOnlineRequest.new.echeck_redeposit(hash)
61
- assert_equal('Valid Format', response.message)
62
- end
63
-
64
- def test_extra_field_and_incorrect_order
65
- hash = {
66
- 'merchantId' => '101',
67
- 'version'=>'8.8',
68
- 'reportGroup'=>'Planets',
69
- 'invalidfield'=>'nonexistant',
70
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
71
- 'litleTxnId'=>'123456'
72
- }
73
- response= LitleOnlineRequest.new.echeck_redeposit(hash)
74
- assert_equal('Valid Format', response.message)
75
- end
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
-
111
- end
112
-
113
+ end