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,135 +25,136 @@ OTHER DEALINGS IN THE SOFTWARE.
25
25
  require 'lib/LitleOnline'
26
26
  require 'test/unit'
27
27
 
28
- class Test_echeckSale < Test::Unit::TestCase
29
- def test_echeck_sale_with_echeck
30
- hash = {
31
- 'merchantId' => '101',
32
- 'version'=>'8.8',
33
- 'reportGroup'=>'Planets',
34
- 'amount'=>'123456',
35
- 'verify'=>'true',
36
- 'orderId'=>'12345',
37
- 'orderSource'=>'ecommerce',
38
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
39
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
40
- }
41
- response= LitleOnlineRequest.new.echeck_sale(hash)
42
- assert_equal('Valid Format', response.message)
28
+ module LitleOnline
29
+ class Test_echeckSale < Test::Unit::TestCase
30
+ def test_echeck_sale_with_echeck
31
+ hash = {
32
+ 'merchantId' => '101',
33
+ 'version'=>'8.8',
34
+ 'reportGroup'=>'Planets',
35
+ 'amount'=>'123456',
36
+ 'verify'=>'true',
37
+ 'orderId'=>'12345',
38
+ 'orderSource'=>'ecommerce',
39
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
40
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
41
+ }
42
+ response= LitleOnlineRequest.new.echeck_sale(hash)
43
+ assert_equal('Valid Format', response.message)
44
+ end
45
+
46
+ def test_no_amount
47
+ hash = {
48
+ 'merchantId' => '101',
49
+ 'version'=>'8.8',
50
+ 'reportGroup'=>'Planets'
51
+ }
52
+ response = LitleOnlineRequest.new.echeck_sale(hash)
53
+ assert_match /The content of element 'echeckSale' is not complete/, response.message
54
+ end
55
+
56
+ def test_echeck_sale_with_echeck
57
+ hash = {
58
+ 'merchantId' => '101',
59
+ 'version'=>'8.8',
60
+ 'reportGroup'=>'Planets',
61
+ 'amount'=>'123456',
62
+ 'verify'=>'true',
63
+ 'orderId'=>'12345',
64
+ 'orderSource'=>'ecommerce',
65
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
66
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
67
+ }
68
+ response= LitleOnlineRequest.new.echeck_sale(hash)
69
+ assert_equal('Valid Format', response.message)
70
+ end
71
+
72
+ def test_echeck_sale_with_ship_to
73
+ hash = {
74
+ 'merchantId' => '101',
75
+ 'version'=>'8.8',
76
+ 'reportGroup'=>'Planets',
77
+ 'amount'=>'123456',
78
+ 'verify'=>'true',
79
+ 'orderId'=>'12345',
80
+ 'orderSource'=>'ecommerce',
81
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
82
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
83
+ 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
84
+ }
85
+ response= LitleOnlineRequest.new.echeck_sale(hash)
86
+ assert_equal('Valid Format', response.message)
87
+ end
88
+
89
+ def test_echeck_sale_with_echeck_token
90
+ hash = {
91
+ 'merchantId' => '101',
92
+ 'version'=>'8.8',
93
+ 'reportGroup'=>'Planets',
94
+ 'amount'=>'123456',
95
+ 'verify'=>'true',
96
+ 'orderId'=>'12345',
97
+ 'orderSource'=>'ecommerce',
98
+ 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
99
+ 'customBilling'=>{'phone'=>'123456789','descriptor'=>'good'},
100
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
101
+ }
102
+ response= LitleOnlineRequest.new.echeck_sale(hash)
103
+ assert_equal('Valid Format', response.message)
104
+ end
105
+
106
+ def test_extra_field_and_incorrect_order
107
+ hash = {
108
+ 'merchantId' => '101',
109
+ 'version'=>'8.8',
110
+ 'reportGroup'=>'Planets',
111
+ 'amount'=>'123',
112
+ 'invalidfield'=>'nonexistant',
113
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
114
+ 'verify'=>'true',
115
+ 'orderId'=>'12345',
116
+ 'orderSource'=>'ecommerce',
117
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
118
+ }
119
+ response= LitleOnlineRequest.new.echeck_sale(hash)
120
+ assert_equal('Valid Format', response.message)
121
+ end
122
+
123
+ def test_extra_field_and_missing_billing
124
+ hash = {
125
+ 'merchantId' => '101',
126
+ 'version'=>'8.8',
127
+ 'reportGroup'=>'Planets',
128
+ 'amount'=>'123',
129
+ 'invalidfield'=>'nonexistant',
130
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
131
+ 'verify'=>'true',
132
+ 'orderId'=>'12345',
133
+ 'orderSource'=>'ecommerce',
134
+ }
135
+ response= LitleOnlineRequest.new.echeck_sale(hash)
136
+ assert(response.message =~ /Error validating xml data against the schema/)
137
+ end
138
+
139
+ def test_simple_echeck_sale
140
+ hash = {
141
+ 'reportGroup'=>'Planets',
142
+ 'litleTxnId'=>'123456789101112',
143
+ 'amount'=>'12'
144
+ }
145
+ response= LitleOnlineRequest.new.echeck_sale(hash)
146
+ assert_equal('Valid Format', response.message)
147
+ end
148
+
149
+ def test_simple_echeck_sale_with_custom_billing
150
+ hash = {
151
+ 'reportGroup'=>'Planets',
152
+ 'litleTxnId'=>'123456',
153
+ 'amount'=>'10',
154
+ }
155
+ response= LitleOnlineRequest.new.echeck_sale(hash)
156
+ assert_equal('Valid Format', response.message)
157
+ end
158
+
43
159
  end
44
-
45
- def test_no_amount
46
- hash = {
47
- 'merchantId' => '101',
48
- 'version'=>'8.8',
49
- 'reportGroup'=>'Planets'
50
- }
51
- response = LitleOnlineRequest.new.echeck_sale(hash)
52
- assert_match /The content of element 'echeckSale' is not complete/, response.message
53
- end
54
-
55
- def test_echeck_sale_with_echeck
56
- hash = {
57
- 'merchantId' => '101',
58
- 'version'=>'8.8',
59
- 'reportGroup'=>'Planets',
60
- 'amount'=>'123456',
61
- 'verify'=>'true',
62
- 'orderId'=>'12345',
63
- 'orderSource'=>'ecommerce',
64
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
65
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
66
- }
67
- response= LitleOnlineRequest.new.echeck_sale(hash)
68
- assert_equal('Valid Format', response.message)
69
- end
70
-
71
- def test_echeck_sale_with_ship_to
72
- hash = {
73
- 'merchantId' => '101',
74
- 'version'=>'8.8',
75
- 'reportGroup'=>'Planets',
76
- 'amount'=>'123456',
77
- 'verify'=>'true',
78
- 'orderId'=>'12345',
79
- 'orderSource'=>'ecommerce',
80
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
81
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
82
- 'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
83
- }
84
- response= LitleOnlineRequest.new.echeck_sale(hash)
85
- assert_equal('Valid Format', response.message)
86
- end
87
-
88
- def test_echeck_sale_with_echeck_token
89
- hash = {
90
- 'merchantId' => '101',
91
- 'version'=>'8.8',
92
- 'reportGroup'=>'Planets',
93
- 'amount'=>'123456',
94
- 'verify'=>'true',
95
- 'orderId'=>'12345',
96
- 'orderSource'=>'ecommerce',
97
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
98
- 'customBilling'=>{'phone'=>'123456789','descriptor'=>'good'},
99
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
100
- }
101
- response= LitleOnlineRequest.new.echeck_sale(hash)
102
- assert_equal('Valid Format', response.message)
103
- end
104
-
105
- def test_extra_field_and_incorrect_order
106
- hash = {
107
- 'merchantId' => '101',
108
- 'version'=>'8.8',
109
- 'reportGroup'=>'Planets',
110
- 'amount'=>'123',
111
- 'invalidfield'=>'nonexistant',
112
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
113
- 'verify'=>'true',
114
- 'orderId'=>'12345',
115
- 'orderSource'=>'ecommerce',
116
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
117
- }
118
- response= LitleOnlineRequest.new.echeck_sale(hash)
119
- assert_equal('Valid Format', response.message)
120
- end
121
-
122
- def test_extra_field_and_missing_billing
123
- hash = {
124
- 'merchantId' => '101',
125
- 'version'=>'8.8',
126
- 'reportGroup'=>'Planets',
127
- 'amount'=>'123',
128
- 'invalidfield'=>'nonexistant',
129
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
130
- 'verify'=>'true',
131
- 'orderId'=>'12345',
132
- 'orderSource'=>'ecommerce',
133
- }
134
- response= LitleOnlineRequest.new.echeck_sale(hash)
135
- assert(response.message =~ /Error validating xml data against the schema/)
136
- end
137
-
138
- def test_simple_echeck_sale
139
- hash = {
140
- 'reportGroup'=>'Planets',
141
- 'litleTxnId'=>'123456789101112',
142
- 'amount'=>'12'
143
- }
144
- response= LitleOnlineRequest.new.echeck_sale(hash)
145
- assert_equal('Valid Format', response.message)
146
- end
147
-
148
- def test_simple_echeck_sale_with_custom_billing
149
- hash = {
150
- 'reportGroup'=>'Planets',
151
- 'litleTxnId'=>'123456',
152
- 'amount'=>'10',
153
- }
154
- response= LitleOnlineRequest.new.echeck_sale(hash)
155
- assert_equal('Valid Format', response.message)
156
- end
157
-
158
- end
159
-
160
+ end
@@ -25,101 +25,103 @@ OTHER DEALINGS IN THE SOFTWARE.
25
25
  require 'lib/LitleOnline'
26
26
  require 'test/unit'
27
27
 
28
- class Test_echeckVerification < Test::Unit::TestCase
29
-
30
- def test_simple_echeck_verification
31
- hash = {
32
- 'merchantId' => '101',
33
- 'version'=>'8.8',
34
- 'reportGroup'=>'Planets',
35
- 'amount'=>'123456',
36
- 'orderId'=>'12345',
37
- 'orderSource'=>'ecommerce',
38
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
39
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
40
- }
41
- response= LitleOnlineRequest.new.echeck_verification(hash)
42
- assert_equal('Valid Format', response.message)
43
- end
44
-
45
- def test_echeck_verification_with_echeck_token
46
- hash = {
47
- 'merchantId' => '101',
48
- 'version'=>'8.8',
49
- 'reportGroup'=>'Planets',
50
- 'amount'=>'123456',
51
- 'orderId'=>'12345',
52
- 'orderSource'=>'ecommerce',
53
- 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
54
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
55
- }
56
- response= LitleOnlineRequest.new.echeck_verification(hash)
57
- assert_equal('Valid Format', response.message)
58
- end
59
-
60
- def test_extra_field_and_incorrect_order
61
- hash = {
62
- 'merchantId' => '101',
63
- 'version'=>'8.8',
64
- 'reportGroup'=>'Planets',
65
- 'amount'=>'123',
66
- 'invalidfield'=>'nonexistant',
67
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
68
- 'orderId'=>'12345',
69
- 'orderSource'=>'ecommerce',
70
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
71
- }
72
- response= LitleOnlineRequest.new.echeck_verification(hash)
73
- assert_equal('Valid Format', response.message)
74
- end
75
-
76
- def test_extra_field_and_missing_billing
77
- hash = {
78
- 'merchantId' => '101',
79
- 'version'=>'8.8',
80
- 'reportGroup'=>'Planets',
81
- 'amount'=>'123',
82
- 'invalidfield'=>'nonexistant',
83
- 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
84
- 'orderId'=>'12345',
85
- 'orderSource'=>'ecommerce',
86
- }
87
- response= LitleOnlineRequest.new.echeck_verification(hash)
88
- assert(response.message =~ /Error validating xml data against the schema/)
89
- end
28
+ module LitleOnline
29
+ class Test_echeckVerification < Test::Unit::TestCase
30
+
31
+ def test_simple_echeck_verification
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'amount'=>'123456',
37
+ 'orderId'=>'12345',
38
+ 'orderSource'=>'ecommerce',
39
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
40
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
41
+ }
42
+ response= LitleOnlineRequest.new.echeck_verification(hash)
43
+ assert_equal('Valid Format', response.message)
44
+ end
45
+
46
+ def test_echeck_verification_with_echeck_token
47
+ hash = {
48
+ 'merchantId' => '101',
49
+ 'version'=>'8.8',
50
+ 'reportGroup'=>'Planets',
51
+ 'amount'=>'123456',
52
+ 'orderId'=>'12345',
53
+ 'orderSource'=>'ecommerce',
54
+ 'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
55
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
56
+ }
57
+ response= LitleOnlineRequest.new.echeck_verification(hash)
58
+ assert_equal('Valid Format', response.message)
59
+ end
60
+
61
+ def test_extra_field_and_incorrect_order
62
+ hash = {
63
+ 'merchantId' => '101',
64
+ 'version'=>'8.8',
65
+ 'reportGroup'=>'Planets',
66
+ 'amount'=>'123',
67
+ 'invalidfield'=>'nonexistant',
68
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
69
+ 'orderId'=>'12345',
70
+ 'orderSource'=>'ecommerce',
71
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
72
+ }
73
+ response= LitleOnlineRequest.new.echeck_verification(hash)
74
+ assert_equal('Valid Format', response.message)
75
+ end
76
+
77
+ def test_extra_field_and_missing_billing
78
+ hash = {
79
+ 'merchantId' => '101',
80
+ 'version'=>'8.8',
81
+ 'reportGroup'=>'Planets',
82
+ 'amount'=>'123',
83
+ 'invalidfield'=>'nonexistant',
84
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
85
+ 'orderId'=>'12345',
86
+ 'orderSource'=>'ecommerce',
87
+ }
88
+ response= LitleOnlineRequest.new.echeck_verification(hash)
89
+ assert(response.message =~ /Error validating xml data against the schema/)
90
+ end
91
+
92
+ def test_no_amount
93
+ hash = {
94
+ 'merchantId' => '101',
95
+ 'version'=>'8.8',
96
+ 'reportGroup'=>'Planets',
97
+ 'orderId'=>'12345'
98
+ }
99
+ response= LitleOnlineRequest.new.echeck_verification(hash)
100
+ assert(response.message =~ /Error validating xml data against the schema/)
101
+ end
102
+
103
+ def test_no_order_id
104
+ hash = {
105
+ 'merchantId' => '101',
106
+ 'version'=>'8.8',
107
+ 'reportGroup'=>'Planets',
108
+ }
109
+ response= LitleOnlineRequest.new.echeck_verification(hash)
110
+ assert(response.message =~ /Error validating xml data against the schema/)
111
+ end
112
+
113
+ def test_no_order_source
114
+ hash = {
115
+ 'merchantId' => '101',
116
+ 'version'=>'8.8',
117
+ 'reportGroup'=>'Planets',
118
+ 'amount'=>'123456',
119
+ 'orderId'=>'12345'
120
+ }
121
+ response= LitleOnlineRequest.new.echeck_verification(hash)
122
+ assert(response.message =~ /Error validating xml data against the schema/)
123
+ end
90
124
 
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
125
  end
123
126
 
124
- end
125
-
127
+ end