LitleOnline 8.12.3 → 8.12.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Rakefile +1 -1
- data/lib/Communications.rb +34 -32
- data/lib/Configuration.rb +13 -11
- data/lib/LitleOnline.rb +0 -1
- data/lib/LitleOnlineRequest.rb +546 -543
- data/lib/LitleXmlMapper.rb +17 -15
- data/lib/XMLFields.rb +903 -901
- data/test/certification/certTest1_base.rb +935 -933
- data/test/certification/certTest2_authenhanced.rb +548 -546
- data/test/certification/certTest3_authreversal.rb +179 -177
- data/test/certification/certTest4_echeck.rb +245 -243
- data/test/certification/certTest5_token.rb +198 -196
- data/test/functional/test_auth.rb +205 -204
- data/test/functional/test_authReversal.rb +41 -39
- data/test/functional/test_capture.rb +54 -52
- data/test/functional/test_captureGivenAuth.rb +153 -152
- data/test/functional/test_credit.rb +126 -126
- data/test/functional/test_echeckCredit.rb +88 -87
- data/test/functional/test_echeckRedeposit.rb +85 -84
- data/test/functional/test_echeckSale.rb +132 -131
- data/test/functional/test_echeckVerification.rb +97 -95
- data/test/functional/test_forceCapture.rb +113 -111
- data/test/functional/test_sale.rb +200 -198
- data/test/functional/test_token.rb +75 -73
- data/test/functional/test_xmlfields.rb +558 -558
- data/test/unit/test_LitleOnlineRequest.rb +210 -207
- data/test/unit/test_auth.rb +119 -116
- data/test/unit/test_authReversal.rb +16 -16
- data/test/unit/test_capture.rb +10 -8
- data/test/unit/test_captureGivenAuth.rb +62 -59
- data/test/unit/test_credit.rb +103 -100
- data/test/unit/test_echeckCredit.rb +15 -14
- data/test/unit/test_echeckRedeposit.rb +14 -13
- data/test/unit/test_echeckSale.rb +16 -15
- data/test/unit/test_echeckVerification.rb +14 -13
- data/test/unit/test_forceCapture.rb +61 -58
- data/test/unit/test_sale.rb +206 -205
- data/test/unit/test_token.rb +43 -41
- data/test/unit/test_xmlfields.rb +101 -99
- metadata +58 -77
- data/lib/Obj2xml.rb +0 -37
data/test/unit/test_token.rb
CHANGED
@@ -25,46 +25,48 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
28
|
+
module LitleOnline
|
29
|
+
class TestToken < Test::Unit::TestCase
|
30
|
+
def test_account_num_and_paypage
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'orderId'=>'12344',
|
36
|
+
'accountNumber'=>'1233456789101112',
|
37
|
+
'paypageRegistrationId'=>'1233456789101112'
|
38
|
+
}
|
39
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.register_token_request(hash)}
|
40
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_echeckandPaypage
|
44
|
+
hash = {
|
45
|
+
'merchantId' => '101',
|
46
|
+
'version'=>'8.8',
|
47
|
+
'reportGroup'=>'Planets',
|
48
|
+
'orderId'=>'12344',
|
49
|
+
'echeckForToken'=>{'accNum'=>'12344565','routingNum'=>'123476545'},
|
50
|
+
'paypageRegistrationId'=>'1233456789101112'
|
51
|
+
}
|
52
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.register_token_request(hash)}
|
53
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_echeckandPaypageandaccountnum
|
57
|
+
hash = {
|
58
|
+
'merchantId' => '101',
|
59
|
+
'version'=>'8.8',
|
60
|
+
'reportGroup'=>'Planets',
|
61
|
+
'orderId'=>'12344',
|
62
|
+
'accountNumber'=>'1233456789101112',
|
63
|
+
'echeckForToken'=>{'accNum'=>'12344565','routingNum'=>'123476545'},
|
64
|
+
'paypageRegistrationId'=>'1233456789101112'
|
65
|
+
}
|
66
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.register_token_request(hash)}
|
67
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
68
|
+
end
|
69
|
+
|
40
70
|
end
|
41
71
|
|
42
|
-
|
43
|
-
hash = {
|
44
|
-
'merchantId' => '101',
|
45
|
-
'version'=>'8.8',
|
46
|
-
'reportGroup'=>'Planets',
|
47
|
-
'orderId'=>'12344',
|
48
|
-
'echeckForToken'=>{'accNum'=>'12344565','routingNum'=>'123476545'},
|
49
|
-
'paypageRegistrationId'=>'1233456789101112'
|
50
|
-
}
|
51
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.register_token_request(hash)}
|
52
|
-
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_echeckandPaypageandaccountnum
|
56
|
-
hash = {
|
57
|
-
'merchantId' => '101',
|
58
|
-
'version'=>'8.8',
|
59
|
-
'reportGroup'=>'Planets',
|
60
|
-
'orderId'=>'12344',
|
61
|
-
'accountNumber'=>'1233456789101112',
|
62
|
-
'echeckForToken'=>{'accNum'=>'12344565','routingNum'=>'123476545'},
|
63
|
-
'paypageRegistrationId'=>'1233456789101112'
|
64
|
-
}
|
65
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.register_token_request(hash)}
|
66
|
-
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
72
|
+
end
|
data/test/unit/test_xmlfields.rb
CHANGED
@@ -26,106 +26,108 @@ require 'lib/LitleOnline'
|
|
26
26
|
require 'test/unit'
|
27
27
|
require 'mocha'
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
29
|
+
module LitleOnline
|
30
|
+
class TestXmlfields < Test::Unit::TestCase
|
31
|
+
def test_custom_billing_with_two_choices
|
32
|
+
hash = {
|
33
|
+
'merchantId' => '101',
|
34
|
+
'version'=>'8.8',
|
35
|
+
'reportGroup'=>'Planets',
|
36
|
+
'litleTxnId'=>'123456',
|
37
|
+
'orderId'=>'12344',
|
38
|
+
'amount'=>'106',
|
39
|
+
'orderSource'=>'ecommerce',
|
40
|
+
'customBilling'=>{'phone'=>'1234567890','url'=>'www.litle.com'},
|
41
|
+
'card'=>{
|
42
|
+
'type'=>'VI',
|
43
|
+
'number' =>'4100000000000001',
|
44
|
+
'expDate' =>'1210'
|
45
|
+
}}
|
46
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
47
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_custom_billing_with_three_choices
|
51
|
+
hash = {
|
52
|
+
'merchantId' => '101',
|
53
|
+
'version'=>'8.8',
|
54
|
+
'reportGroup'=>'Planets',
|
55
|
+
'litleTxnId'=>'123456',
|
56
|
+
'orderId'=>'12344',
|
57
|
+
'amount'=>'106',
|
58
|
+
'orderSource'=>'ecommerce',
|
59
|
+
'customBilling'=>{'phone'=>'123456789','url'=>'www.litle.com','city'=>'lowell'},
|
60
|
+
'card'=>{
|
61
|
+
'type'=>'VI',
|
62
|
+
'number' =>'4100000000000001',
|
63
|
+
'expDate' =>'1210'
|
64
|
+
}}
|
65
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
66
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_line_item_data
|
70
|
+
hash = {
|
71
|
+
'merchantId' => '101',
|
72
|
+
'version'=>'8.8',
|
73
|
+
'reportGroup'=>'Planets',
|
74
|
+
'enhancedData'=>
|
75
|
+
{
|
76
|
+
'lineItemData'=>[
|
77
|
+
{'itemSequenceNumber'=>'1', 'itemDescription'=>'desc1'},
|
78
|
+
{'itemSequenceNumber'=>'2', 'itemDescription'=>'desc2'}
|
79
|
+
]
|
80
|
+
}
|
79
81
|
}
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
82
|
+
|
83
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<lineItemData>.*<itemSequenceNumber>1<\/itemSequenceNumber>.*<itemDescription>desc1<\/itemDescription>.*<\/lineItemData>.*<lineItemData>.*<itemSequenceNumber>2<\/itemSequenceNumber>.*<itemDescription>desc2<\/itemDescription>.*<\/lineItemData>.*<\/enhancedData>.*/m), is_a(Hash))
|
84
|
+
LitleOnlineRequest.new.authorization(hash)
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_detail_tax
|
88
|
+
hash = {
|
89
|
+
'merchantId' => '101',
|
90
|
+
'version'=>'8.8',
|
91
|
+
'reportGroup'=>'Planets',
|
92
|
+
'enhancedData'=>
|
93
|
+
{
|
94
|
+
'detailTax'=>[
|
95
|
+
{'taxIncludedInTotal'=>'true', 'taxTypeIdentifier'=>'00'},
|
96
|
+
{'taxIncludedInTotal'=>'false', 'taxTypeIdentifier'=>'01'}
|
97
|
+
]
|
98
|
+
}
|
97
99
|
}
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
100
|
+
|
101
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<detailTax>.*<taxIncludedInTotal>true<\/taxIncludedInTotal>.*<taxTypeIdentifier>00<\/taxTypeIdentifier>.*<\/detailTax>.*<detailTax>.*<taxIncludedInTotal>false<\/taxIncludedInTotal>.*<taxTypeIdentifier>01<\/taxTypeIdentifier>.*<\/detailTax>.*<\/enhancedData>.*/m), is_a(Hash))
|
102
|
+
LitleOnlineRequest.new.authorization(hash)
|
103
|
+
end
|
104
|
+
|
105
|
+
def test_detail_tax_in_lineItem
|
106
|
+
hash = {
|
107
|
+
'merchantId' => '101',
|
108
|
+
'version'=>'8.8',
|
109
|
+
'reportGroup'=>'Planets',
|
110
|
+
'enhancedData'=>
|
111
|
+
{
|
112
|
+
'lineItemData'=>[
|
113
|
+
{'itemSequenceNumber'=>'1', 'itemDescription'=>'desc1','detailTax'=>[
|
114
|
+
{'taxAmount'=>'1'},
|
115
|
+
{'taxAmount'=>'2'}]
|
116
|
+
},
|
117
|
+
{'itemSequenceNumber'=>'2', 'itemDescription'=>'desc2','detailTax'=>[
|
118
|
+
{'taxAmount'=>'3'},
|
119
|
+
{'taxAmount'=>'4'}]
|
120
|
+
}],
|
121
|
+
'detailTax'=>[
|
122
|
+
{'taxAmount'=>'5'},
|
123
|
+
{'taxAmount'=>'6'}
|
124
|
+
]}
|
125
|
+
}
|
126
|
+
|
127
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<detailTax>.*<taxAmount>5<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>6<\/taxAmount>.*<\/detailTax>.*<lineItemData>.*<itemSequenceNumber>1<\/itemSequenceNumber>.*<itemDescription>desc1<\/itemDescription>.*<detailTax>.*<taxAmount>1<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>2<\/taxAmount>.*<\/detailTax>.*<\/lineItemData>.*<lineItemData>.*<itemSequenceNumber>2<\/itemSequenceNumber>.*<itemDescription>desc2<\/itemDescription>.*<detailTax>.*<taxAmount>3<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>4<\/taxAmount>.*<\/detailTax>.*<\/lineItemData>.*<\/enhancedData>.*/m), is_a(Hash))
|
128
|
+
LitleOnlineRequest.new.authorization(hash)
|
129
|
+
end
|
130
|
+
|
128
131
|
end
|
129
132
|
|
130
|
-
end
|
131
|
-
|
133
|
+
end
|
metadata
CHANGED
@@ -1,82 +1,71 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: LitleOnline
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 8
|
7
|
-
- 12
|
8
|
-
- 3
|
9
|
-
version: 8.12.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 8.12.4
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Litle & Co
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-05-17 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: xml-object
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &148336780 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
31
22
|
type: :runtime
|
32
|
-
version_requirements: *id001
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: xml-mapping
|
35
23
|
prerelease: false
|
36
|
-
|
24
|
+
version_requirements: *148336780
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: xml-mapping
|
27
|
+
requirement: &148335880 !ruby/object:Gem::Requirement
|
37
28
|
none: false
|
38
|
-
requirements:
|
39
|
-
- -
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
|
42
|
-
- 0
|
43
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
44
33
|
type: :runtime
|
45
|
-
version_requirements: *id002
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: mocha
|
48
34
|
prerelease: false
|
49
|
-
|
35
|
+
version_requirements: *148335880
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: mocha
|
38
|
+
requirement: &148335100 !ruby/object:Gem::Requirement
|
50
39
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
-
- 0
|
56
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
57
44
|
type: :development
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *148335100
|
47
|
+
description: ! 'Litle Online Ruby SDK created for version 8.12 of Litle XML online
|
48
|
+
format, see the XSD schema for specific fields that are supported by this format.
|
49
|
+
|
50
|
+
|
51
|
+
This gem contains an application interface in the Ruby programming language created
|
52
|
+
by Litle & Co.
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
'
|
65
57
|
email: sdksupport@litle.com
|
66
|
-
executables:
|
58
|
+
executables:
|
67
59
|
- sample_driver.rb
|
68
60
|
- Setup.rb
|
69
61
|
extensions: []
|
70
|
-
|
71
62
|
extra_rdoc_files: []
|
72
|
-
|
73
|
-
files:
|
63
|
+
files:
|
74
64
|
- README.md
|
75
65
|
- Rakefile
|
76
66
|
- lib/LitleOnlineRequest.rb
|
77
67
|
- lib/LitleXmlMapper.rb
|
78
68
|
- lib/XMLFields.rb
|
79
|
-
- lib/Obj2xml.rb
|
80
69
|
- lib/LitleOnline.rb
|
81
70
|
- lib/cacert.pem
|
82
71
|
- lib/Communications.rb
|
@@ -122,39 +111,31 @@ files:
|
|
122
111
|
- test/certification/certTest2_authenhanced.rb
|
123
112
|
- test/certification/certTest5_token.rb
|
124
113
|
- LICENSE
|
125
|
-
has_rdoc: true
|
126
114
|
homepage: http://www.litle.com/developers
|
127
115
|
licenses: []
|
128
|
-
|
129
116
|
post_install_message:
|
130
117
|
rdoc_options: []
|
131
|
-
|
132
|
-
require_paths:
|
118
|
+
require_paths:
|
133
119
|
- lib
|
134
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
135
121
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
segments:
|
140
|
-
- 1
|
141
|
-
- 8
|
142
|
-
- 6
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
143
125
|
version: 1.8.6
|
144
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
127
|
none: false
|
146
|
-
requirements:
|
147
|
-
- -
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
|
150
|
-
|
151
|
-
version: "0"
|
152
|
-
requirements:
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
requirements:
|
153
133
|
- Contact sdksupport@litle.com for more information
|
154
134
|
rubyforge_project:
|
155
|
-
rubygems_version: 1.
|
135
|
+
rubygems_version: 1.8.17
|
156
136
|
signing_key:
|
157
137
|
specification_version: 3
|
158
|
-
summary: Ruby SDK produced by Litle & Co. for online transaction processing using
|
159
|
-
|
138
|
+
summary: Ruby SDK produced by Litle & Co. for online transaction processing using
|
139
|
+
Litle XML format v8.12
|
140
|
+
test_files:
|
160
141
|
- test/unit/ts_unit.rb
|