LitleOnline 8.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/DESCRIPTION +5 -0
- data/LICENSE +22 -0
- data/README.md +69 -0
- data/Rakefile +92 -0
- data/SETUP.md +47 -0
- data/bin/Setup.rb +103 -0
- data/bin/sample_driver.rb +49 -0
- data/index.html +176 -0
- data/index.html.1 +176 -0
- data/lib/Checker.rb +56 -0
- data/lib/Communications.rb +85 -0
- data/lib/Configuration.rb +45 -0
- data/lib/LitleOnline.rb +52 -0
- data/lib/LitleOnlineRequest.rb +399 -0
- data/lib/LitleXmlMapper.rb +48 -0
- data/lib/Obj2xml.rb +37 -0
- data/lib/XMLFields.rb +378 -0
- data/test/certification/certTest1_base.rb +948 -0
- data/test/certification/certTest2_authenhanced.rb +571 -0
- data/test/certification/certTest3_authreversal.rb +184 -0
- data/test/certification/certTest4_echeck.rb +279 -0
- data/test/certification/certTest5_token.rb +222 -0
- data/test/certification/ts_all.rb +31 -0
- data/test/functional/test_auth.rb +135 -0
- data/test/functional/test_authReversal.rb +68 -0
- data/test/functional/test_capture.rb +71 -0
- data/test/functional/test_captureGivenAuth.rb +161 -0
- data/test/functional/test_credit.rb +154 -0
- data/test/functional/test_echeckCredit.rb +116 -0
- data/test/functional/test_echeckRedeposit.rb +78 -0
- data/test/functional/test_echeckSale.rb +157 -0
- data/test/functional/test_echeckVerification.rb +92 -0
- data/test/functional/test_forceCapture.rb +105 -0
- data/test/functional/test_sale.rb +198 -0
- data/test/functional/test_token.rb +102 -0
- data/test/functional/test_xmlfields.rb +403 -0
- data/test/functional/ts_all.rb +39 -0
- data/test/unit/test_Checker.rb +58 -0
- data/test/unit/test_LitleOnlineRequest.rb +288 -0
- data/test/unit/test_auth.rb +168 -0
- data/test/unit/test_authReversal.rb +41 -0
- data/test/unit/test_capture.rb +40 -0
- data/test/unit/test_captureGivenAuth.rb +108 -0
- data/test/unit/test_credit.rb +117 -0
- data/test/unit/test_echeckCredit.rb +45 -0
- data/test/unit/test_echeckRedeposit.rb +76 -0
- data/test/unit/test_echeckSale.rb +45 -0
- data/test/unit/test_echeckVerification.rb +75 -0
- data/test/unit/test_forceCapture.rb +122 -0
- data/test/unit/test_sale.rb +249 -0
- data/test/unit/test_token.rb +70 -0
- data/test/unit/test_xmlfields.rb +173 -0
- data/test/unit/ts_unit.rb +41 -0
- metadata +166 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require 'lib/LitleOnline'
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
class TestAuthReversal < Test::Unit::TestCase
|
29
|
+
def test_noLitleTxnId
|
30
|
+
hash = {
|
31
|
+
'merchantId' => '101',
|
32
|
+
'version'=>'8.8',
|
33
|
+
'reportGroup'=>'12345678',
|
34
|
+
'amount'=>'106',
|
35
|
+
'payPalNotes'=>'Notes'
|
36
|
+
}
|
37
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authReversal(hash)}
|
38
|
+
assert_match /Missing Required Field: litleTxnId!!!!/, exception.message
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require 'lib/LitleOnline'
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
class Test_capture < Test::Unit::TestCase
|
29
|
+
def test_noTxnId
|
30
|
+
hash = {
|
31
|
+
'merchantId' => '101',
|
32
|
+
'version'=>'8.8',
|
33
|
+
'reportGroup'=>'Planets',
|
34
|
+
'amount'=>'106',
|
35
|
+
}
|
36
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture(hash)}
|
37
|
+
assert_match /Missing Required Field: litleTxnId!!!!/, exception.message
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
@@ -0,0 +1,108 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require 'lib/LitleOnline'
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
class TestcaptureGivenAuth < Test::Unit::TestCase
|
29
|
+
def test_noamount
|
30
|
+
hash = {
|
31
|
+
'merchantId' => '101',
|
32
|
+
'version'=>'8.8',
|
33
|
+
'reportGroup'=>'Planets',
|
34
|
+
'orderId'=>'12344',
|
35
|
+
'authInformation' => {
|
36
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
37
|
+
'authAmount'=>'12345'
|
38
|
+
},
|
39
|
+
'orderSource'=>'ecommerce',
|
40
|
+
'card'=>{
|
41
|
+
'type'=>'VI',
|
42
|
+
'number' =>'4100000000000001',
|
43
|
+
'expDate' =>'1210'
|
44
|
+
}}
|
45
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.captureGivenAuth(hash)}
|
46
|
+
assert_match /Missing Required Field: amount!!!!/, exception.message
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_BothChoicesCardandToken
|
50
|
+
hash = {
|
51
|
+
'merchantId' => '101',
|
52
|
+
'version'=>'8.8',
|
53
|
+
'reportGroup'=>'Planets',
|
54
|
+
'orderId'=>'12344',
|
55
|
+
'amount'=>'106',
|
56
|
+
'orderSource'=>'ecommerce',
|
57
|
+
'authInformation' => {
|
58
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
59
|
+
'authAmount'=>'12345'
|
60
|
+
},
|
61
|
+
'token'=> {
|
62
|
+
'litleToken'=>'123456789101112',
|
63
|
+
'expDate'=>'1210',
|
64
|
+
'cardValidationNum'=>'555',
|
65
|
+
'type'=>'VI'},
|
66
|
+
'card'=>{
|
67
|
+
'type'=>'VI',
|
68
|
+
'number' =>'4100000000000001',
|
69
|
+
'expDate' =>'1210'
|
70
|
+
}}
|
71
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.captureGivenAuth(hash)}
|
72
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_allthreechoices
|
76
|
+
hash = {
|
77
|
+
'merchantId' => '101',
|
78
|
+
'version'=>'8.8',
|
79
|
+
'reportGroup'=>'Planets',
|
80
|
+
'orderId'=>'12344',
|
81
|
+
'amount'=>'106',
|
82
|
+
'orderSource'=>'ecommerce',
|
83
|
+
'authInformation' => {
|
84
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
85
|
+
'authAmount'=>'12345'
|
86
|
+
},
|
87
|
+
'card'=>{
|
88
|
+
'type'=>'VI',
|
89
|
+
'number' =>'4100000000000001',
|
90
|
+
'expDate' =>'1210'
|
91
|
+
},
|
92
|
+
'paypage'=> {
|
93
|
+
'paypageRegistrationId'=>'1234',
|
94
|
+
'expDate'=>'1210',
|
95
|
+
'cardValidationNum'=>'555',
|
96
|
+
'type'=>'VI'},
|
97
|
+
'token'=> {
|
98
|
+
'litleToken'=>'1234',
|
99
|
+
'expDate'=>'1210',
|
100
|
+
'cardValidationNum'=>'555',
|
101
|
+
'type'=>'VI'
|
102
|
+
}}
|
103
|
+
|
104
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.captureGivenAuth(hash)}
|
105
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
@@ -0,0 +1,117 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require 'lib/LitleOnline'
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
class TestCredit < Test::Unit::TestCase
|
29
|
+
def test_BothChoicesCardandPaypal
|
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
|
+
'paypal'=>{
|
43
|
+
'payerId'=>'1234',
|
44
|
+
'token'=>'1234',
|
45
|
+
'transactionId'=>'123456'
|
46
|
+
}}
|
47
|
+
|
48
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
49
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_threeChoicesCardandPaypageandPaypal
|
53
|
+
hash = {
|
54
|
+
'merchantId' => '101',
|
55
|
+
'version'=>'8.8',
|
56
|
+
'reportGroup'=>'Planets',
|
57
|
+
'orderId'=>'12344',
|
58
|
+
'amount'=>'106',
|
59
|
+
'orderSource'=>'ecommerce',
|
60
|
+
'card'=>{
|
61
|
+
'type'=>'VI',
|
62
|
+
'number' =>'4100000000000001',
|
63
|
+
'expDate' =>'1210'
|
64
|
+
},
|
65
|
+
'paypage'=> {
|
66
|
+
'paypageRegistrationId'=>'1234',
|
67
|
+
'expDate'=>'1210',
|
68
|
+
'cardValidationNum'=>'555',
|
69
|
+
'type'=>'VI'},
|
70
|
+
'paypal'=>{
|
71
|
+
'payerId'=>'1234',
|
72
|
+
'token'=>'1234',
|
73
|
+
'transactionId'=>'123456'
|
74
|
+
}}
|
75
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
76
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_allChoicesCardandPaypageandPaypalandToken
|
80
|
+
hash = {
|
81
|
+
'merchantId' => '101',
|
82
|
+
'version'=>'8.8',
|
83
|
+
'reportGroup'=>'Planets',
|
84
|
+
'litleTxnId'=>'123456',
|
85
|
+
'orderId'=>'12344',
|
86
|
+
'amount'=>'106',
|
87
|
+
'orderSource'=>'ecommerce',
|
88
|
+
'fraudCheck'=>{'authenticationTransactionId'=>'123'},
|
89
|
+
'bypassVelocityCheckcardholderAuthentication'=>{'authenticationTransactionId'=>'123'},
|
90
|
+
'card'=>{
|
91
|
+
'type'=>'VI',
|
92
|
+
'number' =>'4100000000000001',
|
93
|
+
'expDate' =>'1210'
|
94
|
+
},
|
95
|
+
'paypage'=> {
|
96
|
+
'paypageRegistrationId'=>'1234',
|
97
|
+
'expDate'=>'1210',
|
98
|
+
'cardValidationNum'=>'555',
|
99
|
+
'type'=>'VI'},
|
100
|
+
'paypal'=>{
|
101
|
+
'payerId'=>'1234',
|
102
|
+
'token'=>'1234',
|
103
|
+
'transactionId'=>'123456'},
|
104
|
+
'token'=> {
|
105
|
+
'litleToken'=>'1234',
|
106
|
+
'expDate'=>'1210',
|
107
|
+
'cardValidationNum'=>'555',
|
108
|
+
'type'=>'VI'
|
109
|
+
}}
|
110
|
+
|
111
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
112
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
113
|
+
end
|
114
|
+
|
115
|
+
|
116
|
+
end
|
117
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require 'lib/LitleOnline'
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
class Test_echeckCredit < Test::Unit::TestCase
|
29
|
+
|
30
|
+
|
31
|
+
def test_echeckCredit_withBOTH
|
32
|
+
hash = {
|
33
|
+
'merchantId' => '101',
|
34
|
+
'version'=>'8.8',
|
35
|
+
'reportGroup'=>'Planets',
|
36
|
+
'litleTxnId'=>'123456',
|
37
|
+
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
38
|
+
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
39
|
+
}
|
40
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeckCredit(hash)}
|
41
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
@@ -0,0 +1,76 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require 'lib/LitleOnline'
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
class Test_echeckRedeposit < Test::Unit::TestCase
|
29
|
+
def test_noTXNId
|
30
|
+
hash = {
|
31
|
+
'merchantId' => '101',
|
32
|
+
'version'=>'8.8',
|
33
|
+
'reportGroup'=>'Planets',
|
34
|
+
}
|
35
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeckRedeposit(hash)}
|
36
|
+
assert_match /Missing Required Field: litleTxnId!!!!/, exception.message
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_echeckRedeposit_withecheckmissingfield
|
40
|
+
hash = {
|
41
|
+
'merchantId' => '101',
|
42
|
+
'version'=>'8.8',
|
43
|
+
'reportGroup'=>'Planets',
|
44
|
+
'litleTxnId'=>'123456',
|
45
|
+
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','checkNum'=>'123455'}
|
46
|
+
}
|
47
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeckRedeposit(hash)}
|
48
|
+
assert_match /Missing Required Field: routingNum!!!!/, exception.message
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_echeckRedeposit_withecheckTokenmssingfield
|
52
|
+
hash = {
|
53
|
+
'merchantId' => '101',
|
54
|
+
'version'=>'8.8',
|
55
|
+
'reportGroup'=>'Planets',
|
56
|
+
'litleTxnId'=>'123456',
|
57
|
+
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','checkNum'=>'123455'}
|
58
|
+
}
|
59
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeckRedeposit(hash)}
|
60
|
+
assert_match /Missing Required Field: routingNum!!!!/, exception.message
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_echeckRedeposit_withBOTH
|
64
|
+
hash = {
|
65
|
+
'merchantId' => '101',
|
66
|
+
'version'=>'8.8',
|
67
|
+
'reportGroup'=>'Planets',
|
68
|
+
'litleTxnId'=>'123456',
|
69
|
+
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
70
|
+
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
71
|
+
}
|
72
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeckRedeposit(hash)}
|
73
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2012 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require 'lib/LitleOnline'
|
26
|
+
require 'test/unit'
|
27
|
+
|
28
|
+
class Test_echeckSale < Test::Unit::TestCase
|
29
|
+
|
30
|
+
|
31
|
+
def test_echeckSale_withBOTH
|
32
|
+
hash = {
|
33
|
+
'merchantId' => '101',
|
34
|
+
'version'=>'8.8',
|
35
|
+
'reportGroup'=>'Planets',
|
36
|
+
'litleTxnId'=>'123456',
|
37
|
+
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
38
|
+
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
39
|
+
}
|
40
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeckSale(hash)}
|
41
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|