LitleOnline 8.18.0 → 8.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YzgyODYzYTg1ZTY0ODBiZDkyYzEzMDY5ZmFiZTlmYTVmNGVlMmE3Zg==
5
+ data.tar.gz: !binary |-
6
+ ZGVlZmQ4Yzc0ODkyYmM5NzZlMjhjOWJmY2RlN2I1ZjAyNzNlMjY1NQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ Yjk1MDI0ZjAyNDg3NWMxYzZkYWIwYTc5Zjc3NzNiNzBlMDFiYzczMTFiNGY0
10
+ MjY4NTE3YWFlM2U3MDkwZWM5ZjEyZjUwMzcxMzIzNGRmMGQxZjcwNjBiMTMx
11
+ MzY2Njk2ODJiYzBkY2JmYzgwZDRhZGJjM2VjZjMxYzE5NzczZWQ=
12
+ data.tar.gz: !binary |-
13
+ NjkwNmJhN2UwNzVkYTI4OGU3MGZmYzQ4MGE4ZDQyNjY5YzJmMjk3MjU0N2I4
14
+ Y2MxZGFlZmRiYjAxOTVkN2M5ZWRmYmQwOTQyMjY5Y2Y3MzlkZmFkNDA3YzJi
15
+ YzgyMTZhZGRkNTRmNDE2MDZhMjEzMDgyZmMyNzg1ZmNmMDM1NDg=
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  = LitleOnline CHANGELOG
2
2
 
3
+ == Version 8.19.0 (March 07, 2014)
4
+ * Feature: Added deptRepayment as a choice for authorizations, forceCapture, captureGivenAuth, sale
5
+ * Feature: More initial support for Recurring, including a backwards incompatible changing a field from numberOfPaymentsRemaining to numberOfPayments
6
+
3
7
  == Version 8.18.0 (July 31, 2013)
4
8
  * Feature: Add initial support for Recurring
5
9
  * Feature: Add support for Gift Card as a card type (GC)
@@ -78,4 +82,4 @@
78
82
 
79
83
  == Version 8.10.0 (February 17, 2012)
80
84
 
81
- * Initial release
85
+ * Initial release
data/CHANGELOG~ ADDED
@@ -0,0 +1,81 @@
1
+ = LitleOnline CHANGELOG
2
+
3
+ == Version 8.18.0 (July 31, 2013)
4
+ * Feature: Add initial support for Recurring
5
+ * Feature: Add support for Gift Card as a card type (GC)
6
+
7
+ == Version 8.17.0 (June 13, 2013)
8
+ * Feature: Batch support - see https://gist.github.com/litleSDK/5687345, https://gist.github.com/litleSDK/5714803 and https://gist.github.com/litleSDK/5714847
9
+ * Feature: Add support for surcharging credit card transactions
10
+ * Feature: Add support for specifying the terminalId on a pos transaction
11
+ * Feature: Add support for pos transactions on tied refunds
12
+ * Cleanup: Drop support for 1.8.6
13
+
14
+ == Version 8.16.0 (March 29, 2013)
15
+
16
+ * Feature: Merged pull request #7 from pierre to add external logging support
17
+ * Feature: Add recyling to voidResponse
18
+ * Bugfix: Force the "version" attribute of a LitleOnlineRequest to be the major and minor version of the sdk submitting the transaction instead of using the value from the configuration file
19
+ * Bugfix: Add Connection: close header to reduce the chance of 403s from reaching the ip connection limit
20
+ * Bugfix: Merged pull request #5 from simeonwillbanks to fix a typo in sale when payPalOrderComplete is specified
21
+
22
+ == Version 8.15.0 (January 31, 2013)
23
+
24
+ * Feature: Add merchantData to echeck verifications and echeck redeposits
25
+
26
+ == Version 8.14.0 (January 31, 2013)
27
+
28
+ * Feature: Temporary storage of card validation num on tokens
29
+ * Feature: Updating card validation numbers on tokens
30
+
31
+ == Version 8.13.2 (June 28, 2012)
32
+
33
+ * Feature: Most schema validations are now handled by ruby code and throw errors.
34
+ * Bugfix: Remove hardcoded username/password fields
35
+
36
+ == Version 8.13.1 (May 22, 2012)
37
+
38
+ * Feature: Echeck Void now supported
39
+
40
+ == Version 8.13.0 (May 18, 2012)
41
+
42
+ * Feature: Authorizations and Sales can accept an optional fraudFilterOverride parameter
43
+
44
+ == Version 8.12.4 (May 17, 2012)
45
+
46
+ * Bugfix: Use modules so that we are not polluting the global namespace
47
+
48
+ == Version 8.12.3 (May 17, 2012)
49
+
50
+ * Bugfix: Allow use without the configuration file
51
+
52
+ == Version 8.12.2 (May 16, 2012)
53
+
54
+ * Bugfix: Fix bug where rails "capture" method was interfering with Litle's "capture"
55
+
56
+ == Version 8.12.1 (May 15, 2012)
57
+
58
+ * Feature: Support Ruby 1.8.7
59
+ * Bugfix: Add support for line item data and tax detail to enhanced auth
60
+
61
+ == Version 8.12.0 (April 16, 2012)
62
+
63
+ * Feature: Add support for actionReason on credit
64
+ * Feature: Track SDK Usage
65
+ * Bugfix: Add support for MerchantData on auth and sale
66
+
67
+ == Version 8.10.3 (April 16, 2012)
68
+
69
+ * Feature: Support Ruby 1.8.6
70
+ * Bugfix: Setup sandbox url was incorrect
71
+ * Cleanup: Support newest sandbox conventions
72
+
73
+ == Version 8.10.1 (March 2, 2012)
74
+
75
+ * Feature: Allow use without the configuration file
76
+ * Bugfix: Reauth works
77
+ * Cleanup: Use ruby conventions
78
+
79
+ == Version 8.10.0 (February 17, 2012)
80
+
81
+ * Initial release
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 transaction processing using Litle XML format v8.18"
33
+ s.summary = "Ruby SDK produced by Litle & Co. for transaction processing using Litle XML format v8.19"
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.18.0"
37
+ s.version = "8.19.0"
38
38
  s.author = "Litle & Co"
39
39
  s.email = "sdksupport@litle.com"
40
40
  s.homepage = "http://www.litle.com/developers"
data/Rakefile~ ADDED
@@ -0,0 +1,93 @@
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 'rubygems'
26
+ require 'rubygems/package_task'
27
+ require 'rake/testtask'
28
+ require 'rake/clean'
29
+
30
+ spec = Gem::Specification.new do |s|
31
+ FileUtils.rm_rf('pkg')
32
+ s.name = "LitleOnline"
33
+ s.summary = "Ruby SDK produced by Litle & Co. for transaction processing using Litle XML format v8.18"
34
+ s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
35
+ s.requirements =
36
+ [ 'Contact sdksupport@litle.com for more information' ]
37
+ s.version = "8.18.0"
38
+ s.author = "Litle & Co"
39
+ s.email = "sdksupport@litle.com"
40
+ s.homepage = "http://www.litle.com/developers"
41
+ s.platform = Gem::Platform::RUBY
42
+ s.required_ruby_version = '>=1.8.7'
43
+ s.files = Dir['**/**']
44
+ s.executables = [ 'sample_driver.rb', 'Setup.rb' ]
45
+ s.test_files = Dir["test/unit/ts_unit.rb"]
46
+ s.has_rdoc = true
47
+ s.add_dependency('xml-object')
48
+ s.add_dependency('xml-mapping')
49
+ s.add_dependency('net-sftp')
50
+ s.add_dependency('libxml-ruby')
51
+ s.add_dependency('crack')
52
+ s.add_development_dependency('mocha')
53
+ end
54
+
55
+ Gem::PackageTask.new(spec) do |pkg|
56
+ pkg.gem_spec = spec
57
+ pkg.need_zip = true
58
+ pkg.need_tar = true
59
+ end
60
+
61
+ namespace :test do
62
+
63
+ Rake::TestTask.new do |t|
64
+ t.libs << '.'
65
+ t.name = 'unit'
66
+ t.test_files = FileList['test/unit/ts_unit.rb']
67
+ t.verbose = true
68
+ end
69
+
70
+ Rake::TestTask.new do |t|
71
+ t.libs << '.'
72
+ t.name = 'functional'
73
+ t.test_files = FileList['test/functional/ts_all.rb']
74
+ t.verbose = true
75
+ end
76
+
77
+ Rake::TestTask.new do |t|
78
+ t.libs << '.'
79
+ t.name = 'certification'
80
+ t.test_files = FileList['test/certification/certTest*.rb']
81
+ t.verbose = true
82
+ end
83
+
84
+ Rake::TestTask.new do |t|
85
+ t.libs << '.'
86
+ t.name = 'all'
87
+ t.test_files = FileList['test/**/*.rb']
88
+ t.verbose = true
89
+ end
90
+
91
+ end
92
+
93
+ task :default =>'gem'
@@ -149,7 +149,7 @@ module LitleOnline
149
149
 
150
150
  request.authentication = authentication
151
151
  request.merchantId = get_merchant_id(options)
152
- request.version = '8.18'
152
+ request.version = '8.19'
153
153
  request.loggedInUser = get_logged_in_user(options)
154
154
  request.xmlns = "http://www.litle.com/schema"
155
155
  request.merchantSdk = get_merchant_sdk(options)
@@ -180,7 +180,7 @@ module LitleOnline
180
180
  end
181
181
 
182
182
  def get_merchant_sdk(options)
183
- options['merchantSdk'] || 'Ruby;8.18.0'
183
+ options['merchantSdk'] || 'Ruby;8.19.0'
184
184
  end
185
185
 
186
186
  def get_report_group(options)
@@ -0,0 +1,198 @@
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_relative 'Configuration'
26
+
27
+ #
28
+ # This class handles sending the Litle online request
29
+ #
30
+ module LitleOnline
31
+
32
+ class LitleOnlineRequest
33
+ def initialize
34
+ #load configuration data
35
+ @config_hash = Configuration.new.config
36
+ @litle_transaction = LitleTransaction.new
37
+ end
38
+
39
+ def authorization(options)
40
+ transaction = @litle_transaction.authorization(options)
41
+
42
+ commit(transaction, :authorization, options)
43
+ end
44
+
45
+ def sale(options)
46
+ transaction = @litle_transaction.sale(options)
47
+
48
+ commit(transaction, :sale, options)
49
+ end
50
+
51
+ def auth_reversal(options)
52
+ transaction = @litle_transaction.auth_reversal(options)
53
+
54
+ commit(transaction, :authReversal, options)
55
+ end
56
+
57
+ def credit(options)
58
+ transaction = @litle_transaction.credit(options)
59
+
60
+ commit(transaction, :credit, options)
61
+ end
62
+
63
+ def register_token_request(options)
64
+ transaction = @litle_transaction.register_token_request(options)
65
+
66
+ commit(transaction, :registerTokenRequest, options)
67
+ end
68
+
69
+ def update_card_validation_num_on_token(options)
70
+ transaction = @litle_transaction.update_card_validation_num_on_token(options)
71
+
72
+ commit(transaction, :updateCardValidationNumOnToken, options)
73
+ end
74
+
75
+ def force_capture(options)
76
+ transaction = @litle_transaction.force_capture(options)
77
+
78
+ commit(transaction, :forceCapture, options)
79
+ end
80
+
81
+ def capture(options)
82
+ transaction = @litle_transaction.capture(options)
83
+
84
+ commit(transaction, :captureTxn, options)
85
+ end
86
+
87
+ def capture_given_auth(options)
88
+ transaction = @litle_transaction.capture_given_auth(options)
89
+
90
+ commit(transaction, :captureGivenAuth, options)
91
+ end
92
+
93
+ def void(options)
94
+ transaction = @litle_transaction.void(options)
95
+
96
+ commit(transaction, :void, options)
97
+ end
98
+
99
+ def echeck_redeposit(options)
100
+ transaction = @litle_transaction.echeck_redeposit(options)
101
+
102
+ commit(transaction, :echeckRedeposit, options)
103
+ end
104
+
105
+ def echeck_sale(options)
106
+ transaction = @litle_transaction.echeck_sale(options)
107
+
108
+ commit(transaction, :echeckSale, options)
109
+ end
110
+
111
+ def echeck_credit(options)
112
+ transaction = @litle_transaction.echeck_credit(options)
113
+
114
+ begin
115
+ commit(transaction, :echeckCredit, options)
116
+ rescue XML::MappingError => e
117
+ response = LitleOnlineResponse.new
118
+ response.message = "The content of element 'echeckCredit' is not complete"
119
+ return response
120
+ end
121
+ end
122
+
123
+ def echeck_verification(options)
124
+ transaction = @litle_transaction.echeck_verification(options)
125
+
126
+ commit(transaction, :echeckVerification, options)
127
+ end
128
+
129
+ def echeck_void(options)
130
+ transaction = @litle_transaction.echeck_void(options)
131
+
132
+ commit(transaction, :echeckVoid, options)
133
+ end
134
+
135
+ private
136
+
137
+ def add_account_info(transaction, options)
138
+ transaction.reportGroup = get_report_group(options)
139
+ transaction.transactionId = options['id']
140
+ transaction.customerId = options['customerId']
141
+ end
142
+
143
+ def build_request(options)
144
+ request = OnlineRequest.new
145
+
146
+ authentication = Authentication.new
147
+ authentication.user = get_config(:user, options)
148
+ authentication.password = get_config(:password, options)
149
+
150
+ request.authentication = authentication
151
+ request.merchantId = get_merchant_id(options)
152
+ request.version = '8.18'
153
+ request.loggedInUser = get_logged_in_user(options)
154
+ request.xmlns = "http://www.litle.com/schema"
155
+ request.merchantSdk = get_merchant_sdk(options)
156
+
157
+ request
158
+ end
159
+
160
+ def commit(transaction, type, options)
161
+ configure_connection(options)
162
+
163
+ request = build_request(options)
164
+
165
+ add_account_info(transaction, options)
166
+ request.send(:"#{type}=", transaction)
167
+
168
+ xml = request.save_to_xml.to_s
169
+ LitleXmlMapper.request(xml, @config_hash)
170
+ end
171
+
172
+ def configure_connection(options={})
173
+ @config_hash['proxy_addr'] = options['proxy_addr'] unless options['proxy_addr'].nil?
174
+ @config_hash['proxy_port'] = options['proxy_port'] unless options['proxy_port'].nil?
175
+ @config_hash['url'] = options['url'] unless options['url'].nil?
176
+ end
177
+
178
+ def get_merchant_id(options)
179
+ options['merchantId'] || @config_hash['currency_merchant_map']['DEFAULT']
180
+ end
181
+
182
+ def get_merchant_sdk(options)
183
+ options['merchantSdk'] || 'Ruby;8.18.0'
184
+ end
185
+
186
+ def get_report_group(options)
187
+ options['reportGroup'] || @config_hash['default_report_group']
188
+ end
189
+
190
+ def get_config(field, options)
191
+ options[field.to_s] == nil ? @config_hash[field.to_s] : options[field.to_s]
192
+ end
193
+
194
+ def get_logged_in_user(options)
195
+ options['loggedInUser'] || nil
196
+ end
197
+ end
198
+ end
data/lib/LitleRequest.rb CHANGED
@@ -190,7 +190,7 @@ module LitleOnline
190
190
  litleRequest.authentication = authentication
191
191
  litleRequest.numBatchRequests = "0"
192
192
 
193
- litleRequest.version = '8.18'
193
+ litleRequest.version = '8.19'
194
194
  litleRequest.xmlns = "http://www.litle.com/schema"
195
195
 
196
196
 
@@ -490,7 +490,7 @@ module LitleOnline
490
490
  authentication.password = get_config(:password, options)
491
491
 
492
492
  litle_request.authentication = authentication
493
- litle_request.version = '8.18'
493
+ litle_request.version = '8.19'
494
494
  litle_request.xmlns = "http://www.litle.com/schema"
495
495
  # litle_request.id = options['sessionId'] #grab from options; okay if nil
496
496
  litle_request.numBatchRequests = @num_batch_requests
@@ -510,4 +510,4 @@ module LitleOnline
510
510
  end
511
511
  end
512
512
  end
513
- end
513
+ end