LitleOnline 8.10.3 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/DESCRIPTION +1 -1
- data/Rakefile +2 -2
- data/SETUP.md +1 -1
- data/bin/Setup.rb +1 -1
- data/lib/LitleOnlineRequest.rb +13 -3
- data/lib/XMLFields.rb +11 -0
- data/test/unit/test_LitleOnlineRequest.rb +9 -0
- data/test/unit/test_auth.rb +18 -0
- data/test/unit/test_credit.rb +16 -0
- data/test/unit/test_sale.rb +18 -0
- metadata +66 -86
data/DESCRIPTION
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Litle Online Ruby SDK created for version 8.
|
1
|
+
Litle Online Ruby SDK created for version 8.12 of Litle XML online format, see the XSD schema for specific fields that are supported by this format.
|
2
2
|
|
3
3
|
This gem contains an application interface in the Ruby programming language created by Litle & Co.
|
4
4
|
|
data/Rakefile
CHANGED
@@ -30,11 +30,11 @@ require 'rake/clean'
|
|
30
30
|
spec = Gem::Specification.new do |s|
|
31
31
|
FileUtils.rm_rf('pkg')
|
32
32
|
s.name = "LitleOnline"
|
33
|
-
s.summary = "Ruby SDK produced by Litle & Co. for online transaction processing using Litle XML format v8.
|
33
|
+
s.summary = "Ruby SDK produced by Litle & Co. for online transaction processing using Litle XML format v8.12"
|
34
34
|
s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
|
35
35
|
s.requirements =
|
36
36
|
[ 'Contact sdksupport@litle.com for more information' ]
|
37
|
-
s.version = "8.
|
37
|
+
s.version = "8.12.0"
|
38
38
|
s.author = "Litle & Co"
|
39
39
|
s.email = "sdksupport@litle.com"
|
40
40
|
s.homepage = "http://www.litle.com/developers"
|
data/SETUP.md
CHANGED
data/bin/Setup.rb
CHANGED
@@ -44,7 +44,7 @@ class Setup
|
|
44
44
|
f.puts "currency_merchant_map:"
|
45
45
|
f.puts " DEFAULT: " + gets
|
46
46
|
f.puts "default_report_group: 'Default Report Group'"
|
47
|
-
f.puts "version: '8.
|
47
|
+
f.puts "version: '8.12'"
|
48
48
|
puts "Please choose Litle url from the following list (example: 'cert') or directly input another URL: \nsandbox => https://www.testlitle.com/sandbox/communicator/online \ncert => https://cert.litle.com/vap/communicator/online \nprecert => https://precert.litle.com/vap/communicator/online \nproduction1 => https://payments.litle.com/vap/communicator/online \nproduction2 => https://payments2.litle.com/vap/communicator/online"
|
49
49
|
f.puts "url: " + Setup.choice(gets)
|
50
50
|
puts "Please input the proxy address, if no proxy hit enter key: "
|
data/lib/LitleOnlineRequest.rb
CHANGED
@@ -64,7 +64,7 @@ class LitleOnlineRequest
|
|
64
64
|
:allowPartialAuth=>hash_in['allowPartialAuth'],
|
65
65
|
:healthcareIIAS=>XMLFields.healthcare_iias(optional_field(hash_in['healthcareIIAS'])),
|
66
66
|
:filtering=>XMLFields.filtering_type(optional_field(hash_in['filtering'])),
|
67
|
-
:merchantData=>XMLFields.
|
67
|
+
:merchantData=>XMLFields.merchant_data(optional_field(hash_in['merchantData'])),
|
68
68
|
:recyclingRequest=>XMLFields.recycling_request_type(optional_field(hash_in['recyclingRequest']))
|
69
69
|
}
|
70
70
|
end
|
@@ -108,7 +108,7 @@ class LitleOnlineRequest
|
|
108
108
|
:allowPartialAuth=>hash_in['allowPartialAuth'],
|
109
109
|
:healthcareIIAS=>XMLFields.healthcare_iias(optional_field(hash_in['healthcareIIAS'])),
|
110
110
|
:filtering=>XMLFields.filtering_type(optional_field(hash_in['filtering'])),
|
111
|
-
:merchantData=>XMLFields.
|
111
|
+
:merchantData=>XMLFields.merchant_data(optional_field(hash_in['merchantData'])),
|
112
112
|
:recyclingRequest=>XMLFields.recycling_request_type(optional_field(hash_in['recyclingRequest']))
|
113
113
|
}
|
114
114
|
hash_out.merge!(get_common_attributes(hash_in))
|
@@ -156,7 +156,8 @@ class LitleOnlineRequest
|
|
156
156
|
:processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
|
157
157
|
:pos=>XMLFields.pos(optional_field(hash_in['pos'])),
|
158
158
|
:amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData'])),
|
159
|
-
:payPalNotes =>hash_in['payPalNotes']
|
159
|
+
:payPalNotes =>hash_in['payPalNotes'],
|
160
|
+
:actionReason=>hash_in['actionReason']
|
160
161
|
}
|
161
162
|
hash_out.merge!(get_common_attributes(hash_in))
|
162
163
|
Checker.purge_null(hash_out)
|
@@ -362,6 +363,14 @@ class LitleOnlineRequest
|
|
362
363
|
return hash_in['merchantId']
|
363
364
|
end
|
364
365
|
end
|
366
|
+
|
367
|
+
def get_merchant_sdk(hash_in)
|
368
|
+
if(hash_in['merchantSdk'] == nil)
|
369
|
+
return 'Ruby;8.12.0'
|
370
|
+
else
|
371
|
+
return hash_in['merchantSdk']
|
372
|
+
end
|
373
|
+
end
|
365
374
|
|
366
375
|
def get_report_group(hash_in)
|
367
376
|
if (hash_in['reportGroup'] == nil)
|
@@ -410,6 +419,7 @@ class LitleOnlineRequest
|
|
410
419
|
"@version"=> required_field(version),
|
411
420
|
"@xmlns"=> "http://www.litle.com/schema",
|
412
421
|
"@merchantId"=> get_merchant_id(hash_in),
|
422
|
+
"@merchantSdk"=> get_merchant_sdk(hash_in),
|
413
423
|
:authentication => authentication(hash_in)
|
414
424
|
}
|
415
425
|
return litle_online_hash.merge(merge_hash)
|
data/lib/XMLFields.rb
CHANGED
@@ -341,6 +341,17 @@ class XMLFields
|
|
341
341
|
Checker.required_missing(hash_out)
|
342
342
|
return hash_out
|
343
343
|
end
|
344
|
+
|
345
|
+
def XMLFields.merchant_data(hash_in)
|
346
|
+
hash_out = {
|
347
|
+
:campaign=>hash_in['campaign'],
|
348
|
+
:affiliate=>hash_in['affiliate'],
|
349
|
+
:merchnatGroupingId=>hash_in['merchantGroupingIdType']
|
350
|
+
}
|
351
|
+
Checker.purge_null(hash_out)
|
352
|
+
Checker.required_missing(hash_out)
|
353
|
+
return hash_out
|
354
|
+
end
|
344
355
|
|
345
356
|
def XMLFields.echeck_type(hash_in)
|
346
357
|
hash_out= {
|
@@ -294,4 +294,13 @@ end
|
|
294
294
|
assert_nothing_raised {LitleOnlineRequest.new.authorization(start_hash.merge({'customerInfo'=>{'ssn'=>'000112222'} }))}
|
295
295
|
end
|
296
296
|
|
297
|
+
def test_set_merchant_sdk
|
298
|
+
litle = LitleOnlineRequest.new
|
299
|
+
#Explicit - used for integrations
|
300
|
+
assert_equal 'ActiveMerchant;3.2', litle.send(:get_merchant_sdk, {'merchantSdk'=>'ActiveMerchant;3.2'})
|
301
|
+
#Implicit - used raw when nothing is specified
|
302
|
+
assert_equal 'Ruby;8.12.0', litle.send(:get_merchant_sdk, {'NotMerchantSdk'=>'ActiveMerchant;3.2'})
|
303
|
+
end
|
304
|
+
|
305
|
+
|
297
306
|
end
|
data/test/unit/test_auth.rb
CHANGED
@@ -176,5 +176,23 @@ class TestAuth < Test::Unit::TestCase
|
|
176
176
|
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
177
177
|
end
|
178
178
|
|
179
|
+
def test_merchant_data_auth
|
180
|
+
hash = {
|
181
|
+
'merchantId' => '101',
|
182
|
+
'version'=>'8.12',
|
183
|
+
'orderId'=>'1',
|
184
|
+
'amount'=>'0',
|
185
|
+
'orderSource'=>'ecommerce',
|
186
|
+
'reportGroup'=>'Planets',
|
187
|
+
'merchantData'=> {
|
188
|
+
'campaign'=>'foo'
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
XMLObject.expects(:new)
|
193
|
+
Communications.expects(:http_post).with(regexp_matches(/.*<merchantData>.*?<campaign>foo<\/campaign>.*?<\/merchantData>.*/m),kind_of(Hash))
|
194
|
+
LitleOnlineRequest.new.authorization(hash)
|
195
|
+
end
|
196
|
+
|
179
197
|
end
|
180
198
|
|
data/test/unit/test_credit.rb
CHANGED
@@ -111,4 +111,20 @@ class TestCredit < Test::Unit::TestCase
|
|
111
111
|
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
112
112
|
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
113
113
|
end
|
114
|
+
|
115
|
+
def test_action_reason_on_orphaned_refund
|
116
|
+
hash = {
|
117
|
+
'merchantId' => '101',
|
118
|
+
'version'=>'8.12',
|
119
|
+
'orderId'=>'1',
|
120
|
+
'amount'=>'2',
|
121
|
+
'orderSource'=>'ecommerce',
|
122
|
+
'reportGroup'=>'Planets',
|
123
|
+
'actionReason'=> 'SUSPECT_FRAUD'
|
124
|
+
}
|
125
|
+
XMLObject.expects(:new)
|
126
|
+
Communications.expects(:http_post).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m),kind_of(Hash))
|
127
|
+
LitleOnlineRequest.new.credit(hash)
|
128
|
+
end
|
129
|
+
|
114
130
|
end
|
data/test/unit/test_sale.rb
CHANGED
@@ -245,5 +245,23 @@ class TestSale < Test::Unit::TestCase
|
|
245
245
|
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
246
246
|
end
|
247
247
|
|
248
|
+
def test_merchant_data_sale
|
249
|
+
hash = {
|
250
|
+
'merchantId' => '101',
|
251
|
+
'version'=>'8.12',
|
252
|
+
'orderId'=>'1',
|
253
|
+
'amount'=>'0',
|
254
|
+
'orderSource'=>'ecommerce',
|
255
|
+
'reportGroup'=>'Planets',
|
256
|
+
'merchantData'=> {
|
257
|
+
'affiliate'=>'bar'
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
XMLObject.expects(:new)
|
262
|
+
Communications.expects(:http_post).with(regexp_matches(/.*<merchantData>.*?<affiliate>bar<\/affiliate>.*?<\/merchantData>.*/m),kind_of(Hash))
|
263
|
+
LitleOnlineRequest.new.sale(hash)
|
264
|
+
end
|
265
|
+
|
248
266
|
end
|
249
267
|
|
metadata
CHANGED
@@ -1,89 +1,77 @@
|
|
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
|
-
- 10
|
8
|
-
- 3
|
9
|
-
version: 8.10.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 8.12.0
|
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-04-16 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: i18n
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &244422760 !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-simple
|
35
23
|
prerelease: false
|
36
|
-
|
24
|
+
version_requirements: *244422760
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: xml-simple
|
27
|
+
requirement: &244422340 !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: xml-object
|
48
34
|
prerelease: false
|
49
|
-
|
35
|
+
version_requirements: *244422340
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: xml-object
|
38
|
+
requirement: &244421920 !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: :runtime
|
58
|
-
version_requirements: *id003
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: mocha
|
61
45
|
prerelease: false
|
62
|
-
|
46
|
+
version_requirements: *244421920
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: mocha
|
49
|
+
requirement: &244421500 !ruby/object:Gem::Requirement
|
63
50
|
none: false
|
64
|
-
requirements:
|
65
|
-
- -
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
|
68
|
-
- 0
|
69
|
-
version: "0"
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
70
55
|
type: :development
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *244421500
|
58
|
+
description: ! 'Litle Online Ruby SDK created for version 8.12 of Litle XML online
|
59
|
+
format, see the XSD schema for specific fields that are supported by this format.
|
60
|
+
|
61
|
+
|
62
|
+
This gem contains an application interface in the Ruby programming language created
|
63
|
+
by Litle & Co.
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
'
|
78
68
|
email: sdksupport@litle.com
|
79
|
-
executables:
|
69
|
+
executables:
|
80
70
|
- sample_driver.rb
|
81
71
|
- Setup.rb
|
82
72
|
extensions: []
|
83
|
-
|
84
73
|
extra_rdoc_files: []
|
85
|
-
|
86
|
-
files:
|
74
|
+
files:
|
87
75
|
- README.md
|
88
76
|
- Rakefile
|
89
77
|
- index.html.1
|
@@ -137,39 +125,31 @@ files:
|
|
137
125
|
- test/certification/certTest2_authenhanced.rb
|
138
126
|
- test/certification/certTest5_token.rb
|
139
127
|
- LICENSE
|
140
|
-
has_rdoc: true
|
141
128
|
homepage: http://www.litle.com/developers
|
142
129
|
licenses: []
|
143
|
-
|
144
130
|
post_install_message:
|
145
131
|
rdoc_options: []
|
146
|
-
|
147
|
-
require_paths:
|
132
|
+
require_paths:
|
148
133
|
- lib
|
149
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
135
|
none: false
|
151
|
-
requirements:
|
152
|
-
- -
|
153
|
-
- !ruby/object:Gem::Version
|
154
|
-
segments:
|
155
|
-
- 1
|
156
|
-
- 8
|
157
|
-
- 6
|
136
|
+
requirements:
|
137
|
+
- - ! '>='
|
138
|
+
- !ruby/object:Gem::Version
|
158
139
|
version: 1.8.6
|
159
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
141
|
none: false
|
161
|
-
requirements:
|
162
|
-
- -
|
163
|
-
- !ruby/object:Gem::Version
|
164
|
-
|
165
|
-
|
166
|
-
version: "0"
|
167
|
-
requirements:
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements:
|
168
147
|
- Contact sdksupport@litle.com for more information
|
169
148
|
rubyforge_project:
|
170
|
-
rubygems_version: 1.
|
149
|
+
rubygems_version: 1.8.15
|
171
150
|
signing_key:
|
172
151
|
specification_version: 3
|
173
|
-
summary: Ruby SDK produced by Litle & Co. for online transaction processing using
|
174
|
-
|
152
|
+
summary: Ruby SDK produced by Litle & Co. for online transaction processing using
|
153
|
+
Litle XML format v8.12
|
154
|
+
test_files:
|
175
155
|
- test/unit/ts_unit.rb
|