LitleOnline 8.12.0 → 8.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/CHANGELOG +28 -0
  2. data/Rakefile +2 -3
  3. data/lib/Communications.rb +14 -12
  4. data/lib/LitleOnline.rb +11 -2
  5. data/lib/LitleOnlineRequest.rb +435 -284
  6. data/lib/LitleXmlMapper.rb +1 -2
  7. data/lib/XMLFields.rb +900 -307
  8. data/lib/cacert.pem +3331 -0
  9. data/test/certification/certTest2_authenhanced.rb +7 -7
  10. data/test/certification/certTest5_token.rb +8 -8
  11. data/test/functional/test_auth.rb +106 -3
  12. data/test/functional/test_authReversal.rb +5 -6
  13. data/test/functional/test_capture.rb +12 -1
  14. data/test/functional/test_captureGivenAuth.rb +25 -5
  15. data/test/functional/test_credit.rb +1 -1
  16. data/test/functional/test_echeckRedeposit.rb +34 -0
  17. data/test/functional/test_echeckVerification.rb +33 -0
  18. data/test/functional/test_forceCapture.rb +35 -0
  19. data/test/functional/test_sale.rb +45 -13
  20. data/test/functional/test_xmlfields.rb +197 -10
  21. data/test/functional/ts_all.rb +2 -0
  22. data/test/unit/test_LitleOnlineRequest.rb +2 -59
  23. data/test/unit/test_auth.rb +2 -51
  24. data/test/unit/test_authReversal.rb +10 -5
  25. data/test/unit/test_capture.rb +5 -7
  26. data/test/unit/test_captureGivenAuth.rb +0 -19
  27. data/test/unit/test_credit.rb +1 -0
  28. data/test/unit/test_echeckCredit.rb +0 -2
  29. data/test/unit/test_echeckRedeposit.rb +0 -34
  30. data/test/unit/test_echeckSale.rb +0 -1
  31. data/test/unit/test_echeckVerification.rb +0 -33
  32. data/test/unit/test_forceCapture.rb +0 -35
  33. data/test/unit/test_sale.rb +20 -51
  34. data/test/unit/test_xmlfields.rb +44 -84
  35. data/test/unit/ts_unit.rb +1 -1
  36. metadata +13 -26
  37. data/index.html +0 -176
  38. data/index.html.1 +0 -176
  39. data/lib/Checker.rb +0 -56
  40. data/test/unit/test_Checker.rb +0 -58
data/CHANGELOG ADDED
@@ -0,0 +1,28 @@
1
+ = LitleOnline CHANGELOG
2
+
3
+ == Version 8.12.1 (May 15, 2012)
4
+
5
+ * Feature: Support Ruby 1.8.7
6
+ * Bugfix: Add support for line item data and tax detail to enhanced auth
7
+
8
+ == Version 8.12.0 (April 16, 2012)
9
+
10
+ * Feature: Add support for actionReason on credit
11
+ * Feature: Track SDK Usage
12
+ * Bugfix: Add support for MerchantData on auth and sale
13
+
14
+ == Version 8.10.3 (April 16, 2012)
15
+
16
+ * Feature: Support Ruby 1.8.6
17
+ * Bugfix: Setup sandbox url was incorrect
18
+ * Cleanup: Support newest sandbox conventions
19
+
20
+ == Version 8.10.1 (March 2, 2012)
21
+
22
+ * Feature: Allow use without the configuration file
23
+ * Bugfix: Reauth works
24
+ * Cleanup: Use ruby conventions
25
+
26
+ == Version 8.10.0 (February 17, 2012)
27
+
28
+ * Initial release
data/Rakefile CHANGED
@@ -34,7 +34,7 @@ spec = Gem::Specification.new do |s|
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.12.0"
37
+ s.version = "8.12.1"
38
38
  s.author = "Litle & Co"
39
39
  s.email = "sdksupport@litle.com"
40
40
  s.homepage = "http://www.litle.com/developers"
@@ -44,9 +44,8 @@ spec = Gem::Specification.new do |s|
44
44
  s.executables = [ 'sample_driver.rb', 'Setup.rb' ]
45
45
  s.test_files = Dir["test/unit/ts_unit.rb"]
46
46
  s.has_rdoc = true
47
- s.add_dependency('i18n')
48
- s.add_dependency('xml-simple')
49
47
  s.add_dependency('xml-object')
48
+ s.add_dependency('xml-mapping')
50
49
  s.add_development_dependency('mocha')
51
50
  end
52
51
 
@@ -38,20 +38,22 @@ class Communications
38
38
  litle_url = config_hash['url']
39
39
 
40
40
  # setup https or http post
41
- uri = URI.parse(litle_url)
41
+ url = URI.parse(litle_url)
42
42
 
43
- http_post = Net::HTTP::Post.new(uri.request_uri)
44
- http_post.body = post_data
45
- http_post['content-type'] = 'text/xml'
46
-
47
- response_xml = ''
48
- begin
49
- proxy = Net::HTTP::Proxy(proxy_addr,proxy_port)
50
- # See notes below on recommended time outs
51
- proxy.start(uri.host, uri.port, :use_ssl => uri.scheme=='https', :read_timeout => config_hash['timeout']) do |http|
52
- response_xml = http.request(http_post)
53
- end
43
+ response_xml = nil
44
+ https = Net::HTTP.new(url.host, url.port, proxy_addr, proxy_port)
45
+ if(url.scheme == 'https')
46
+ https.use_ssl = url.scheme=='https'
47
+ https.verify_mode = OpenSSL::SSL::VERIFY_PEER
48
+ https.ca_file = File.join(File.dirname(__FILE__), "cacert.pem")
54
49
  end
50
+ https.start { |http|
51
+ response = http.request_post(url.path, post_data.to_s, {'Content-type'=>'text/xml'})
52
+ response_xml = response
53
+ }
54
+
55
+
56
+
55
57
 
56
58
  # validate response, only an HTTP 200 will work, redirects are not followed
57
59
  case response_xml
data/lib/LitleOnline.rb CHANGED
@@ -28,18 +28,27 @@ OTHER DEALINGS IN THE SOFTWARE.
28
28
  # Defines the Gem
29
29
  #
30
30
  require 'rubygems'
31
- require 'xmlsimple'
31
+ #require 'xmlsimple'
32
32
  require 'net/http'
33
33
  require 'xml-object'
34
34
  require 'yaml'
35
35
  require 'uri'
36
36
  require 'net/https'
37
+ require 'xml/mapping'
38
+
39
+ unless Kernel.respond_to?(:require_relative)
40
+ module Kernel
41
+ def require_relative(path)
42
+ require File.join(File.dirname(caller[0]), path.to_str)
43
+ end
44
+ end
45
+ end
46
+
37
47
 
38
48
  require_relative 'Communications'
39
49
  require_relative 'Obj2xml'
40
50
  require_relative 'LitleXmlMapper'
41
51
  require_relative 'XMLFields'
42
- require_relative 'Checker'
43
52
  require_relative 'LitleOnlineRequest'
44
53
  require_relative 'Configuration'
45
54
 
@@ -36,322 +36,465 @@ class LitleOnlineRequest
36
36
  end
37
37
 
38
38
  def authorization(hash_in)
39
- is_litle_txn_id_provided = !hash_in['litleTxnId'].nil?
40
- if(is_litle_txn_id_provided)
41
- hash_out = {
42
- :litleTxnId => hash_in['litleTxnId']
43
- }
44
- else
45
- hash_out = {
46
- :orderId => required_field(hash_in['orderId']),
47
- :amount =>required_field(hash_in['amount']),
48
- :orderSource=>required_field(hash_in['orderSource']),
49
- :customerInfo=>XMLFields.customer_info(optional_field(hash_in['customerInfo'])),
50
- :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
51
- :shipToAddress=>XMLFields.contact(optional_field(hash_in['shipToAddress'])),
52
- :card=> XMLFields.card_type(optional_field(hash_in['card'])),
53
- :paypal=>XMLFields.pay_pal(optional_field(hash_in['paypal'])),
54
- :token=>XMLFields.card_token_type(optional_field(hash_in['token'])),
55
- :paypage=>XMLFields.card_paypage_type(optional_field(hash_in['paypage'])),
56
- :billMeLaterRequest=>XMLFields.bill_me_later_request(optional_field(hash_in['billMeLaterRequest'])),
57
- :cardholderAuthentication=>XMLFields.fraud_check_type(optional_field(hash_in['cardholderAuthentication'])),
58
- :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
59
- :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
60
- :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
61
- :taxBilling=>XMLFields.tax_billing(optional_field(hash_in['taxBilling'])),
62
- :enhancedData=>XMLFields.enhanced_data(optional_field(hash_in['enhancedData'])),
63
- :amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData'])),
64
- :allowPartialAuth=>hash_in['allowPartialAuth'],
65
- :healthcareIIAS=>XMLFields.healthcare_iias(optional_field(hash_in['healthcareIIAS'])),
66
- :filtering=>XMLFields.filtering_type(optional_field(hash_in['filtering'])),
67
- :merchantData=>XMLFields.merchant_data(optional_field(hash_in['merchantData'])),
68
- :recyclingRequest=>XMLFields.recycling_request_type(optional_field(hash_in['recyclingRequest']))
69
- }
70
- end
39
+ request = OnlineRequest.new
40
+ authorization = Authorization.new
41
+ authorization.reportGroup = get_report_group(hash_in)
42
+ authorization.transactionId = hash_in['id']
43
+ authorization.customerId = hash_in['customerId']
44
+
45
+ authorization.litleTxnId = hash_in['litleTxnId']
46
+ authorization.orderId = hash_in['orderId']
47
+ authorization.amount = hash_in['amount']
48
+ authorization.orderSource = hash_in['orderSource']
49
+ authorization.customerInfo = CustomerInfo.from_hash(hash_in)
50
+ authorization.billToAddress = Contact.from_hash(hash_in,'billToAddress')
51
+ authorization.shipToAddress = Contact.from_hash(hash_in,'shipToAddress')
52
+ authorization.card = Card.from_hash(hash_in)
53
+ authorization.paypal = PayPal.from_hash(hash_in,'paypal')
54
+ authorization.token = CardToken.from_hash(hash_in,'token')
55
+ authorization.paypage = CardPaypage.from_hash(hash_in,'paypage')
56
+ authorization.billMeLaterRequest = BillMeLaterRequest.from_hash(hash_in)
57
+ authorization.cardholderAuthentication = FraudCheck.from_hash(hash_in)
58
+ authorization.processingInstructions = ProcessingInstructions.from_hash(hash_in)
59
+ authorization.pos = Pos.from_hash(hash_in)
60
+ authorization.customBilling = CustomBilling.from_hash(hash_in)
61
+ authorization.taxType = hash_in['taxType']
62
+ authorization.enhancedData = EnhancedData.from_hash(hash_in)
63
+ authorization.amexAggregatorData = AmexAggregatorData.from_hash(hash_in)
64
+ authorization.allowPartialAuth = hash_in['allowPartialAuth']
65
+ authorization.healthcareIIAS = HealthcareIIAS.from_hash(hash_in)
66
+ authorization.filtering = Filtering.from_hash(hash_in)
67
+ authorization.merchantData = MerchantData.from_hash(hash_in)
68
+ authorization.recyclingRequest = RecyclingRequest.from_hash(hash_in)
69
+
70
+ request.authorization = authorization
71
+
72
+ authentication = Authentication.new
73
+ authentication.user = 'PHXMLTEST'
74
+ authentication.password = 'password'
75
+ request.authentication = authentication
76
+
77
+ request.merchantId = get_merchant_id(hash_in)
78
+ request.version = get_version(hash_in)
79
+ request.xmlns = "http://www.litle.com/schema"
80
+ request.merchantSdk = get_merchant_sdk(hash_in)
71
81
 
72
- hash_out.merge!(get_common_attributes(hash_in))
73
- Checker.purge_null(hash_out)
74
- if(!is_litle_txn_id_provided)
75
- choice1= {'1'=>hash_out[:card],'2' =>hash_out[:paypal],'3'=>hash_out[:token],'4'=>hash_out[:paypage]}
76
- Checker.choice(choice1)
77
- end
78
- Checker.required_missing(hash_out)
79
- litle_online_hash = build_full_hash(hash_in, {:authorization => hash_out})
80
- Checker.required_missing(litle_online_hash)
81
- LitleXmlMapper.request(litle_online_hash,@config_hash)
82
+ xml = request.save_to_xml.to_s
83
+ LitleXmlMapper.request(xml, @config_hash)
82
84
  end
83
85
 
84
86
  def sale(hash_in)
85
- hash_out = {
86
- :litleTxnId => hash_in['litleTxnId'],
87
- :orderId =>required_field(hash_in['orderId']),
88
- :amount =>required_field(hash_in['amount']),
89
- :orderSource=>required_field(hash_in['orderSource']),
90
- :customerInfo=>XMLFields.customer_info(optional_field(hash_in['customerInfo'])),
91
- :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
92
- :shipToAddress=>XMLFields.contact(optional_field(hash_in['shipToAddress'])),
93
- :card=> XMLFields.card_type(optional_field(hash_in['card'])),
94
- :paypal=>XMLFields.pay_pal(optional_field(hash_in['paypal'])),
95
- :token=>XMLFields.card_token_type(optional_field(hash_in['token'])),
96
- :paypage=>XMLFields.card_paypage_type(optional_field(hash_in['paypage'])),
97
- :billMeLaterRequest=>XMLFields.bill_me_later_request(optional_field(hash_in['billMeLaterRequest'])),
98
- :fraudCheck=>XMLFields.fraud_check_type(optional_field(hash_in['fraudCheck'])),
99
- :cardholderAuthentication=>XMLFields.fraud_check_type(optional_field(hash_in['cardholderAuthentication'])),
100
- :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
101
- :taxBilling=>XMLFields.tax_billing(optional_field(hash_in['taxBilling'])),
102
- :enhancedData=>XMLFields.enhanced_data(optional_field(hash_in['enhancedData'])),
103
- :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
104
- :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
105
- :payPalOrderComplete=> hash_in['paypalOrderComplete'],
106
- :payPalNotes=> hash_in['paypalNotesType'],
107
- :amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData'])),
108
- :allowPartialAuth=>hash_in['allowPartialAuth'],
109
- :healthcareIIAS=>XMLFields.healthcare_iias(optional_field(hash_in['healthcareIIAS'])),
110
- :filtering=>XMLFields.filtering_type(optional_field(hash_in['filtering'])),
111
- :merchantData=>XMLFields.merchant_data(optional_field(hash_in['merchantData'])),
112
- :recyclingRequest=>XMLFields.recycling_request_type(optional_field(hash_in['recyclingRequest']))
113
- }
114
- hash_out.merge!(get_common_attributes(hash_in))
115
- Checker.purge_null(hash_out)
116
- choice1= {'1'=>hash_out[:card],'2' =>hash_out[:paypal],'3'=>hash_out[:token],'4'=>hash_out[:paypage]}
117
- choice2= {'1'=>hash_out[:fraudCheck],'2'=>hash_out[:cardholderAuthentication]}
118
- Checker.choice(choice1)
119
- Checker.choice(choice2)
120
- Checker.required_missing(hash_out)
121
- litle_online_hash = build_full_hash(hash_in, {:sale => hash_out})
122
- Checker.required_missing(litle_online_hash)
123
- LitleXmlMapper.request(litle_online_hash,@config_hash)
87
+ request = OnlineRequest.new
88
+ sale = Sale.new
89
+ sale.reportGroup = get_report_group(hash_in)
90
+ sale.transactionId = hash_in['id']
91
+ sale.customerId = hash_in['customerId']
92
+
93
+ sale.litleTxnId = hash_in['litleTxnId']
94
+ sale.orderId = hash_in['orderId']
95
+ sale.amount = hash_in['amount']
96
+ sale.orderSource = hash_in['orderSource']
97
+ sale.customerInfo = CustomerInfo.from_hash(hash_in)
98
+ sale.billToAddress = Contact.from_hash(hash_in,'billToAddress')
99
+ sale.shipToAddress = Contact.from_hash(hash_in,'shipToAddress')
100
+ sale.card = Card.from_hash(hash_in)
101
+ sale.paypal = PayPal.from_hash(hash_in,'paypal')
102
+ sale.token = CardToken.from_hash(hash_in,'token')
103
+ sale.paypage = CardPaypage.from_hash(hash_in,'paypage')
104
+ sale.billMeLaterRequest = BillMeLaterRequest.from_hash(hash_in)
105
+ sale.fraudCheck = FraudCheck.from_hash(hash_in,'fraudCheck')
106
+ sale.cardholderAuthentication = FraudCheck.from_hash(hash_in,'cardholderAuthentication')
107
+ sale.customBilling = CustomBilling.from_hash(hash_in)
108
+ sale.taxType = hash_in['taxType']
109
+ sale.enhancedData = EnhancedData.from_hash(hash_in)
110
+ sale.processingInstructions = ProcessingInstructions.from_hash(hash_in)
111
+ sale.pos = Pos.from_hash(hash_in)
112
+ sale.payPalOrderComplete = hash_in['paPpalOrderComplete']
113
+ sale.payPalNotes = hash_in['payPalNotes']
114
+ sale.amexAggregatorData = AmexAggregatorData.from_hash(hash_in)
115
+ sale.allowPartialAuth = hash_in['allowPartialAuth']
116
+ sale.healthcareIIAS = HealthcareIIAS.from_hash(hash_in)
117
+ sale.filtering = Filtering.from_hash(hash_in)
118
+ sale.merchantData = MerchantData.from_hash(hash_in)
119
+ sale.recyclingRequest = RecyclingRequest.from_hash(hash_in)
120
+
121
+ request.sale = sale
122
+
123
+ authentication = Authentication.new
124
+ authentication.user = 'PHXMLTEST'
125
+ authentication.password = 'password'
126
+ request.authentication = authentication
127
+
128
+ request.merchantId = get_merchant_id(hash_in)
129
+ request.version = get_version(hash_in)
130
+ request.xmlns = "http://www.litle.com/schema"
131
+ request.merchantSdk = get_merchant_sdk(hash_in)
132
+
133
+ xml = request.save_to_xml.to_s
134
+ LitleXmlMapper.request(xml, @config_hash)
124
135
  end
125
136
 
126
137
  def auth_reversal(hash_in)
127
- hash_out = {
128
- :litleTxnId => required_field(hash_in['litleTxnId']),
129
- :amount =>hash_in['amount'],
130
- :payPalNotes=>hash_in['payPalNotes'],
131
- :actionReason=>hash_in['actionReason']
132
- }
133
- hash_out.merge!(get_common_attributes(hash_in))
134
- Checker.purge_null(hash_out)
135
- Checker.required_missing(hash_out)
136
- litle_online_hash = build_full_hash(hash_in, {:authReversal => hash_out})
137
- Checker.required_missing(litle_online_hash)
138
- LitleXmlMapper.request(litle_online_hash,@config_hash)
138
+ request = OnlineRequest.new
139
+ auth_reversal = AuthReversal.new
140
+ auth_reversal.reportGroup = get_report_group(hash_in)
141
+ auth_reversal.transactionId = hash_in['id']
142
+ auth_reversal.customerId = hash_in['customerId']
143
+
144
+ auth_reversal.litleTxnId = hash_in['litleTxnId']
145
+ auth_reversal.amount = hash_in['amount']
146
+ auth_reversal.payPalNotes = hash_in['payPalNotes']
147
+ auth_reversal.actionReason = hash_in['actionReason']
148
+
149
+ request.authReversal = auth_reversal
150
+
151
+ authentication = Authentication.new
152
+ authentication.user = 'PHXMLTEST'
153
+ authentication.password = 'password'
154
+ request.authentication = authentication
155
+
156
+ request.merchantId = get_merchant_id(hash_in)
157
+ request.version = get_version(hash_in)
158
+ request.xmlns = "http://www.litle.com/schema"
159
+ request.merchantSdk = get_merchant_sdk(hash_in)
160
+
161
+ xml = request.save_to_xml.to_s
162
+ LitleXmlMapper.request(xml, @config_hash)
139
163
  end
140
164
 
141
165
  def credit(hash_in)
142
- hash_out = {
143
- :litleTxnId => (hash_in['litleTxnId']),
144
- :orderId =>hash_in['orderId'],
145
- :amount =>hash_in['amount'],
146
- :orderSource=>hash_in['orderSource'],
147
- :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
148
- :card=> XMLFields.card_type(optional_field(hash_in['card'])),
149
- :paypal=>XMLFields.pay_pal(optional_field(hash_in['paypal'])),
150
- :token=>XMLFields.card_token_type(optional_field(hash_in['token'])),
151
- :paypage=>XMLFields.card_paypage_type(optional_field(hash_in['paypage'])),
152
- :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
153
- :taxBilling=>XMLFields.tax_billing(optional_field(hash_in['taxBilling'])),
154
- :billMeLaterRequest=>XMLFields.bill_me_later_request(optional_field(hash_in['billMeLaterRequest'])),
155
- :enhancedData=>XMLFields.enhanced_data(optional_field(hash_in['enhancedData'])),
156
- :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
157
- :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
158
- :amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData'])),
159
- :payPalNotes =>hash_in['payPalNotes'],
160
- :actionReason=>hash_in['actionReason']
161
- }
162
- hash_out.merge!(get_common_attributes(hash_in))
163
- Checker.purge_null(hash_out)
164
- choice1= {'1'=>hash_out[:card],'2' =>hash_out[:paypal],'3'=>hash_out[:token],'4'=>hash_out[:paypage]}
165
- Checker.choice(choice1)
166
- Checker.required_missing(hash_out)
167
- litle_online_hash = build_full_hash(hash_in, {:credit => hash_out})
168
- Checker.purge_null(hash_out)
169
- Checker.required_missing(litle_online_hash)
170
- LitleXmlMapper.request(litle_online_hash,@config_hash)
166
+ request = OnlineRequest.new
167
+ credit = Credit.new
168
+ credit.reportGroup = get_report_group(hash_in)
169
+ credit.transactionId = hash_in['id']
170
+ credit.customerId = hash_in['customerId']
171
+
172
+ credit.litleTxnId = hash_in['litleTxnId']
173
+ credit.orderId = hash_in['orderId']
174
+ credit.amount = hash_in['amount']
175
+ credit.orderSource = hash_in['orderSource']
176
+ credit.billToAddress = Contact.from_hash(hash_in,'billToAddress')
177
+ credit.card = Card.from_hash(hash_in)
178
+ credit.paypal = CreditPayPal.from_hash(hash_in,'paypal')
179
+ credit.token = CardToken.from_hash(hash_in,'token')
180
+ credit.paypage = CardPaypage.from_hash(hash_in,'paypage')
181
+ credit.customBilling = CustomBilling.from_hash(hash_in)
182
+ credit.taxType = hash_in['taxType']
183
+ credit.billMeLaterRequest = BillMeLaterRequest.from_hash(hash_in)
184
+ credit.enhancedData = EnhancedData.from_hash(hash_in)
185
+ credit.processingInstructions = ProcessingInstructions.from_hash(hash_in)
186
+ credit.pos = Pos.from_hash(hash_in)
187
+ credit.amexAggregatorData = AmexAggregatorData.from_hash(hash_in)
188
+ credit.payPalNotes = hash_in['payPalNotes']
189
+ credit.actionReason = hash_in['actionReason']
190
+
191
+ request.credit = credit
192
+
193
+ authentication = Authentication.new
194
+ authentication.user = 'PHXMLTEST'
195
+ authentication.password = 'password'
196
+ request.authentication = authentication
197
+
198
+ request.merchantId = get_merchant_id(hash_in)
199
+ request.version = get_version(hash_in)
200
+ request.xmlns = "http://www.litle.com/schema"
201
+ request.merchantSdk = get_merchant_sdk(hash_in)
202
+
203
+ xml = request.save_to_xml.to_s
204
+ LitleXmlMapper.request(xml, @config_hash)
171
205
  end
172
206
 
173
207
  def register_token_request(hash_in)
174
- hash_out = {
175
- :orderId =>optional_field(hash_in['orderId']),
176
- :accountNumber=>hash_in['accountNumber'],
177
- :echeckForToken=>XMLFields.echeck_for_token_type(optional_field(hash_in['echeckForToken'])),
178
- :paypageRegistrationId=>hash_in['paypageRegistrationId']
179
- }
180
- hash_out.merge!(get_common_attributes(hash_in))
181
- Checker.purge_null(hash_out)
182
- choice1= {'1'=>hash_out[:accountNumber],'2' =>hash_out[:echeckForToken],'3'=>hash_out[:paypageRegistrationId]}
183
- Checker.choice(choice1)
184
- Checker.required_missing(hash_out)
185
- litle_online_hash = build_full_hash(hash_in, {:registerTokenRequest => hash_out})
186
- Checker.required_missing(litle_online_hash)
187
- LitleXmlMapper.request(litle_online_hash,@config_hash)
208
+ request = OnlineRequest.new
209
+ token_request = RegisterTokenRequest.new
210
+ token_request.reportGroup = get_report_group(hash_in)
211
+ token_request.transactionId = hash_in['id']
212
+ token_request.customerId = hash_in['customerId']
213
+
214
+ token_request.orderId = hash_in['orderId']
215
+ token_request.accountNumber = hash_in['accountNumber']
216
+ token_request.echeckForToken = EcheckForToken.from_hash(hash_in)
217
+ token_request.paypageRegistrationId = hash_in['paypageRegistrationId']
218
+
219
+ request.registerTokenRequest = token_request
220
+
221
+ authentication = Authentication.new
222
+ authentication.user = 'PHXMLTEST'
223
+ authentication.password = 'password'
224
+ request.authentication = authentication
225
+
226
+ request.merchantId = get_merchant_id(hash_in)
227
+ request.version = get_version(hash_in)
228
+ request.xmlns = "http://www.litle.com/schema"
229
+ request.merchantSdk = get_merchant_sdk(hash_in)
230
+
231
+ xml = request.save_to_xml.to_s
232
+ LitleXmlMapper.request(xml, @config_hash)
188
233
  end
189
234
 
190
235
  def force_capture(hash_in)
191
- hash_out = {
192
- :orderId =>required_field(hash_in['orderId']),
193
- :amount =>(hash_in['amount']),
194
- :orderSource=>required_field(hash_in['orderSource']),
195
- :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
196
- :card=> XMLFields.card_type(optional_field(hash_in['card'])),
197
- :token=>XMLFields.card_token_type(optional_field(hash_in['token'])),
198
- :paypage=>XMLFields.card_paypage_type(optional_field(hash_in['paypage'])),
199
- :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
200
- :taxBilling=>XMLFields.tax_billing(optional_field(hash_in['taxBilling'])),
201
- :enhancedData=>XMLFields.enhanced_data(optional_field(hash_in['enhancedData'])),
202
- :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
203
- :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
204
- :amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData']))
205
- }
206
- hash_out.merge!(get_common_attributes(hash_in))
207
- Checker.purge_null(hash_out)
208
- choice1= {'1'=>hash_out[:card],'3'=>hash_out[:token],'4'=>hash_out[:paypage]}
209
- Checker.choice(choice1)
210
- Checker.required_missing(hash_out)
211
- litle_online_hash = build_full_hash(hash_in, {:forceCapture => hash_out})
212
- Checker.required_missing(litle_online_hash)
213
- LitleXmlMapper.request(litle_online_hash,@config_hash)
236
+ request = OnlineRequest.new
237
+ force_capture = ForceCapture.new
238
+ force_capture.reportGroup = get_report_group(hash_in)
239
+ force_capture.transactionId = hash_in['id']
240
+ force_capture.customerId = hash_in['customerId']
241
+
242
+ force_capture.orderId = hash_in['orderId']
243
+ force_capture.amount = hash_in['amount']
244
+ force_capture.orderSource = hash_in['orderSource']
245
+ force_capture.billToAddress = Contact.from_hash(hash_in,'billToAddress')
246
+ force_capture.card = Card.from_hash(hash_in)
247
+ force_capture.token = CardToken.from_hash(hash_in,'token')
248
+ force_capture.paypage = CardPaypage.from_hash(hash_in,'paypage')
249
+ force_capture.customBilling = CustomBilling.from_hash(hash_in)
250
+ force_capture.taxType = hash_in['taxType']
251
+ force_capture.enhancedData = EnhancedData.from_hash(hash_in)
252
+ force_capture.processingInstructions = ProcessingInstructions.from_hash(hash_in)
253
+ force_capture.pos = Pos.from_hash(hash_in)
254
+ force_capture.amexAggregatorData = AmexAggregatorData.from_hash(hash_in)
255
+
256
+ request.forceCapture = force_capture
257
+
258
+ authentication = Authentication.new
259
+ authentication.user = 'PHXMLTEST'
260
+ authentication.password = 'password'
261
+ request.authentication = authentication
262
+
263
+ request.merchantId = get_merchant_id(hash_in)
264
+ request.version = get_version(hash_in)
265
+ request.xmlns = "http://www.litle.com/schema"
266
+ request.merchantSdk = get_merchant_sdk(hash_in)
267
+
268
+ xml = request.save_to_xml.to_s
269
+ LitleXmlMapper.request(xml, @config_hash)
214
270
  end
215
271
 
216
272
  def capture(hash_in)
217
- ####TODO check partial
218
- hash_out = {
219
- '@partial'=>hash_in['partial'],
220
- :litleTxnId => required_field(hash_in['litleTxnId']),
221
- :amount =>(hash_in['amount']),
222
- :enhancedData=>XMLFields.enhanced_data(optional_field(hash_in['enhancedData'])),
223
- :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
224
- :payPalOrderComplete=>hash_in['payPalOrderComplete'],
225
- :payPalNotes =>hash_in['payPalNotes']
226
- }
227
- hash_out.merge!(get_common_attributes(hash_in))
228
- Checker.purge_null(hash_out)
229
- Checker.required_missing(hash_out)
230
- litle_online_hash = build_full_hash(hash_in, {:capture => hash_out})
231
- Checker.required_missing(litle_online_hash)
232
- LitleXmlMapper.request(litle_online_hash,@config_hash)
273
+ request = OnlineRequest.new
274
+ capture = Capture.new
275
+ capture.reportGroup = get_report_group(hash_in)
276
+ capture.transactionId = hash_in['id']
277
+ capture.customerId = hash_in['customerId']
278
+
279
+ capture.partial = hash_in['partial']
280
+ capture.litleTxnId = hash_in['litleTxnId']
281
+ capture.amount = hash_in['amount']
282
+ capture.enhancedData = EnhancedData.from_hash(hash_in)
283
+ capture.processingInstructions = ProcessingInstructions.from_hash(hash_in)
284
+ capture.payPalOrderComplete = hash_in['payPalOrderComplete']
285
+ capture.payPalNotes = hash_in['payPalNotes']
286
+
287
+ request.capture = capture
288
+
289
+ authentication = Authentication.new
290
+ authentication.user = 'PHXMLTEST'
291
+ authentication.password = 'password'
292
+ request.authentication = authentication
293
+
294
+ request.merchantId = get_merchant_id(hash_in)
295
+ request.version = get_version(hash_in)
296
+ request.xmlns = "http://www.litle.com/schema"
297
+ request.merchantSdk = get_merchant_sdk(hash_in)
298
+
299
+ xml = request.save_to_xml.to_s
300
+ LitleXmlMapper.request(xml, @config_hash)
233
301
  end
234
302
 
235
303
  def capture_given_auth(hash_in)
236
- hash_out = {
237
- :orderId =>required_field(hash_in['orderId']),
238
- :authInformation=>XMLFields.auth_information(optional_field(hash_in['authInformation'])),
239
- :amount =>required_field(hash_in['amount']),
240
- :orderSource=>required_field(hash_in['orderSource']),
241
- :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
242
- :shipToAddress=>XMLFields.contact(optional_field(hash_in['shipToAddress'])),
243
- :card=> XMLFields.card_type(optional_field(hash_in['card'])),
244
- :token=>XMLFields.card_token_type(optional_field(hash_in['token'])),
245
- :paypage=>XMLFields.card_paypage_type(optional_field(hash_in['paypage'])),
246
- :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
247
- :taxBilling=>XMLFields.tax_billing(optional_field(hash_in['taxBilling'])),
248
- :billMeLaterRequest=>XMLFields.bill_me_later_request(optional_field(hash_in['billMeLaterRequest'])),
249
- :enhancedData=>XMLFields.enhanced_data(optional_field(hash_in['enhancedData'])),
250
- :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
251
- :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
252
- :amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData']))
253
- }
254
- hash_out.merge!(get_common_attributes(hash_in))
255
- Checker.purge_null(hash_out)
256
- choice1= {'1'=>hash_out[:card],'3'=>hash_out[:token],'4'=>hash_out[:paypage]}
257
- Checker.choice(choice1)
258
- Checker.required_missing(hash_out)
259
- litle_online_hash = build_full_hash(hash_in, {:captureGivenAuth => hash_out})
260
- Checker.required_missing(litle_online_hash)
261
- LitleXmlMapper.request(litle_online_hash,@config_hash)
304
+ request = OnlineRequest.new
305
+ capture_given_auth = CaptureGivenAuth.new
306
+ capture_given_auth.reportGroup = get_report_group(hash_in)
307
+ capture_given_auth.transactionId = hash_in['id']
308
+ capture_given_auth.customerId = hash_in['customerId']
309
+
310
+ capture_given_auth.orderId = hash_in['orderId']
311
+ capture_given_auth.authInformation = AuthInformation.from_hash(hash_in)
312
+ capture_given_auth.amount = hash_in['amount']
313
+ capture_given_auth.orderSource = hash_in['orderSource']
314
+ capture_given_auth.billToAddress = Contact.from_hash(hash_in,'billToAddress')
315
+ capture_given_auth.shipToAddress = Contact.from_hash(hash_in,'shipToAddress')
316
+ capture_given_auth.card = Card.from_hash(hash_in)
317
+ capture_given_auth.token = CardToken.from_hash(hash_in,'token')
318
+ capture_given_auth.paypage = CardPaypage.from_hash(hash_in,'paypage')
319
+ capture_given_auth.customBilling = CustomBilling.from_hash(hash_in)
320
+ capture_given_auth.taxType = hash_in['taxType']
321
+ capture_given_auth.billMeLaterRequest = BillMeLaterRequest.from_hash(hash_in)
322
+ capture_given_auth.enhancedData = EnhancedData.from_hash(hash_in)
323
+ capture_given_auth.processingInstructions = ProcessingInstructions.from_hash(hash_in)
324
+ capture_given_auth.pos = Pos.from_hash(hash_in)
325
+ capture_given_auth.amexAggregatorData = AmexAggregatorData.from_hash(hash_in)
326
+
327
+ request.captureGivenAuth = capture_given_auth
328
+
329
+ authentication = Authentication.new
330
+ authentication.user = 'PHXMLTEST'
331
+ authentication.password = 'password'
332
+ request.authentication = authentication
333
+
334
+ request.merchantId = get_merchant_id(hash_in)
335
+ request.version = get_version(hash_in)
336
+ request.xmlns = "http://www.litle.com/schema"
337
+ request.merchantSdk = get_merchant_sdk(hash_in)
338
+
339
+ xml = request.save_to_xml.to_s
340
+ LitleXmlMapper.request(xml, @config_hash)
262
341
  end
263
342
 
264
343
  def echeck_redeposit(hash_in)
265
- hash_out = {
266
- :litleTxnId => required_field(hash_in['litleTxnId']),
267
- :echeck=>XMLFields.echeck_type(optional_field(hash_in['echeck'])),
268
- :echeckToken=>XMLFields.echeck_token_type(optional_field(hash_in['echeckToken']))
269
- }
270
- hash_out.merge!(get_common_attributes(hash_in))
271
- Checker.purge_null(hash_out)
272
- choice1= {'1'=>hash_out[:echeck],'3'=>hash_out[:echeckToken]}
273
- Checker.choice(choice1)
274
- Checker.required_missing(hash_out)
275
- litle_online_hash = build_full_hash(hash_in, {:echeckRedeposit => hash_out})
276
- Checker.required_missing(litle_online_hash)
277
- LitleXmlMapper.request(litle_online_hash,@config_hash)
344
+ request = OnlineRequest.new
345
+ echeck_redeposit = EcheckRedeposit.new
346
+ echeck_redeposit.reportGroup = get_report_group(hash_in)
347
+ echeck_redeposit.transactionId = hash_in['id']
348
+ echeck_redeposit.customerId = hash_in['customerId']
349
+
350
+ echeck_redeposit.litleTxnId = hash_in['litleTxnId']
351
+ echeck_redeposit.echeck = Echeck.from_hash(hash_in)
352
+ echeck_redeposit.echeckToken = EcheckToken.from_hash(hash_in)
353
+
354
+ request.echeckRedeposit = echeck_redeposit
355
+
356
+ authentication = Authentication.new
357
+ authentication.user = 'PHXMLTEST'
358
+ authentication.password = 'password'
359
+ request.authentication = authentication
360
+
361
+ request.merchantId = get_merchant_id(hash_in)
362
+ request.version = get_version(hash_in)
363
+ request.xmlns = "http://www.litle.com/schema"
364
+ request.merchantSdk = get_merchant_sdk(hash_in)
365
+
366
+ xml = request.save_to_xml.to_s
367
+ LitleXmlMapper.request(xml, @config_hash)
278
368
  end
279
369
 
280
370
  def echeck_sale(hash_in)
281
- hash_out = {
282
- :litleTxnId => hash_in['litleTxnId'],
283
- :orderId =>hash_in['orderId'],
284
- :verify =>hash_in['verify'],
285
- :amount =>hash_in['amount'],
286
- :orderSource =>hash_in['orderSource'],
287
- :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
288
- :shipToAddress=>XMLFields.contact(optional_field(hash_in['shipToAddress'])),
289
- :echeck=>XMLFields.echeck_type(optional_field(hash_in['echeck'])),
290
- :echeckToken=>XMLFields.echeck_token_type(optional_field(hash_in['echeckToken'])),
291
- :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
292
- }
293
- hash_out.merge!(get_common_attributes(hash_in))
294
- Checker.purge_null(hash_out)
295
- choice1= {'1'=>hash_out[:echeck],'3'=>hash_out[:echeckToken]}
296
- Checker.choice(choice1)
297
- Checker.required_missing(hash_out)
298
- litle_online_hash = build_full_hash(hash_in, {:echeckSale => hash_out})
299
- Checker.required_missing(litle_online_hash)
300
- LitleXmlMapper.request(litle_online_hash,@config_hash)
371
+ request = OnlineRequest.new
372
+ echeck_sale = EcheckSale.new
373
+ echeck_sale.reportGroup = get_report_group(hash_in)
374
+ echeck_sale.transactionId = hash_in['id']
375
+ echeck_sale.customerId = hash_in['customerId']
376
+
377
+ echeck_sale.litleTxnId = hash_in['litleTxnId']
378
+ echeck_sale.orderId = hash_in['orderId']
379
+ echeck_sale.verify = hash_in['verify']
380
+ echeck_sale.amount = hash_in['amount']
381
+ echeck_sale.orderSource = hash_in['orderSource']
382
+ echeck_sale.billToAddress = Contact.from_hash(hash_in,'billToAddress')
383
+ echeck_sale.shipToAddress = Contact.from_hash(hash_in,'shipToAddress')
384
+ echeck_sale.echeck = Echeck.from_hash(hash_in)
385
+ echeck_sale.echeckToken = EcheckToken.from_hash(hash_in)
386
+ echeck_sale.customBilling = CustomBilling.from_hash(hash_in)
387
+
388
+ request.echeckSale = echeck_sale
389
+
390
+ authentication = Authentication.new
391
+ authentication.user = 'PHXMLTEST'
392
+ authentication.password = 'password'
393
+ request.authentication = authentication
394
+
395
+ request.merchantId = get_merchant_id(hash_in)
396
+ request.version = get_version(hash_in)
397
+ request.xmlns = "http://www.litle.com/schema"
398
+ request.merchantSdk = get_merchant_sdk(hash_in)
399
+
400
+ xml = request.save_to_xml.to_s
401
+ LitleXmlMapper.request(xml, @config_hash)
301
402
  end
302
403
 
303
404
  def echeck_credit(hash_in)
304
- hash_out = {
305
- :litleTxnId => hash_in['litleTxnId'],
306
- :orderId =>hash_in['orderId'],
307
- :amount =>hash_in['amount'],
308
- :orderSource =>hash_in['orderSource'],
309
- :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
310
- :echeck=>XMLFields.echeck_type(optional_field(hash_in['echeck'])),
311
- :echeckToken=>XMLFields.echeck_token_type(optional_field(hash_in['echeckToken'])),
312
- :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
313
- }
314
- hash_out.merge!(get_common_attributes(hash_in))
315
- Checker.purge_null(hash_out)
316
- choice1= {'1'=>hash_out[:echeck],'3'=>hash_out[:echeckToken]}
317
- Checker.choice(choice1)
318
- Checker.required_missing(hash_out)
319
- litle_online_hash = build_full_hash(hash_in, {:echeckCredit => hash_out})
320
- Checker.required_missing(litle_online_hash)
321
- LitleXmlMapper.request(litle_online_hash,@config_hash)
405
+ request = OnlineRequest.new
406
+ echeck_credit = EcheckCredit.new
407
+ echeck_credit.reportGroup = get_report_group(hash_in)
408
+ echeck_credit.transactionId = hash_in['id']
409
+ echeck_credit.customerId = hash_in['customerId']
410
+
411
+ echeck_credit.litleTxnId = hash_in['litleTxnId']
412
+ echeck_credit.orderId = hash_in['orderId']
413
+ echeck_credit.amount = hash_in['amount']
414
+ echeck_credit.orderSource = hash_in['orderSource']
415
+ echeck_credit.billToAddress = Contact.from_hash(hash_in,'billToAddress')
416
+ echeck_credit.echeck = Echeck.from_hash(hash_in)
417
+ echeck_credit.echeckToken = EcheckToken.from_hash(hash_in)
418
+ echeck_credit.customBilling = CustomBilling.from_hash(hash_in)
419
+
420
+ request.echeckCredit = echeck_credit
421
+
422
+ authentication = Authentication.new
423
+ authentication.user = 'PHXMLTEST'
424
+ authentication.password = 'password'
425
+ request.authentication = authentication
426
+
427
+ request.merchantId = get_merchant_id(hash_in)
428
+ request.version = get_version(hash_in)
429
+ request.xmlns = "http://www.litle.com/schema"
430
+ request.merchantSdk = get_merchant_sdk(hash_in)
431
+
432
+ begin
433
+ xml = request.save_to_xml.to_s
434
+ rescue XML::MappingError => e
435
+ puts e
436
+ response = LitleOnlineResponse.new
437
+ response.message = "The content of element 'echeckCredit' is not complete"
438
+ return response
439
+ end
440
+ LitleXmlMapper.request(xml, @config_hash)
322
441
  end
323
442
 
324
443
  def echeck_verification(hash_in)
325
- hash_out = {
326
- :litleTxnId => hash_in['litleTxnId'],
327
- :orderId =>required_field(hash_in['orderId']),
328
- :amount =>required_field(hash_in['amount']),
329
- :orderSource =>required_field(hash_in['orderSource']),
330
- :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
331
- :echeck=>XMLFields.echeck_type(optional_field(hash_in['echeck'])),
332
- :echeckToken=>XMLFields.echeck_token_type(optional_field(hash_in['echeckToken'])),
333
- }
334
- hash_out.merge!(get_common_attributes(hash_in))
335
- Checker.purge_null(hash_out)
336
- choice1= {'1'=>hash_out[:echeck],'3'=>hash_out[:echeckToken]}
337
- Checker.choice(choice1)
338
- Checker.required_missing(hash_out)
339
- litle_online_hash = build_full_hash(hash_in, {:echeckVerification => hash_out})
340
- Checker.required_missing(litle_online_hash)
341
- LitleXmlMapper.request(litle_online_hash,@config_hash)
444
+ request = OnlineRequest.new
445
+ echeck_verification = EcheckVerification.new
446
+ echeck_verification.reportGroup = get_report_group(hash_in)
447
+ echeck_verification.transactionId = hash_in['id']
448
+ echeck_verification.customerId = hash_in['customerId']
449
+
450
+ echeck_verification.litleTxnId = hash_in['litleTxnId']
451
+ echeck_verification.orderId = hash_in['orderId']
452
+ echeck_verification.amount = hash_in['amount']
453
+ echeck_verification.orderSource = hash_in['orderSource']
454
+ echeck_verification.billToAddress = Contact.from_hash(hash_in,'billToAddress')
455
+ echeck_verification.echeck = Echeck.from_hash(hash_in)
456
+ echeck_verification.echeckToken = EcheckToken.from_hash(hash_in)
457
+
458
+ request.echeckVerification = echeck_verification
459
+
460
+ authentication = Authentication.new
461
+ authentication.user = 'PHXMLTEST'
462
+ authentication.password = 'password'
463
+ request.authentication = authentication
464
+
465
+ request.merchantId = get_merchant_id(hash_in)
466
+ request.version = get_version(hash_in)
467
+ request.xmlns = "http://www.litle.com/schema"
468
+ request.merchantSdk = get_merchant_sdk(hash_in)
469
+
470
+ xml = request.save_to_xml.to_s
471
+ LitleXmlMapper.request(xml, @config_hash)
342
472
  end
343
473
 
344
474
  def void(hash_in)
345
- hash_out = {
346
- :litleTxnId => required_field(hash_in['litleTxnId']),
347
- :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions']))
348
- }
349
- hash_out.merge!(get_common_attributes(hash_in))
350
- Checker.purge_null(hash_out)
351
- Checker.required_missing(hash_out)
352
- litle_online_hash = build_full_hash(hash_in, {:void => hash_out})
353
- Checker.required_missing(litle_online_hash)
354
- LitleXmlMapper.request(litle_online_hash,@config_hash)
475
+ request = OnlineRequest.new
476
+ void = Void.new
477
+ void.reportGroup = get_report_group(hash_in)
478
+ void.transactionId = hash_in['id']
479
+ void.customerId = hash_in['customerId']
480
+
481
+ void.litleTxnId = hash_in['litleTxnId']
482
+ void.processingInstructions = ProcessingInstructions.from_hash(hash_in)
483
+
484
+ request.void = void
485
+
486
+ authentication = Authentication.new
487
+ authentication.user = 'PHXMLTEST'
488
+ authentication.password = 'password'
489
+ request.authentication = authentication
490
+
491
+ request.merchantId = get_merchant_id(hash_in)
492
+ request.version = get_version(hash_in)
493
+ request.xmlns = "http://www.litle.com/schema"
494
+ request.merchantSdk = get_merchant_sdk(hash_in)
495
+
496
+ xml = request.save_to_xml.to_s
497
+ LitleXmlMapper.request(xml, @config_hash)
355
498
  end
356
499
 
357
500
  private
@@ -364,16 +507,24 @@ class LitleOnlineRequest
364
507
  end
365
508
  end
366
509
 
510
+ def get_version(hash_in)
511
+ if (hash_in['version'] == nil)
512
+ return @config_hash['version']
513
+ else
514
+ return hash_in['version']
515
+ end
516
+ end
517
+
367
518
  def get_merchant_sdk(hash_in)
368
- if(hash_in['merchantSdk'] == nil)
369
- return 'Ruby;8.12.0'
519
+ if(!hash_in['merchantSdk'])
520
+ return 'Ruby;8.12.1'
370
521
  else
371
522
  return hash_in['merchantSdk']
372
523
  end
373
524
  end
374
525
 
375
526
  def get_report_group(hash_in)
376
- if (hash_in['reportGroup'] == nil)
527
+ if (!hash_in['reportGroup'])
377
528
  return required_field(@config_hash['default_report_group'])
378
529
  else
379
530
  return hash_in['reportGroup']
@@ -381,13 +532,13 @@ class LitleOnlineRequest
381
532
  end
382
533
 
383
534
  def authentication(hash_in)
384
- if(hash_in['user'] == nil)
535
+ if(!hash_in['user'])
385
536
  user = @config_hash['user']
386
537
  else
387
538
  user = hash_in['user']
388
539
  end
389
540
 
390
- if(hash_in['password'] == nil)
541
+ if(!hash_in['password'])
391
542
  password = @config_hash['password']
392
543
  else
393
544
  password = hash_in['password']