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,173 @@
|
|
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 TestXmlfields < Test::Unit::TestCase
|
29
|
+
|
30
|
+
def test_cardbothtypeandtrack
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'litleTxnId'=>'123456',
|
36
|
+
'orderId'=>'12344',
|
37
|
+
'amount'=>'106',
|
38
|
+
'orderSource'=>'ecommerce',
|
39
|
+
'card'=>{
|
40
|
+
'type'=>'VI',
|
41
|
+
'track'=>'1234',
|
42
|
+
'number' =>'4100000000000001',
|
43
|
+
'expDate' =>'1210'
|
44
|
+
}}
|
45
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
46
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_customBillingwithtwoChoices
|
50
|
+
hash = {
|
51
|
+
'merchantId' => '101',
|
52
|
+
'version'=>'8.8',
|
53
|
+
'reportGroup'=>'Planets',
|
54
|
+
'litleTxnId'=>'123456',
|
55
|
+
'orderId'=>'12344',
|
56
|
+
'amount'=>'106',
|
57
|
+
'orderSource'=>'ecommerce',
|
58
|
+
'customBilling'=>{'phone'=>'1234567890','url'=>'www.litle.com'},
|
59
|
+
'card'=>{
|
60
|
+
'type'=>'VI',
|
61
|
+
'number' =>'4100000000000001',
|
62
|
+
'expDate' =>'1210'
|
63
|
+
}}
|
64
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
65
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_customBillingwiththreeChoices
|
69
|
+
hash = {
|
70
|
+
'merchantId' => '101',
|
71
|
+
'version'=>'8.8',
|
72
|
+
'reportGroup'=>'Planets',
|
73
|
+
'litleTxnId'=>'123456',
|
74
|
+
'orderId'=>'12344',
|
75
|
+
'amount'=>'106',
|
76
|
+
'orderSource'=>'ecommerce',
|
77
|
+
'customBilling'=>{'phone'=>'123456789','url'=>'www.litle.com','city'=>'lowell'},
|
78
|
+
'card'=>{
|
79
|
+
'type'=>'VI',
|
80
|
+
'number' =>'4100000000000001',
|
81
|
+
'expDate' =>'1210'
|
82
|
+
}}
|
83
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
84
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_paypalmissingPayerid
|
88
|
+
hash = {
|
89
|
+
'merchantId' => '101',
|
90
|
+
'version'=>'8.8',
|
91
|
+
'reportGroup'=>'Planets',
|
92
|
+
'litleTxnId'=>'123456',
|
93
|
+
'orderId'=>'12344',
|
94
|
+
'amount'=>'106',
|
95
|
+
'orderSource'=>'ecommerce',
|
96
|
+
'paypal'=>{
|
97
|
+
'token'=>'1234',
|
98
|
+
'transactionId'=>'123456'
|
99
|
+
}}
|
100
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
101
|
+
assert_match /Missing Required Field: payerId!!!!/, exception.message
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_paypalmissingtransactionId
|
105
|
+
hash = {
|
106
|
+
'merchantId' => '101',
|
107
|
+
'version'=>'8.8',
|
108
|
+
'reportGroup'=>'Planets',
|
109
|
+
'litleTxnId'=>'123456',
|
110
|
+
'orderId'=>'12344',
|
111
|
+
'amount'=>'106',
|
112
|
+
'orderSource'=>'ecommerce',
|
113
|
+
'paypal'=>{
|
114
|
+
'token'=>'1234',
|
115
|
+
'payerId'=>'123456'
|
116
|
+
}}
|
117
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
118
|
+
assert_match /Missing Required Field: transactionId!!!!/, exception.message
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_poswithoutCapability
|
122
|
+
hash = {
|
123
|
+
'merchantId' => '101',
|
124
|
+
'version'=>'8.8',
|
125
|
+
'reportGroup'=>'Planets',
|
126
|
+
'orderId'=>'12344',
|
127
|
+
'amount'=>'106',
|
128
|
+
'orderSource'=>'ecommerce',
|
129
|
+
'pos'=>{'entryMode'=>'track1','cardholderId'=>'pin'},
|
130
|
+
'card'=>{
|
131
|
+
'type'=>'VI',
|
132
|
+
'number' =>'4100000000000001',
|
133
|
+
'expDate' =>'1210'
|
134
|
+
}}
|
135
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
136
|
+
assert_match /Missing Required Field: capability!!!!/, exception.message
|
137
|
+
end
|
138
|
+
|
139
|
+
def test_tokenmissingtoken
|
140
|
+
hash = {
|
141
|
+
'merchantId' => '101',
|
142
|
+
'version'=>'8.8',
|
143
|
+
'reportGroup'=>'Planets',
|
144
|
+
'orderId'=>'12344',
|
145
|
+
'amount'=>'106',
|
146
|
+
'orderSource'=>'ecommerce',
|
147
|
+
'token'=> {
|
148
|
+
'expDate'=>'1210',
|
149
|
+
'cardValidationNum'=>'555',
|
150
|
+
'type'=>'VI'
|
151
|
+
}}
|
152
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
153
|
+
assert_match /Missing Required Field: litleToken!!!!/, exception.message
|
154
|
+
end
|
155
|
+
|
156
|
+
def test_paypagemissingId
|
157
|
+
hash = {
|
158
|
+
'merchantId' => '101',
|
159
|
+
'version'=>'8.8',
|
160
|
+
'reportGroup'=>'Planets',
|
161
|
+
'orderId'=>'12344',
|
162
|
+
'amount'=>'106',
|
163
|
+
'orderSource'=>'ecommerce',
|
164
|
+
'paypage'=> {
|
165
|
+
'expDate'=>'1210',
|
166
|
+
'cardValidationNum'=>'555',
|
167
|
+
'type'=>'VI'
|
168
|
+
}}
|
169
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
170
|
+
assert_match /Missing Required Field: paypageRegistrationId!!!!/, exception.message
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2011 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 'test/unit'
|
26
|
+
require_relative 'test_LitleOnlineRequest'
|
27
|
+
require_relative 'test_Checker'
|
28
|
+
|
29
|
+
require_relative 'test_xmlfields'
|
30
|
+
require_relative 'test_sale'
|
31
|
+
require_relative 'test_auth'
|
32
|
+
require_relative 'test_authReversal'
|
33
|
+
require_relative 'test_credit'
|
34
|
+
require_relative 'test_token'
|
35
|
+
require_relative 'test_forceCapture'
|
36
|
+
require_relative 'test_capture'
|
37
|
+
require_relative 'test_captureGivenAuth'
|
38
|
+
require_relative 'test_echeckRedeposit'
|
39
|
+
require_relative 'test_echeckSale'
|
40
|
+
require_relative 'test_echeckCredit'
|
41
|
+
require_relative 'test_echeckVerification'
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: LitleOnline
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 8.10.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Litle & Co
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-02-17 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: i18n
|
16
|
+
requirement: &103948120 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *103948120
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: xml-simple
|
27
|
+
requirement: &103947140 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *103947140
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: activesupport
|
38
|
+
requirement: &103945880 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *103945880
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: xml-object
|
49
|
+
requirement: &103945080 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *103945080
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: mocha
|
60
|
+
requirement: &103944260 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *103944260
|
69
|
+
description: ! 'Litle Online Ruby SDK created for version 8.10 of Litle XML online
|
70
|
+
format, see the XSD schema for specific fields that are supported by this format.
|
71
|
+
|
72
|
+
|
73
|
+
This gem contains an application interface in the Ruby programming language created
|
74
|
+
by Litle & Co.
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
'
|
79
|
+
email: sdksupport@litle.com
|
80
|
+
executables:
|
81
|
+
- sample_driver.rb
|
82
|
+
- Setup.rb
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files: []
|
85
|
+
files:
|
86
|
+
- README.md
|
87
|
+
- Rakefile
|
88
|
+
- index.html.1
|
89
|
+
- lib/LitleOnlineRequest.rb
|
90
|
+
- lib/LitleXmlMapper.rb
|
91
|
+
- lib/XMLFields.rb
|
92
|
+
- lib/Obj2xml.rb
|
93
|
+
- lib/LitleOnline.rb
|
94
|
+
- lib/Communications.rb
|
95
|
+
- lib/Configuration.rb
|
96
|
+
- lib/Checker.rb
|
97
|
+
- bin/Setup.rb
|
98
|
+
- bin/sample_driver.rb
|
99
|
+
- SETUP.md
|
100
|
+
- DESCRIPTION
|
101
|
+
- index.html
|
102
|
+
- test/unit/test_echeckVerification.rb
|
103
|
+
- test/unit/test_token.rb
|
104
|
+
- test/unit/test_capture.rb
|
105
|
+
- test/unit/test_xmlfields.rb
|
106
|
+
- test/unit/test_auth.rb
|
107
|
+
- test/unit/ts_unit.rb
|
108
|
+
- test/unit/test_echeckRedeposit.rb
|
109
|
+
- test/unit/test_echeckSale.rb
|
110
|
+
- test/unit/test_captureGivenAuth.rb
|
111
|
+
- test/unit/test_Checker.rb
|
112
|
+
- test/unit/test_authReversal.rb
|
113
|
+
- test/unit/test_sale.rb
|
114
|
+
- test/unit/test_forceCapture.rb
|
115
|
+
- test/unit/test_LitleOnlineRequest.rb
|
116
|
+
- test/unit/test_credit.rb
|
117
|
+
- test/unit/test_echeckCredit.rb
|
118
|
+
- test/functional/test_echeckVerification.rb
|
119
|
+
- test/functional/test_token.rb
|
120
|
+
- test/functional/test_capture.rb
|
121
|
+
- test/functional/ts_all.rb
|
122
|
+
- test/functional/test_xmlfields.rb
|
123
|
+
- test/functional/test_auth.rb
|
124
|
+
- test/functional/test_echeckRedeposit.rb
|
125
|
+
- test/functional/test_echeckSale.rb
|
126
|
+
- test/functional/test_captureGivenAuth.rb
|
127
|
+
- test/functional/test_authReversal.rb
|
128
|
+
- test/functional/test_sale.rb
|
129
|
+
- test/functional/test_forceCapture.rb
|
130
|
+
- test/functional/test_credit.rb
|
131
|
+
- test/functional/test_echeckCredit.rb
|
132
|
+
- test/certification/certTest1_base.rb
|
133
|
+
- test/certification/certTest4_echeck.rb
|
134
|
+
- test/certification/ts_all.rb
|
135
|
+
- test/certification/certTest3_authreversal.rb
|
136
|
+
- test/certification/certTest2_authenhanced.rb
|
137
|
+
- test/certification/certTest5_token.rb
|
138
|
+
- LICENSE
|
139
|
+
homepage: http://www.litle.com/developers
|
140
|
+
licenses: []
|
141
|
+
post_install_message:
|
142
|
+
rdoc_options: []
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '1.9'
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
+
none: false
|
153
|
+
requirements:
|
154
|
+
- - ! '>='
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
requirements:
|
158
|
+
- Contact sdksupport@litle.com for more information
|
159
|
+
rubyforge_project:
|
160
|
+
rubygems_version: 1.8.17
|
161
|
+
signing_key:
|
162
|
+
specification_version: 3
|
163
|
+
summary: Ruby SDK produced by Litle & Co. for online transaction processing using
|
164
|
+
Litle XML format v8.10
|
165
|
+
test_files:
|
166
|
+
- test/unit/ts_unit.rb
|