LitleOnline 8.10.0 → 8.10.1

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.
Files changed (38) hide show
  1. data/Rakefile +1 -1
  2. data/lib/Communications.rb +3 -4
  3. data/lib/Configuration.rb +1 -1
  4. data/lib/LitleOnlineRequest.rb +170 -139
  5. data/lib/XMLFields.rb +29 -29
  6. data/test/certification/certTest1_base.rb +602 -606
  7. data/test/certification/certTest2_authenhanced.rb +6 -6
  8. data/test/certification/certTest3_authreversal.rb +29 -30
  9. data/test/certification/certTest4_echeck.rb +13 -16
  10. data/test/certification/certTest5_token.rb +11 -31
  11. data/test/functional/test_auth.rb +6 -6
  12. data/test/functional/test_authReversal.rb +6 -6
  13. data/test/functional/test_capture.rb +3 -3
  14. data/test/functional/test_captureGivenAuth.rb +12 -12
  15. data/test/functional/test_credit.rb +7 -7
  16. data/test/functional/test_echeckCredit.rb +11 -11
  17. data/test/functional/test_echeckRedeposit.rb +8 -8
  18. data/test/functional/test_echeckSale.rb +34 -32
  19. data/test/functional/test_echeckVerification.rb +8 -8
  20. data/test/functional/test_forceCapture.rb +8 -8
  21. data/test/functional/test_sale.rb +9 -11
  22. data/test/functional/test_token.rb +12 -12
  23. data/test/functional/test_xmlfields.rb +18 -18
  24. data/test/unit/test_LitleOnlineRequest.rb +26 -17
  25. data/test/unit/test_auth.rb +22 -10
  26. data/test/unit/test_authReversal.rb +2 -2
  27. data/test/unit/test_capture.rb +1 -1
  28. data/test/unit/test_captureGivenAuth.rb +6 -6
  29. data/test/unit/test_credit.rb +4 -7
  30. data/test/unit/test_echeckCredit.rb +2 -2
  31. data/test/unit/test_echeckRedeposit.rb +8 -8
  32. data/test/unit/test_echeckSale.rb +2 -2
  33. data/test/unit/test_echeckVerification.rb +8 -8
  34. data/test/unit/test_forceCapture.rb +8 -8
  35. data/test/unit/test_sale.rb +9 -9
  36. data/test/unit/test_token.rb +4 -4
  37. data/test/unit/test_xmlfields.rb +7 -9
  38. metadata +12 -12
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.10.0"
37
+ s.version = "8.10.1"
38
38
  s.author = "Litle & Co"
39
39
  s.email = "sdksupport@litle.com"
40
40
  s.homepage = "http://www.litle.com/developers"
@@ -33,12 +33,11 @@ class Communications
33
33
  ##For http or https post with or without a proxy
34
34
  def Communications.http_post(post_data,config_hash)
35
35
 
36
- #setup optional proxy
37
- proxy_addr = (config_hash['proxy_addr'] or nil)
38
- proxy_port = ((config_hash['proxy_port']).to_i or nil)
36
+ proxy_addr = config_hash['proxy_addr']
37
+ proxy_port = config_hash['proxy_port']
38
+ litle_url = config_hash['url']
39
39
 
40
40
  # setup https or http post
41
- litle_url = (config_hash['url'] or 'https://cert.litle.com/vap/communicator/online')
42
41
  uri = URI.parse(litle_url)
43
42
 
44
43
  http_post = Net::HTTP::Post.new(uri.request_uri)
data/lib/Configuration.rb CHANGED
@@ -38,7 +38,7 @@ class Configuration
38
38
  end
39
39
  return YAML.load_file(config_file)
40
40
  rescue
41
- raise 'Cannot find the configuration file, ' + config_file + ', Please run Setup.rb first'
41
+ return {}
42
42
  end
43
43
 
44
44
  end
@@ -36,40 +36,49 @@ class LitleOnlineRequest
36
36
  end
37
37
 
38
38
  def authorization(hash_in)
39
- hash_out = {
40
- :litleTxnId => hash_in['litleTxnId'],
41
- :orderId => required_field(hash_in['orderId']),
42
- :amount =>required_field(hash_in['amount']),
43
- :orderSource=>required_field(hash_in['orderSource']),
44
- :customerInfo=>XMLFields.customerInfo(optional_field(hash_in['customerInfo'])),
45
- :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
46
- :shipToAddress=>XMLFields.contact(optional_field(hash_in['shipToAddress'])),
47
- :card=> XMLFields.cardType(optional_field(hash_in['card'])),
48
- :paypal=>XMLFields.payPal(optional_field(hash_in['paypal'])),
49
- :token=>XMLFields.cardTokenType(optional_field(hash_in['token'])),
50
- :paypage=>XMLFields.cardPaypageType(optional_field(hash_in['paypage'])),
51
- :billMeLaterRequest=>XMLFields.billMeLaterRequest(optional_field(hash_in['billMeLaterRequest'])),
52
- :cardholderAuthentication=>XMLFields.fraudCheckType(optional_field(hash_in['cardholderAuthentication'])),
53
- :processingInstructions=>XMLFields.processingInstructions(optional_field(hash_in['processingInstructions'])),
54
- :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
55
- :customBilling=>XMLFields.customBilling(optional_field(hash_in['customBilling'])),
56
- :taxBilling=>XMLFields.taxBilling(optional_field(hash_in['taxBilling'])),
57
- :enhancedData=>XMLFields.enhancedData(optional_field(hash_in['enhancedData'])),
58
- :amexAggregatorData=>XMLFields.amexAggregatorData(optional_field(hash_in['amexAggregatorData'])),
59
- :allowPartialAuth=>hash_in['allowPartialAuth'],
60
- :healthcareIIAS=>XMLFields.healthcareIIAS(optional_field(hash_in['healthcareIIAS'])),
61
- :filtering=>XMLFields.filteringType(optional_field(hash_in['filtering'])),
62
- :merchantData=>XMLFields.filteringType(optional_field(hash_in['merchantData'])),
63
- :recyclingRequest=>XMLFields.recyclingRequestType(optional_field(hash_in['recyclingRequest']))
64
- }
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.filtering_type(optional_field(hash_in['merchantData'])),
68
+ :recyclingRequest=>XMLFields.recycling_request_type(optional_field(hash_in['recyclingRequest']))
69
+ }
70
+ end
71
+
65
72
  hash_out.merge!(get_common_attributes(hash_in))
66
73
  Checker.purge_null(hash_out)
67
- choice1= {'1'=>hash_out[:card],'2' =>hash_out[:paypal],'3'=>hash_out[:token],'4'=>hash_out[:paypage]}
68
- Checker.choice(choice1)
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
69
78
  Checker.required_missing(hash_out)
70
- litleOnline_hash = build_full_hash(hash_in, {:authorization => hash_out})
71
- Checker.required_missing(litleOnline_hash)
72
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
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)
73
82
  end
74
83
 
75
84
  def sale(hash_in)
@@ -78,29 +87,29 @@ class LitleOnlineRequest
78
87
  :orderId =>required_field(hash_in['orderId']),
79
88
  :amount =>required_field(hash_in['amount']),
80
89
  :orderSource=>required_field(hash_in['orderSource']),
81
- :customerInfo=>XMLFields.customerInfo(optional_field(hash_in['customerInfo'])),
90
+ :customerInfo=>XMLFields.customer_info(optional_field(hash_in['customerInfo'])),
82
91
  :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
83
92
  :shipToAddress=>XMLFields.contact(optional_field(hash_in['shipToAddress'])),
84
- :card=> XMLFields.cardType(optional_field(hash_in['card'])),
85
- :paypal=>XMLFields.payPal(optional_field(hash_in['paypal'])),
86
- :token=>XMLFields.cardTokenType(optional_field(hash_in['token'])),
87
- :paypage=>XMLFields.cardPaypageType(optional_field(hash_in['paypage'])),
88
- :billMeLaterRequest=>XMLFields.billMeLaterRequest(optional_field(hash_in['billMeLaterRequest'])),
89
- :fraudCheck=>XMLFields.fraudCheckType(optional_field(hash_in['fraudCheck'])),
90
- :cardholderAuthentication=>XMLFields.fraudCheckType(optional_field(hash_in['cardholderAuthentication'])),
91
- :customBilling=>XMLFields.customBilling(optional_field(hash_in['customBilling'])),
92
- :taxBilling=>XMLFields.taxBilling(optional_field(hash_in['taxBilling'])),
93
- :enhancedData=>XMLFields.enhancedData(optional_field(hash_in['enhancedData'])),
94
- :processingInstructions=>XMLFields.processingInstructions(optional_field(hash_in['processingInstructions'])),
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'])),
95
104
  :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
96
105
  :payPalOrderComplete=> hash_in['paypalOrderComplete'],
97
106
  :payPalNotes=> hash_in['paypalNotesType'],
98
- :amexAggregatorData=>XMLFields.amexAggregatorData(optional_field(hash_in['amexAggregatorData'])),
107
+ :amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData'])),
99
108
  :allowPartialAuth=>hash_in['allowPartialAuth'],
100
- :healthcareIIAS=>XMLFields.healthcareIIAS(optional_field(hash_in['healthcareIIAS'])),
101
- :filtering=>XMLFields.filteringType(optional_field(hash_in['filtering'])),
102
- :merchantData=>XMLFields.filteringType(optional_field(hash_in['merchantData'])),
103
- :recyclingRequest=>XMLFields.recyclingRequestType(optional_field(hash_in['recyclingRequest']))
109
+ :healthcareIIAS=>XMLFields.healthcare_iias(optional_field(hash_in['healthcareIIAS'])),
110
+ :filtering=>XMLFields.filtering_type(optional_field(hash_in['filtering'])),
111
+ :merchantData=>XMLFields.filtering_type(optional_field(hash_in['merchantData'])),
112
+ :recyclingRequest=>XMLFields.recycling_request_type(optional_field(hash_in['recyclingRequest']))
104
113
  }
105
114
  hash_out.merge!(get_common_attributes(hash_in))
106
115
  Checker.purge_null(hash_out)
@@ -109,12 +118,12 @@ class LitleOnlineRequest
109
118
  Checker.choice(choice1)
110
119
  Checker.choice(choice2)
111
120
  Checker.required_missing(hash_out)
112
- litleOnline_hash = build_full_hash(hash_in, {:sale => hash_out})
113
- Checker.required_missing(litleOnline_hash)
114
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
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)
115
124
  end
116
125
 
117
- def authReversal(hash_in)
126
+ def auth_reversal(hash_in)
118
127
  hash_out = {
119
128
  :litleTxnId => required_field(hash_in['litleTxnId']),
120
129
  :amount =>hash_in['amount'],
@@ -124,9 +133,9 @@ class LitleOnlineRequest
124
133
  hash_out.merge!(get_common_attributes(hash_in))
125
134
  Checker.purge_null(hash_out)
126
135
  Checker.required_missing(hash_out)
127
- litleOnline_hash = build_full_hash(hash_in, {:authReversal => hash_out})
128
- Checker.required_missing(litleOnline_hash)
129
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
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)
130
139
  end
131
140
 
132
141
  def credit(hash_in)
@@ -136,17 +145,17 @@ class LitleOnlineRequest
136
145
  :amount =>hash_in['amount'],
137
146
  :orderSource=>hash_in['orderSource'],
138
147
  :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
139
- :card=> XMLFields.cardType(optional_field(hash_in['card'])),
140
- :paypal=>XMLFields.payPal(optional_field(hash_in['paypal'])),
141
- :token=>XMLFields.cardTokenType(optional_field(hash_in['token'])),
142
- :paypage=>XMLFields.cardPaypageType(optional_field(hash_in['paypage'])),
143
- :customBilling=>XMLFields.customBilling(optional_field(hash_in['customBilling'])),
144
- :taxBilling=>XMLFields.taxBilling(optional_field(hash_in['taxBilling'])),
145
- :billMeLaterRequest=>XMLFields.billMeLaterRequest(optional_field(hash_in['billMeLaterRequest'])),
146
- :enhancedData=>XMLFields.enhancedData(optional_field(hash_in['enhancedData'])),
147
- :processingInstructions=>XMLFields.processingInstructions(optional_field(hash_in['processingInstructions'])),
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'])),
148
157
  :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
149
- :amexAggregatorData=>XMLFields.amexAggregatorData(optional_field(hash_in['amexAggregatorData'])),
158
+ :amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData'])),
150
159
  :payPalNotes =>hash_in['payPalNotes']
151
160
  }
152
161
  hash_out.merge!(get_common_attributes(hash_in))
@@ -154,17 +163,17 @@ class LitleOnlineRequest
154
163
  choice1= {'1'=>hash_out[:card],'2' =>hash_out[:paypal],'3'=>hash_out[:token],'4'=>hash_out[:paypage]}
155
164
  Checker.choice(choice1)
156
165
  Checker.required_missing(hash_out)
157
- litleOnline_hash = build_full_hash(hash_in, {:credit => hash_out})
166
+ litle_online_hash = build_full_hash(hash_in, {:credit => hash_out})
158
167
  Checker.purge_null(hash_out)
159
- Checker.required_missing(litleOnline_hash)
160
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
168
+ Checker.required_missing(litle_online_hash)
169
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
161
170
  end
162
171
 
163
- def registerTokenRequest(hash_in)
172
+ def register_token_request(hash_in)
164
173
  hash_out = {
165
174
  :orderId =>optional_field(hash_in['orderId']),
166
175
  :accountNumber=>hash_in['accountNumber'],
167
- :echeckForToken=>XMLFields.echeckForTokenType(optional_field(hash_in['echeckForToken'])),
176
+ :echeckForToken=>XMLFields.echeck_for_token_type(optional_field(hash_in['echeckForToken'])),
168
177
  :paypageRegistrationId=>hash_in['paypageRegistrationId']
169
178
  }
170
179
  hash_out.merge!(get_common_attributes(hash_in))
@@ -172,35 +181,35 @@ class LitleOnlineRequest
172
181
  choice1= {'1'=>hash_out[:accountNumber],'2' =>hash_out[:echeckForToken],'3'=>hash_out[:paypageRegistrationId]}
173
182
  Checker.choice(choice1)
174
183
  Checker.required_missing(hash_out)
175
- litleOnline_hash = build_full_hash(hash_in, {:registerTokenRequest => hash_out})
176
- Checker.required_missing(litleOnline_hash)
177
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
184
+ litle_online_hash = build_full_hash(hash_in, {:registerTokenRequest => hash_out})
185
+ Checker.required_missing(litle_online_hash)
186
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
178
187
  end
179
188
 
180
- def forceCapture(hash_in)
189
+ def force_capture(hash_in)
181
190
  hash_out = {
182
191
  :orderId =>required_field(hash_in['orderId']),
183
192
  :amount =>(hash_in['amount']),
184
193
  :orderSource=>required_field(hash_in['orderSource']),
185
194
  :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
186
- :card=> XMLFields.cardType(optional_field(hash_in['card'])),
187
- :token=>XMLFields.cardTokenType(optional_field(hash_in['token'])),
188
- :paypage=>XMLFields.cardPaypageType(optional_field(hash_in['paypage'])),
189
- :customBilling=>XMLFields.customBilling(optional_field(hash_in['customBilling'])),
190
- :taxBilling=>XMLFields.taxBilling(optional_field(hash_in['taxBilling'])),
191
- :enhancedData=>XMLFields.enhancedData(optional_field(hash_in['enhancedData'])),
192
- :processingInstructions=>XMLFields.processingInstructions(optional_field(hash_in['processingInstructions'])),
195
+ :card=> XMLFields.card_type(optional_field(hash_in['card'])),
196
+ :token=>XMLFields.card_token_type(optional_field(hash_in['token'])),
197
+ :paypage=>XMLFields.card_paypage_type(optional_field(hash_in['paypage'])),
198
+ :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
199
+ :taxBilling=>XMLFields.tax_billing(optional_field(hash_in['taxBilling'])),
200
+ :enhancedData=>XMLFields.enhanced_data(optional_field(hash_in['enhancedData'])),
201
+ :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
193
202
  :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
194
- :amexAggregatorData=>XMLFields.amexAggregatorData(optional_field(hash_in['amexAggregatorData']))
203
+ :amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData']))
195
204
  }
196
205
  hash_out.merge!(get_common_attributes(hash_in))
197
206
  Checker.purge_null(hash_out)
198
207
  choice1= {'1'=>hash_out[:card],'3'=>hash_out[:token],'4'=>hash_out[:paypage]}
199
208
  Checker.choice(choice1)
200
209
  Checker.required_missing(hash_out)
201
- litleOnline_hash = build_full_hash(hash_in, {:forceCapture => hash_out})
202
- Checker.required_missing(litleOnline_hash)
203
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
210
+ litle_online_hash = build_full_hash(hash_in, {:forceCapture => hash_out})
211
+ Checker.required_missing(litle_online_hash)
212
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
204
213
  end
205
214
 
206
215
  def capture(hash_in)
@@ -209,65 +218,65 @@ class LitleOnlineRequest
209
218
  '@partial'=>hash_in['partial'],
210
219
  :litleTxnId => required_field(hash_in['litleTxnId']),
211
220
  :amount =>(hash_in['amount']),
212
- :enhancedData=>XMLFields.enhancedData(optional_field(hash_in['enhancedData'])),
213
- :processingInstructions=>XMLFields.processingInstructions(optional_field(hash_in['processingInstructions'])),
221
+ :enhancedData=>XMLFields.enhanced_data(optional_field(hash_in['enhancedData'])),
222
+ :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
214
223
  :payPalOrderComplete=>hash_in['payPalOrderComplete'],
215
224
  :payPalNotes =>hash_in['payPalNotes']
216
225
  }
217
226
  hash_out.merge!(get_common_attributes(hash_in))
218
227
  Checker.purge_null(hash_out)
219
228
  Checker.required_missing(hash_out)
220
- litleOnline_hash = build_full_hash(hash_in, {:capture => hash_out})
221
- Checker.required_missing(litleOnline_hash)
222
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
229
+ litle_online_hash = build_full_hash(hash_in, {:capture => hash_out})
230
+ Checker.required_missing(litle_online_hash)
231
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
223
232
  end
224
233
 
225
- def captureGivenAuth(hash_in)
234
+ def capture_given_auth(hash_in)
226
235
  hash_out = {
227
236
  :orderId =>required_field(hash_in['orderId']),
228
- :authInformation=>XMLFields.authInformation(optional_field(hash_in['authInformation'])),
237
+ :authInformation=>XMLFields.auth_information(optional_field(hash_in['authInformation'])),
229
238
  :amount =>required_field(hash_in['amount']),
230
239
  :orderSource=>required_field(hash_in['orderSource']),
231
240
  :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
232
241
  :shipToAddress=>XMLFields.contact(optional_field(hash_in['shipToAddress'])),
233
- :card=> XMLFields.cardType(optional_field(hash_in['card'])),
234
- :token=>XMLFields.cardTokenType(optional_field(hash_in['token'])),
235
- :paypage=>XMLFields.cardPaypageType(optional_field(hash_in['paypage'])),
236
- :customBilling=>XMLFields.customBilling(optional_field(hash_in['customBilling'])),
237
- :taxBilling=>XMLFields.taxBilling(optional_field(hash_in['taxBilling'])),
238
- :billMeLaterRequest=>XMLFields.billMeLaterRequest(optional_field(hash_in['billMeLaterRequest'])),
239
- :enhancedData=>XMLFields.enhancedData(optional_field(hash_in['enhancedData'])),
240
- :processingInstructions=>XMLFields.processingInstructions(optional_field(hash_in['processingInstructions'])),
242
+ :card=> XMLFields.card_type(optional_field(hash_in['card'])),
243
+ :token=>XMLFields.card_token_type(optional_field(hash_in['token'])),
244
+ :paypage=>XMLFields.card_paypage_type(optional_field(hash_in['paypage'])),
245
+ :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
246
+ :taxBilling=>XMLFields.tax_billing(optional_field(hash_in['taxBilling'])),
247
+ :billMeLaterRequest=>XMLFields.bill_me_later_request(optional_field(hash_in['billMeLaterRequest'])),
248
+ :enhancedData=>XMLFields.enhanced_data(optional_field(hash_in['enhancedData'])),
249
+ :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions'])),
241
250
  :pos=>XMLFields.pos(optional_field(hash_in['pos'])),
242
- :amexAggregatorData=>XMLFields.amexAggregatorData(optional_field(hash_in['amexAggregatorData']))
251
+ :amexAggregatorData=>XMLFields.amex_aggregator_data(optional_field(hash_in['amexAggregatorData']))
243
252
  }
244
253
  hash_out.merge!(get_common_attributes(hash_in))
245
254
  Checker.purge_null(hash_out)
246
255
  choice1= {'1'=>hash_out[:card],'3'=>hash_out[:token],'4'=>hash_out[:paypage]}
247
256
  Checker.choice(choice1)
248
257
  Checker.required_missing(hash_out)
249
- litleOnline_hash = build_full_hash(hash_in, {:captureGivenAuth => hash_out})
250
- Checker.required_missing(litleOnline_hash)
251
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
258
+ litle_online_hash = build_full_hash(hash_in, {:captureGivenAuth => hash_out})
259
+ Checker.required_missing(litle_online_hash)
260
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
252
261
  end
253
262
 
254
- def echeckRedeposit(hash_in)
263
+ def echeck_redeposit(hash_in)
255
264
  hash_out = {
256
265
  :litleTxnId => required_field(hash_in['litleTxnId']),
257
- :echeck=>XMLFields.echeckType(optional_field(hash_in['echeck'])),
258
- :echeckToken=>XMLFields.echeckTokenType(optional_field(hash_in['echeckToken']))
266
+ :echeck=>XMLFields.echeck_type(optional_field(hash_in['echeck'])),
267
+ :echeckToken=>XMLFields.echeck_token_type(optional_field(hash_in['echeckToken']))
259
268
  }
260
269
  hash_out.merge!(get_common_attributes(hash_in))
261
270
  Checker.purge_null(hash_out)
262
271
  choice1= {'1'=>hash_out[:echeck],'3'=>hash_out[:echeckToken]}
263
272
  Checker.choice(choice1)
264
273
  Checker.required_missing(hash_out)
265
- litleOnline_hash = build_full_hash(hash_in, {:echeckRedeposit => hash_out})
266
- Checker.required_missing(litleOnline_hash)
267
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
274
+ litle_online_hash = build_full_hash(hash_in, {:echeckRedeposit => hash_out})
275
+ Checker.required_missing(litle_online_hash)
276
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
268
277
  end
269
278
 
270
- def echeckSale(hash_in)
279
+ def echeck_sale(hash_in)
271
280
  hash_out = {
272
281
  :litleTxnId => hash_in['litleTxnId'],
273
282
  :orderId =>hash_in['orderId'],
@@ -276,72 +285,72 @@ class LitleOnlineRequest
276
285
  :orderSource =>hash_in['orderSource'],
277
286
  :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
278
287
  :shipToAddress=>XMLFields.contact(optional_field(hash_in['shipToAddress'])),
279
- :echeck=>XMLFields.echeckType(optional_field(hash_in['echeck'])),
280
- :echeckToken=>XMLFields.echeckTokenType(optional_field(hash_in['echeckToken'])),
281
- :customBilling=>XMLFields.customBilling(optional_field(hash_in['customBilling'])),
288
+ :echeck=>XMLFields.echeck_type(optional_field(hash_in['echeck'])),
289
+ :echeckToken=>XMLFields.echeck_token_type(optional_field(hash_in['echeckToken'])),
290
+ :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
282
291
  }
283
292
  hash_out.merge!(get_common_attributes(hash_in))
284
293
  Checker.purge_null(hash_out)
285
294
  choice1= {'1'=>hash_out[:echeck],'3'=>hash_out[:echeckToken]}
286
295
  Checker.choice(choice1)
287
296
  Checker.required_missing(hash_out)
288
- litleOnline_hash = build_full_hash(hash_in, {:echeckSale => hash_out})
289
- Checker.required_missing(litleOnline_hash)
290
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
297
+ litle_online_hash = build_full_hash(hash_in, {:echeckSale => hash_out})
298
+ Checker.required_missing(litle_online_hash)
299
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
291
300
  end
292
301
 
293
- def echeckCredit(hash_in)
302
+ def echeck_credit(hash_in)
294
303
  hash_out = {
295
304
  :litleTxnId => hash_in['litleTxnId'],
296
305
  :orderId =>hash_in['orderId'],
297
306
  :amount =>hash_in['amount'],
298
307
  :orderSource =>hash_in['orderSource'],
299
308
  :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
300
- :echeck=>XMLFields.echeckType(optional_field(hash_in['echeck'])),
301
- :echeckToken=>XMLFields.echeckTokenType(optional_field(hash_in['echeckToken'])),
302
- :customBilling=>XMLFields.customBilling(optional_field(hash_in['customBilling'])),
309
+ :echeck=>XMLFields.echeck_type(optional_field(hash_in['echeck'])),
310
+ :echeckToken=>XMLFields.echeck_token_type(optional_field(hash_in['echeckToken'])),
311
+ :customBilling=>XMLFields.custom_billing(optional_field(hash_in['customBilling'])),
303
312
  }
304
313
  hash_out.merge!(get_common_attributes(hash_in))
305
314
  Checker.purge_null(hash_out)
306
315
  choice1= {'1'=>hash_out[:echeck],'3'=>hash_out[:echeckToken]}
307
316
  Checker.choice(choice1)
308
317
  Checker.required_missing(hash_out)
309
- litleOnline_hash = build_full_hash(hash_in, {:echeckCredit => hash_out})
310
- Checker.required_missing(litleOnline_hash)
311
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
318
+ litle_online_hash = build_full_hash(hash_in, {:echeckCredit => hash_out})
319
+ Checker.required_missing(litle_online_hash)
320
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
312
321
  end
313
322
 
314
- def echeckVerification(hash_in)
323
+ def echeck_verification(hash_in)
315
324
  hash_out = {
316
325
  :litleTxnId => hash_in['litleTxnId'],
317
326
  :orderId =>required_field(hash_in['orderId']),
318
327
  :amount =>required_field(hash_in['amount']),
319
328
  :orderSource =>required_field(hash_in['orderSource']),
320
329
  :billToAddress=>XMLFields.contact(optional_field(hash_in['billToAddress'])),
321
- :echeck=>XMLFields.echeckType(optional_field(hash_in['echeck'])),
322
- :echeckToken=>XMLFields.echeckTokenType(optional_field(hash_in['echeckToken'])),
330
+ :echeck=>XMLFields.echeck_type(optional_field(hash_in['echeck'])),
331
+ :echeckToken=>XMLFields.echeck_token_type(optional_field(hash_in['echeckToken'])),
323
332
  }
324
333
  hash_out.merge!(get_common_attributes(hash_in))
325
334
  Checker.purge_null(hash_out)
326
335
  choice1= {'1'=>hash_out[:echeck],'3'=>hash_out[:echeckToken]}
327
336
  Checker.choice(choice1)
328
337
  Checker.required_missing(hash_out)
329
- litleOnline_hash = build_full_hash(hash_in, {:echeckVerification => hash_out})
330
- Checker.required_missing(litleOnline_hash)
331
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
338
+ litle_online_hash = build_full_hash(hash_in, {:echeckVerification => hash_out})
339
+ Checker.required_missing(litle_online_hash)
340
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
332
341
  end
333
342
 
334
343
  def void(hash_in)
335
344
  hash_out = {
336
345
  :litleTxnId => required_field(hash_in['litleTxnId']),
337
- :processingInstructions=>XMLFields.processingInstructions(optional_field(hash_in['processingInstructions']))
346
+ :processingInstructions=>XMLFields.processing_instructions(optional_field(hash_in['processingInstructions']))
338
347
  }
339
348
  hash_out.merge!(get_common_attributes(hash_in))
340
349
  Checker.purge_null(hash_out)
341
350
  Checker.required_missing(hash_out)
342
- litleOnline_hash = build_full_hash(hash_in, {:void => hash_out})
343
- Checker.required_missing(litleOnline_hash)
344
- LitleXmlMapper.request(litleOnline_hash,@config_hash)
351
+ litle_online_hash = build_full_hash(hash_in, {:void => hash_out})
352
+ Checker.required_missing(litle_online_hash)
353
+ LitleXmlMapper.request(litle_online_hash,@config_hash)
345
354
  end
346
355
 
347
356
  private
@@ -363,9 +372,21 @@ class LitleOnlineRequest
363
372
  end
364
373
 
365
374
  def authentication(hash_in)
375
+ if(hash_in['user'] == nil)
376
+ user = @config_hash['user']
377
+ else
378
+ user = hash_in['user']
379
+ end
380
+
381
+ if(hash_in['password'] == nil)
382
+ password = @config_hash['password']
383
+ else
384
+ password = hash_in['password']
385
+ end
386
+
366
387
  hash_out = {
367
- :user =>required_field(@config_hash['user']),
368
- :password =>required_field(@config_hash['password'])
388
+ :user =>required_field(user),
389
+ :password =>required_field(password)
369
390
  }
370
391
  Checker.required_missing(hash_out)
371
392
  end
@@ -379,16 +400,26 @@ class LitleOnlineRequest
379
400
  end
380
401
 
381
402
  def build_full_hash(hash_in, merge_hash)
382
- litleOnline_hash = {
383
- "@version"=> required_field(@config_hash['version']),
403
+ if(hash_in['version'] == nil)
404
+ version = @config_hash['version']
405
+ else
406
+ version = hash_in['version']
407
+ end
408
+
409
+ litle_online_hash = {
410
+ "@version"=> required_field(version),
384
411
  "@xmlns"=> "http://www.litle.com/schema",
385
412
  "@merchantId"=> get_merchant_id(hash_in),
386
413
  :authentication => authentication(hash_in)
387
414
  }
388
- return litleOnline_hash.merge(merge_hash)
415
+ return litle_online_hash.merge(merge_hash)
389
416
  end
390
417
 
391
418
  def get_common_attributes(hash_in)
419
+ @config_hash['proxy_addr'] = hash_in['proxy_addr'].nil? ? @config_hash['proxy_addr'] : hash_in['proxy_addr']
420
+ @config_hash['proxy_port'] = hash_in['proxy_port'].nil? ? @config_hash['proxy_port'] : hash_in['proxy_port']
421
+ @config_hash['url'] = hash_in['url'].nil? ? @config_hash['url'] : hash_in['url']
422
+
392
423
  return {
393
424
  '@id' => hash_in['id'],
394
425
  '@customerId' => hash_in['customerId'],