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
@@ -28,10 +28,9 @@ OTHER DEALINGS IN THE SOFTWARE.
28
28
  # Maps the request to Litle XML -> Sends XML payload to Litle via HTTP(S) -> formats XML response into a Ruby hash and returns it
29
29
  #
30
30
  class LitleXmlMapper
31
- def LitleXmlMapper.request(hash,config_hash)
31
+ def LitleXmlMapper.request(request_xml, config_hash)
32
32
 
33
33
  # create a Litle XML request from the nested hashes
34
- request_xml = Obj2xml.to_XML(hash)
35
34
  if(config_hash['printxml'])
36
35
  puts request_xml
37
36
  end
data/lib/XMLFields.rb CHANGED
@@ -22,368 +22,961 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
-
26
25
  #
27
26
  # Contains all of the underlying XML fields and specifications needed to create the transaction set
28
27
  #
29
- class XMLFields
30
- def XMLFields.contact(hash_in)
31
- hash_out = {
32
- :name => hash_in['name'],
33
- :firstName =>hash_in['firstName'],
34
- :middleInitial=>hash_in['middleInitial'],
35
- :lastName=>hash_in['lastName'],
36
- :companyName=>hash_in['companyName'],
37
- :addressLine1=>hash_in['addressLine1'],
38
- :addressLine2=>hash_in['addressLine2'],
39
- :addressLine3=>hash_in['addressLine3'],
40
- :city=>hash_in['city'],
41
- :state=>hash_in['state'],
42
- :zip=>hash_in['zip'],
43
- :country=>hash_in['country'],
44
- :email=>hash_in['email'],
45
- :phone=>hash_in['phone']
46
- }
47
- Checker.purge_null(hash_out)
48
- Checker.required_missing(hash_out)
49
- return hash_out
28
+
29
+ class OptionalChoiceNode < XML::Mapping::ChoiceNode
30
+ def obj_to_xml(obj,xml)
31
+ count = 0
32
+ @choices.each do |path,node|
33
+ if node.is_present_in? obj
34
+ count = count + 1
35
+ end
36
+ end
37
+ if(count > 1)
38
+ raise RuntimeError, "Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!"
39
+ end
40
+ @choices.each do |path,node|
41
+ if node.is_present_in? obj
42
+ node.obj_to_xml(obj,xml)
43
+ path.first(xml, :ensure_created=>true)
44
+ return true
45
+ end
46
+ end
50
47
  end
48
+ end
49
+
50
+ XML::Mapping.add_node_class OptionalChoiceNode
51
51
 
52
- def XMLFields.customer_info(hash_in)
53
- hash_out={
54
- :ssn=>hash_in['ssn'],
55
- :dob=>hash_in['dob'],
56
- :customerRegistrationDate=>hash_in['customerRegistrationDate'],
57
- :customerType=>hash_in['customerType'],
58
- :incomeAmount=>hash_in['incomeAmount'],
59
- :incomeCurrency=>hash_in['incomeCurrency'],
60
- :customerCheckingAccount=>hash_in['customerCheckingAccount'],
61
- :customerSavingAccount=>hash_in['customerSavingAccount'],
62
- :customerWorkTelephone=>hash_in['customerWorkTelephone'],
63
- :residenceStatus=>hash_in['residenceStatus'],
64
- :yearsAtResidence=>hash_in['yearsAtResidence'],
65
- :yearsAtEmployer=>hash_in['yearsAtEmployer']
66
- }
67
- Checker.purge_null(hash_out)
68
- Checker.required_missing(hash_out)
69
- return hash_out
52
+ class Authentication
53
+ include XML::Mapping
54
+ text_node :user, "user"
55
+ text_node :password, "password"
56
+ end
57
+
58
+ class Contact
59
+ include XML::Mapping
60
+ text_node :name, "name", :default_value=>nil
61
+ text_node :firstName, "firstName", :default_value=>nil
62
+ text_node :middleInitial, "middleInitial", :default_value=>nil
63
+ text_node :lastName, "lastName", :default_value=>nil
64
+ text_node :companyName, "companyName", :default_value=>nil
65
+ text_node :addressLine1, "addressLine1", :default_value=>nil
66
+ text_node :addressLine2, "addressLine2", :default_value=>nil
67
+ text_node :addressLine3, "addressLine3", :default_value=>nil
68
+ text_node :city, "city", :default_value=>nil
69
+ text_node :state, "state", :default_value=>nil
70
+ text_node :zip, "zip", :default_value=>nil
71
+ text_node :country, "country", :default_value=>nil
72
+ text_node :email, "email", :default_value=>nil
73
+ text_node :phone, "phone", :default_value=>nil
74
+ def self.from_hash(hash, name='contact')
75
+ base = hash[name]
76
+ if(base)
77
+ this = Contact.new
78
+ this.name = base['name']
79
+ this.firstName = base['firstName']
80
+ this.middleInitial = base['middleInitial']
81
+ this.lastName = base['lastName']
82
+ this.companyName = base['companyName']
83
+ this.addressLine1 = base['addressLine1']
84
+ this.addressLine2 = base['addressLine2']
85
+ this.addressLine3 = base['addressLine3']
86
+ this.city = base['city']
87
+ this.state = base['state']
88
+ this.zip = base['zip']
89
+ this.country = base['country']
90
+ this.email = base['email']
91
+ this.phone = base['phone']
92
+ this
93
+ else
94
+ nil
95
+ end
70
96
  end
97
+ end
71
98
 
72
- def XMLFields.bill_me_later_request(hash_in)
73
- hash_out = {
74
- :bmlMerchantId=>hash_in['bmlMerchantId'],
75
- :termsAndConditions=>hash_in['termsAndConditions'],
76
- :preapprovalNumber=>hash_in['preapprovalNumber'],
77
- :merchantPromotionalCode=>hash_in['merchantPromotionalCode'],
78
- :customerPasswordChanged=>hash_in['customerPasswordChanged'],
79
- :customerEmailChanged=>hash_in['customerEmailChanged'],
80
- :customerPhoneChanged=>hash_in['customerPhoneChanged'],
81
- :secretQuestionCode=>hash_in['secretQuestionCode'],
82
- :secretQuestionAnswer=>hash_in['secretQuestionAnswer'] ,
83
- :virtualAuthenticationKeyPresenceIndicator=>hash_in['virtualAuthenticationKeyPresenceIndicator'] ,
84
- :virtualAuthenticationKeyData=>hash_in['virtualAuthenticationKeyData'],
85
- :itemCategoryCode=>hash_in['itemCategoryCode'] ,
86
- :authorizationSourcePlatform=>hash_in['authorizationSourcePlatform']
87
- }
88
- Checker.purge_null(hash_out)
89
- Checker.required_missing(hash_out)
90
- return hash_out
99
+ class CustomerInfo
100
+ include XML::Mapping
101
+ text_node :ssn, "ssn", :default_value=>nil
102
+ text_node :dob, "dob", :default_value=>nil
103
+ text_node :customerRegistrationDate, "customerRegistrationDate", :default_value=>nil
104
+ text_node :customerType, "customerType", :default_value=>nil
105
+ text_node :incomeAmount, "incomeAmount", :default_value=>nil
106
+ text_node :incomeCurrency, "incomeCurrency", :default_value=>nil
107
+ text_node :customerCheckingAccount, "customerCheckingAccount", :default_value=>nil
108
+ text_node :customerSavingAccount, "customerSavingAccount", :default_value=>nil
109
+ text_node :customerWorkTelephone, "customerWorkTelephone", :default_value=>nil
110
+ text_node :residenceStatus, "residenceStatus", :default_value=>nil
111
+ text_node :yearsAtResidence, "yearsAtResidence", :default_value=>nil
112
+ text_node :yearsAtEmployer, "yearsAtEmployer", :default_value=>nil
113
+ def self.from_hash(hash, name='customerInfo')
114
+ base = hash[name]
115
+ if(base)
116
+ this = CustomerInfo.new
117
+ this.ssn = base['ssn']
118
+ this.dob = base['dob']
119
+ this.customerRegistrationDate = base['customerRegistrationDate']
120
+ this.customerType = base['customerType']
121
+ this.incomeAmount = base['incomeAmount']
122
+ this.incomeCurrency = base['incomeCurrency']
123
+ this.customerCheckingAccount = base['customerCheckingAccount']
124
+ this.customerSavingAccount = base['customerSavingAccount']
125
+ this.customerWorkTelephone = base['customerWorkTelephone']
126
+ this.residenceStatus = base['residenceStatus']
127
+ this.yearsAtResidence = base['yearsAtResidence']
128
+ this.yearsAtEmployer = base['yearsAtEmployer']
129
+ this
130
+ else
131
+ nil
132
+ end
91
133
  end
134
+ end
92
135
 
93
- def XMLFields.fraud_check_type(hash_in)
94
- hash_out = {
95
- :authenticationValue=>hash_in['authenticationValue'],
96
- :authenticationTransactionId=>hash_in['authenticationTransactionId'],
97
- :customerIpAddress=>hash_in['customerIpAddress'],
98
- :authenticatedByMerchant=>hash_in['authenticatedByMerchant']
99
- }
100
- Checker.purge_null(hash_out)
101
- Checker.required_missing(hash_out)
102
- return hash_out
136
+ class BillMeLaterRequest
137
+ include XML::Mapping
138
+ text_node :bmlMerchantId, "bmlMerchantId", :default_value=>nil
139
+ text_node :termsAndConditions, "termsAndConditions", :default_value=>nil
140
+ text_node :preapprovalNumber, "preapprovalNumber", :default_value=>nil
141
+ text_node :merchantPromotionalCode, "merchantPromotionalCode", :default_value=>nil
142
+ text_node :customerPasswordChanged, "customerPasswordChanged", :default_value=>nil
143
+ text_node :customerEmailChanged, "customerEmailChanged", :default_value=>nil
144
+ text_node :customerPhoneChanged, "customerPhoneChanged", :default_value=>nil
145
+ text_node :secretQuestionCode, "secretQuestionCode", :default_value=>nil
146
+ text_node :secretQuestionAnswer, "secretQuestionAnswer", :default_value=>nil
147
+ text_node :virtualAuthenticationKeyPresenceIndicator, "virtualAuthenticationKeyPresenceIndicator", :default_value=>nil
148
+ text_node :virtualAuthenticationKeyData, "virtualAuthenticationKeyData", :default_value=>nil
149
+ text_node :itemCategoryCode, "itemCategoryCode", :default_value=>nil
150
+ text_node :authorizationSourcePlatform, "authorizationSourcePlatform", :default_value=>nil
151
+ def self.from_hash(hash, name='billMeLaterRequest')
152
+ base = hash[name]
153
+ if(base)
154
+ this = BillMeLaterRequest.new
155
+ this.bmlMerchantId = base['bmlMerchantId']
156
+ this.termsAndConditions = base['termsAndConditions']
157
+ this.merchantPromotionalCode = base['merchantPromotionalCode']
158
+ this.customerPasswordChanged = base['customerPasswordChanged']
159
+ this.customerEmailChanged = base['customerEmailChanged']
160
+ this.customerPhoneChanged = base['customerPhoneChanged']
161
+ this.secretQuestionCode = base['secretQuestionCode']
162
+ this.secretQuestionAnswer = base['secretQuestionAnswer']
163
+ this.virtualAuthenticationKeyPresenceIndicator = base['virtualAuthenticationKeyPresenceIndicator']
164
+ this.virtualAuthenticationKeyData = base['virtualAuthenticationKeyData']
165
+ this.itemCategoryCode = base['itemCategoryCode']
166
+ this.authorizationSourcePlatform = base['authorizationSourcePlatform']
167
+ this
168
+ else
169
+ nil
170
+ end
103
171
  end
172
+ end
104
173
 
105
- def XMLFields.auth_information(hash_in)
106
- hash_out = {
107
- :authDate=>(hash_in['authDate'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
108
- :authCode=>(hash_in['authCode'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
109
- :fraudResult=>fraud_result((hash_in['detailTax'] or ' ')),
110
- :authAmount=>hash_in['authAmount']
111
- }
112
- Checker.purge_null(hash_out)
113
- Checker.required_missing(hash_out)
114
- return hash_out
174
+ class FraudCheck
175
+ include XML::Mapping
176
+ text_node :authenticationValue, "authenticationValue", :default_value=>nil
177
+ text_node :authenticationTransactionId, "authenticationTransactionId", :default_value=>nil
178
+ text_node :customerIpAddress, "customerIpAddress", :default_value=>nil
179
+ text_node :authenticatedByMerchant, "authenticatedByMerchant", :default_value=>nil
180
+ def self.from_hash(hash, name='fraudCheck')
181
+ base = hash[name]
182
+ if(base)
183
+ this = FraudCheck.new
184
+ this.authenticationValue = base['authenticationValue']
185
+ this.authenticationTransactionId = base['authenticationTransactionId']
186
+ this.customerIpAddress = base['customerIpAddress']
187
+ this.authenticatedByMerchant = base['authenticatedByMerchant']
188
+ this
189
+ else
190
+ nil
191
+ end
115
192
  end
193
+ end
116
194
 
117
- def XMLFields.fraud_result(hash_in)
118
- hash_out= {
119
- :avsResult=>hash_in['avsResult'],
120
- :cardValidationResult=>hash_in['cardValidationResult'],
121
- :authenticationResult=>hash_in['authenticationResult'],
122
- :advancedAVSResult=>hash_in['advancedAVSResult']
123
- }
124
- Checker.purge_null(hash_out)
125
- Checker.required_missing(hash_out)
126
- return hash_out
195
+ class FraudResult
196
+ include XML::Mapping
197
+ text_node :avsResult, "avsResult", :default_value=>nil
198
+ text_node :cardValidationResult, "cardValidationResult", :default_value=>nil
199
+ text_node :authenticationResult, "authenticationResult", :default_value=>nil
200
+ text_node :advancedAVSResult, "advancedAVSResult", :default_value=>nil
201
+ def self.from_hash(hash, name='fraudResult')
202
+ base = hash[name]
203
+ if(base)
204
+ this = FraudResult.new
205
+ this.avsResult = base['avsResult']
206
+ this.cardValidationResult = base['cardValidationResult']
207
+ this.authenticationResult = base['authenticationResult']
208
+ this.advancedAVSResult = base['advancedAVSResult']
209
+ this
210
+ else
211
+ nil
212
+ end
127
213
  end
214
+ end
128
215
 
129
- def XMLFields.healthcare_amounts(hash_in)
130
- hash_out = {
131
- :totalHealthcareAmount=>hash_in['totalHealthcareAmount'],
132
- :RxAmount=>hash_in['RxAmount'],
133
- :visionAmount=>hash_in['visionAmount'],
134
- :clinicOtherAmount=>hash_in['clinicOtherAmount'],
135
- :dentalAmount=>hash_in['dentalAmount']
136
- }
137
- Checker.purge_null(hash_out)
138
- Checker.required_missing(hash_out)
139
- return hash_out
216
+ class AuthInformation
217
+ include XML::Mapping
218
+ text_node :authDate, "authDate", :default_value=>nil
219
+ text_node :authCode, "authCode", :default_value=>nil
220
+ object_node :fraudResult, "fraudResult", :class=>FraudResult, :default_value=>nil
221
+ text_node :authAmount, "authAmount", :default_value=>nil
222
+ def self.from_hash(hash, name='authInformation')
223
+ base = hash[name]
224
+ if(base)
225
+ this = AuthInformation.new
226
+ this.authDate = base['authDate']
227
+ this.authCode = base['authCode']
228
+ this.fraudResult = FraudResult.from_hash(base)
229
+ this.authAmount = base['authAmount']
230
+ this
231
+ else
232
+ nil
233
+ end
140
234
  end
235
+ end
141
236
 
142
- def XMLFields.healthcare_iias(hash_in)
143
- hash_out ={
144
- :healthcareAmounts=>healthcare_amounts((hash_in['healthcareAmounts'] or ' ')),
145
- :IIASFlag=>hash_in['IIASFlag']
146
- }
147
- Checker.purge_null(hash_out)
148
- Checker.required_missing(hash_out)
149
- return hash_out
237
+ class HealthcareAmounts
238
+ include XML::Mapping
239
+ text_node :totalHealthcareAmount, "totalHealthcareAmount", :default_value=>nil
240
+ text_node :rxAmount, "RxAmount", :default_value=>nil
241
+ text_node :visionAmount, "visionAmount", :default_value=>nil
242
+ text_node :clinicOtherAmount, "clinicOtherAmount", :default_value=>nil
243
+ text_node :dentalAmount, "dentalAmount", :default_value=>nil
244
+ def self.from_hash(hash, name='healthcareAmounts')
245
+ base = hash[name]
246
+ if(base)
247
+ this = HealthcareAmounts.new
248
+ this.totalHealthcareAmount = base['totalHealthcareAmount']
249
+ this.rxAmount = base['RxAmount']
250
+ this.visionAmount = base['visionAmount']
251
+ this.clinicOtherAmount = base['clinicOtherAmount']
252
+ this.dentalAmount = base['dentalAmount']
253
+ this
254
+ else
255
+ nil
256
+ end
150
257
  end
258
+ end
151
259
 
152
- def XMLFields.pos(hash_in)
153
- hash_out = {
154
- :capability=>(hash_in['capability'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
155
- :entryMode=>(hash_in['entryMode'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
156
- :cardholderId=>(hash_in['cardholderId'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag'))
157
- }
158
- Checker.purge_null(hash_out)
159
- Checker.required_missing(hash_out)
160
- return hash_out
260
+ class HealthcareIIAS
261
+ include XML::Mapping
262
+ object_node :healthcareAmounts, "healthcareAmounts", :class=>HealthcareAmounts, :default_value=>nil
263
+ text_node :iiasFlag, "IIASFlag", :default_value=>nil
264
+ def self.from_hash(hash, name='healthcareIIAS')
265
+ base = hash[name]
266
+ if(base)
267
+ this = HealthcareIIAS.new
268
+ this.healthcareAmounts = HealthcareAmounts.from_hash(base)
269
+ this.iiasFlag = base['IIASFlag']
270
+ this
271
+ else
272
+ nil
273
+ end
161
274
  end
275
+ end
162
276
 
163
- def XMLFields.detail_tax(hash_in)
164
- hash_out ={
165
- :taxIncludedInTotal=>hash_in['taxIncludedInTotal'],
166
- :taxAmount=>hash_in['taxAmount'],
167
- :taxRate=>hash_in['taxRate'],
168
- :taxTypeIdentifier=>hash_in['taxTypeIdentifier'],
169
- :cardAcceptorTaxId=>hash_in['cardAcceptorTaxId']
170
- }
171
- Checker.purge_null(hash_out)
172
- Checker.required_missing(hash_out)
173
- return hash_out
277
+ class Pos
278
+ include XML::Mapping
279
+ text_node :capability, "capability", :default_value=>nil
280
+ text_node :entryMode, "entryMode", :default_value=>nil
281
+ text_node :cardholderId, "cardholderId", :default_value=>nil
282
+ def self.from_hash(hash, name='pos')
283
+ base = hash[name]
284
+ if(base)
285
+ this = Pos.new
286
+ this.capability = base['capability']
287
+ this.entryMode = base['entryMode']
288
+ this.cardholderId = base['cardholderId']
289
+ this
290
+ else
291
+ nil
292
+ end
174
293
  end
294
+ end
175
295
 
176
- def XMLFields.line_item_data(hash_in)
177
- hash_out = {
178
- :itemSequenceNumber=>hash_in['itemSequenceNumber'],
179
- :itemDescription=>hash_in['itemDescription'],
180
- :productCode=>hash_in['productCode'],
181
- :quantity=>hash_in['quantity'],
182
- :unitOfMeasure=>hash_in['unitOfMeasure'],
183
- :taxAmount=>hash_in['taxAmount'],
184
- :lineItemTotal=>hash_in['lineItemTotal'],
185
- :lineItemTotalWithTax=>hash_in['lineItemTotalWithTax'],
186
- :itemDiscountAmount=>hash_in['itemDiscountAmount'],
187
- :commodityCode=>hash_in['commodityCode'],
188
- :unitCost=>hash_in['unitCost'],
189
- :detailTax => detail_tax((hash_in['detailTax'] or ' '))
190
- }
191
- Checker.purge_null(hash_out)
192
- Checker.required_missing(hash_out)
193
- return hash_out
296
+ class DetailTax
297
+ include XML::Mapping
298
+ text_node :taxIncludedInTotal, "taxIncludedInTotal", :default_value=>nil
299
+ text_node :taxAmount, "taxAmount", :default_value=>nil
300
+ text_node :taxRate, "taxRate", :default_value=>nil
301
+ text_node :taxTypeIdentifier, "taxTypeIdentifier", :default_value=>nil
302
+ text_node :cardAcceptorTaxId, "cardAcceptorTaxId", :default_value=>nil
303
+ def self.from_hash(hash, index=0, name='detailTax')
304
+ base = hash[name][index]
305
+ if(base)
306
+ this = DetailTax.new
307
+ this.taxIncludedInTotal = base['taxIncludedInTotal']
308
+ this.taxAmount = base['taxAmount']
309
+ this.taxRate = base['taxRate']
310
+ this.taxTypeIdentifier = base['taxTypeIdentifier']
311
+ this.cardAcceptorTaxId = base['cardAcceptorTaxId']
312
+ this
313
+ else
314
+ nil
315
+ end
194
316
  end
317
+ end
195
318
 
196
- def XMLFields.enhanced_data(hash_in)
197
- hash_out = {
198
- :customerReference=>hash_in['customerReference'],
199
- :salesTax=>hash_in['salesTax'],
200
- :deliveryType=>hash_in['deliveryType'],
201
- :taxExempt=>hash_in['taxExempt'],
202
- :discountAmount=>hash_in['discountAmount'],
203
- :shippingAmount=>hash_in['shippingAmount'],
204
- :dutyAmount=>hash_in['dutyAmount'],
205
- :shipFromPostalCode=>hash_in['shipFromPostalCode'],
206
- :destinationPostalCode=>hash_in['destinationPostalCode'],
207
- :destinationCountryCode=>hash_in['destinationCountryCode'],
208
- :invoiceReferenceNumber=>hash_in['invoiceReferenceNumber'],
209
- :orderDate=>hash_in['orderDate'],
210
- :detailTax=> detail_tax((hash_in['detailTax'] or ' ')),
211
- :lineItemData=> line_item_data((hash_in['lineItemData'] or ' '))
212
- }
213
- Checker.purge_null(hash_out)
214
- Checker.required_missing(hash_out)
215
- return hash_out
319
+ class LineItemData
320
+ include XML::Mapping
321
+ text_node :itemSequenceNumber, "itemSequenceNumber", :default_value=>nil
322
+ text_node :itemDescription, "itemDescription", :default_value=>nil
323
+ text_node :productCode, "productCode", :default_value=>nil
324
+ text_node :quantity, "quantity", :default_value=>nil
325
+ text_node :unitOfMeasure, "unitOfMeasure", :default_value=>nil
326
+ text_node :taxAmount, "taxAmount", :default_value=>nil
327
+ text_node :lineItemTotal, "lineItemTotal", :default_value=>nil
328
+ text_node :lineItemTotalWithTax, "lineItemTotalWithTax", :default_value=>nil
329
+ text_node :itemDiscountAmount, "itemDiscountAmount", :default_value=>nil
330
+ text_node :commodityCode, "commodityCode", :default_value=>nil
331
+ text_node :unitCost, "unitCost", :default_value=>nil
332
+ array_node :detailTax, "", "detailTax", :class=>DetailTax, :default_value=>[]
333
+ def self.from_hash(hash, index=0, name='lineItemData')
334
+ base = hash[name][index]
335
+ if(base)
336
+ this = LineItemData.new
337
+ this.itemSequenceNumber = base['itemSequenceNumber']
338
+ this.itemDescription = base['itemDescription']
339
+ this.productCode = base['productCode']
340
+ this.quantity = base['quantity']
341
+ this.unitOfMeasure = base['unitOfMeasure']
342
+ this.taxAmount = base['taxAmount']
343
+ this.lineItemTotal = base['lineItemTotal']
344
+ this.lineItemTotalWithTax = base['lineItemTotalWithTax']
345
+ this.itemDiscountAmount = base['itemDiscountAmount']
346
+ this.commodityCode = base['commodityCode']
347
+ this.unitCost = base['unitCost']
348
+ if(base['detailTax'])
349
+ base['detailTax'].each_index {|index| this.detailTax << DetailTax.from_hash(base,index)}
350
+ end
351
+ this
352
+ else
353
+ nil
354
+ end
216
355
  end
356
+ end
217
357
 
218
- def XMLFields.amex_aggregator_data(hash_in)
219
- hash_out ={
220
- :sellerId=>hash_in['sellerId'],
221
- :sellerMerchantCategoryCode=>hash_in['sellerMerchantCategoryCode']
222
- }
223
- Checker.purge_null(hash_out)
224
- Checker.required_missing(hash_out)
225
- return hash_out
358
+ class EnhancedData
359
+ include XML::Mapping
360
+ text_node :customerReference, "customerReference", :default_value=>nil
361
+ text_node :salesTax, "salesTax", :default_value=>nil
362
+ text_node :deliveryType, "deliveryType", :default_value=>nil
363
+ text_node :taxExempt, "taxExempt", :default_value=>nil
364
+ text_node :discountAmount, "discountAmount", :default_value=>nil
365
+ text_node :shippingAmount, "shippingAmount", :default_value=>nil
366
+ text_node :dutyAmount, "dutyAmount", :default_value=>nil
367
+ text_node :shipFromPostalCode, "shipFromPostalCode", :default_value=>nil
368
+ text_node :destinationPostalCode, "destinationPostalCode", :default_value=>nil
369
+ text_node :destinationCountryCode, "destinationCountryCode", :default_value=>nil
370
+ text_node :invoiceReferenceNumber, "invoiceReferenceNumber", :default_value=>nil
371
+ text_node :orderDate, "orderDate", :default_value=>nil
372
+ array_node :detailTax, "", "detailTax", :class=>DetailTax, :default_value=>[]
373
+ array_node :lineItemData, "", "lineItemData", :class=>LineItemData, :default_value=>[]
374
+ def self.from_hash(hash, name='enhancedData')
375
+ base = hash[name]
376
+ if(base)
377
+ this = EnhancedData.new
378
+ this.customerReference = base['customerReference']
379
+ this.salesTax = base['salesTax']
380
+ this.deliveryType = base['deliveryType']
381
+ this.taxExempt = base['taxExempt']
382
+ this.discountAmount = base['discountAmount']
383
+ this.shippingAmount = base['shippingAmount']
384
+ this.dutyAmount = base['dutyAmount']
385
+ this.shipFromPostalCode = base['shipFromPostalCode']
386
+ this.destinationPostalCode = base['destinationPostalCode']
387
+ this.destinationCountryCode = base['destinationCountryCode']
388
+ this.invoiceReferenceNumber = base['invoiceReferenceNumber']
389
+ this.orderDate = base['orderDate']
390
+ if(base['detailTax'])
391
+ base['detailTax'].each_index {|index| this.detailTax << DetailTax.from_hash(base,index)}
392
+ end
393
+ if(base['lineItemData'])
394
+ base['lineItemData'].each_index {|index| this.lineItemData << LineItemData.from_hash(base,index)}
395
+ end
396
+ this
397
+ else
398
+ nil
399
+ end
226
400
  end
401
+ end
227
402
 
228
- def XMLFields.card_type(hash_in)
229
- hash_out= {
230
- :type=>hash_in['type'] ,
231
- :track=>hash_in['track'],
232
- :number=>hash_in['number'],
233
- :expDate=>hash_in['expDate'],
234
- :cardValidationNum=>hash_in['cardValidationNum']
235
- }
236
- Checker.purge_null(hash_out)
237
- choice_hash={'1'=>hash_out[:type],'2'=>hash_out[:track]}
238
- Checker.choice(choice_hash)
239
- return hash_out
403
+ class AmexAggregatorData
404
+ include XML::Mapping
405
+ text_node :sellerId, "sellerId", :default_value=>nil
406
+ text_node :sellerMerchantCategoryCode, "sellerMerchantCategoryCode", :default_value=>nil
407
+ def self.from_hash(hash, name='amexAggregatorData')
408
+ base = hash[name]
409
+ if(base)
410
+ this = AmexAggregatorData.new
411
+ this.sellerId = base['sellerId']
412
+ this.sellerMerchantCategoryCode = base['sellerMerchantCategoryCode']
413
+ this
414
+ else
415
+ nil
416
+ end
240
417
  end
418
+ end
241
419
 
242
- def XMLFields.card_token_type(hash_in)
243
- hash_out = {
244
- :litleToken=>(hash_in['litleToken'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
245
- :expDate=>hash_in['expDate'],
246
- :cardValidationNum=>hash_in['cardValidationNumber'],
247
- :type=>hash_in['type']
248
- }
249
- Checker.purge_null(hash_out)
250
- Checker.required_missing(hash_out)
251
- return hash_out
420
+ class Card
421
+ include XML::Mapping
422
+ text_node :mop, "type", :default_value=>nil
423
+ text_node :track, "track", :default_value=>nil
424
+ text_node :number, "number", :default_value=>nil
425
+ text_node :expDate, "expDate", :default_value=>nil
426
+ text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
427
+
428
+ def self.from_hash(hash, name='card')
429
+ base = hash[name]
430
+ if(base)
431
+ this = Card.new
432
+ this.mop = base['type']
433
+ this.track = base['track']
434
+ this.number = base['number']
435
+ this.expDate = base['expDate']
436
+ this.cardValidationNum = base['cardValidationNum']
437
+ this
438
+ else
439
+ nil
440
+ end
252
441
  end
442
+ end
253
443
 
254
- def XMLFields.card_paypage_type(hash_in)
255
- hash_out = {
256
- :paypageRegistrationId=>(hash_in['paypageRegistrationId'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
257
- :expDate=>hash_in['expDate'] ,
258
- :cardValidationNum=>hash_in['cardValidationNumber'],
259
- :type=>hash_in['type']
260
- }
261
- Checker.purge_null(hash_out)
262
- Checker.required_missing(hash_out)
263
- return hash_out
444
+ class CardToken
445
+ include XML::Mapping
446
+ text_node :litleToken, "litleToken", :default_value=>nil
447
+ text_node :expDate, "expDate", :default_value=>nil
448
+ text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
449
+ text_node :mop, "type", :default_value=>nil
450
+ def self.from_hash(hash, name='cardToken')
451
+ base = hash[name]
452
+ if(base)
453
+ this = CardToken.new
454
+ this.litleToken = base['litleToken']
455
+ this.expDate = base['expDate']
456
+ this.cardValidationNum = base['cardValidationNum']
457
+ this.mop = base['type']
458
+ this
459
+ else
460
+ nil
461
+ end
264
462
  end
463
+ end
265
464
 
266
- def XMLFields.pay_pal(hash_in)
267
- hash_out = {
268
- :payerId=>(hash_in['payerId'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
269
- :token=>hash_in['token'],
270
- :transactionId=>(hash_in['transactionId'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag'))
271
- }
272
- Checker.purge_null(hash_out)
273
- Checker.required_missing(hash_out)
274
- return hash_out
465
+ class CardPaypage
466
+ include XML::Mapping
467
+ text_node :paypageRegistrationId, "paypageRegistrationId", :default_value=>nil
468
+ text_node :expDate, "expDate", :default_value=>nil
469
+ text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
470
+ text_node :mop, "type", :default_value=>nil
471
+ def self.from_hash(hash, name='cardPaypage')
472
+ base = hash[name]
473
+ if(base)
474
+ this = CardPaypage.new
475
+ this.paypageRegistrationId = base['paypageRegistrationId']
476
+ this.expDate = base['expDate']
477
+ this.cardValidationNum = base['cardValidationNum']
478
+ this.mop = base['type']
479
+ this
480
+ else
481
+ nil
482
+ end
275
483
  end
484
+ end
276
485
 
277
- def XMLFields.credit_pay_pal(hash_in)
278
- hash_out = {
279
- :payerId=>(hash_in['payerId'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
280
- :payerEmail => (hash_in['payerEmail'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
281
- }
282
- Checker.purge_null(hash_out)
283
- choice_hash={'1'=>hash_out[:payerId],'2'=>hash_out[:payerEmail]}
284
- Checker.choice(choice_hash)
285
- Checker.required_missing(hash_out)
286
- return hash_out
486
+ class PayPal
487
+ include XML::Mapping
488
+ text_node :payerId, "payerId", :default_value=>nil
489
+ text_node :token, "token", :default_value=>nil
490
+ text_node :transactionId, "transactionId", :default_value=>nil
491
+ def self.from_hash(hash, name='payPal')
492
+ base = hash[name]
493
+ if(base)
494
+ this = PayPal.new
495
+ this.payerId = base['payerId']
496
+ this.token = base['token']
497
+ this.transactionId = base['transactionId']
498
+ this
499
+ else
500
+ nil
501
+ end
287
502
  end
503
+ end
288
504
 
289
- def XMLFields.custom_billing(hash_in)
290
- hash_out = {
291
- :phone=>hash_in['phone'],
292
- :city=>hash_in['city'],
293
- :url=>hash_in['url']
294
- }
295
- Checker.purge_null(hash_out)
296
- Checker.choice(hash_out)
297
- hash_out[:descriptor] = hash_in['descriptor']
298
- Checker.purge_null(hash_out)
299
- Checker.required_missing(hash_out)
300
- return hash_out
505
+ class CreditPayPal
506
+ include XML::Mapping
507
+ text_node :payerId, "payerId", :default_value=>nil
508
+ text_node :payerEmail, "payerEmail", :default_value=>nil
509
+ def self.from_hash(hash, name='creditPaypal')
510
+ base = hash[name]
511
+ if(base)
512
+ this = CreditPayPal.new
513
+ this.payerId = base['payerId']
514
+ this.payerEmail = base['payerEmail']
515
+ this
516
+ else
517
+ nil
518
+ end
519
+ end
520
+ end
301
521
 
522
+ class CustomBilling
523
+ include XML::Mapping
524
+ optional_choice_node :if, 'phone', :then, (text_node :phone, "phone", :default_value=>nil),
525
+ :elsif, 'city', :then, (text_node :city, "city", :default_vaule=>nil),
526
+ :elsif, 'url', :then, (text_node :url, "url", :default_vaule=>nil)
527
+ text_node :descriptor, "descriptor", :default_value=>nil
528
+ def self.from_hash(hash, name='customBilling')
529
+ base = hash[name]
530
+ if(base)
531
+ this = CustomBilling.new
532
+ this.phone = base['phone']
533
+ this.city = base['city']
534
+ this.url = base['url']
535
+ this.descriptor = base['descriptor']
536
+ this
537
+ else
538
+ nil
539
+ end
302
540
  end
541
+ end
303
542
 
304
- def XMLFields.tax_billing(hash_in)
305
- hash_out = {
306
- :taxAuthority=>(hash_in['taxAuthority'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
307
- :state=>(hash_in['state'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
308
- :govtTxnType=>(hash_in['govtTxnType'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag'))
309
- }
310
- Checker.purge_null(hash_out)
311
- Checker.required_missing(hash_out)
312
- return hash_out
543
+ class TaxBilling
544
+ include XML::Mapping
545
+ text_node :taxAuthority, "taxAuthority", :default_value=>nil
546
+ text_node :state, "state", :default_value=>nil
547
+ text_node :govtTxnType, "govtTxnType", :default_value=>nil
548
+ def self.from_hash(hash, name='taxBilling')
549
+ base = hash[name]
550
+ if(base)
551
+ this = TaxBilling.new
552
+ this.taxAuthority = base['taxAuthority']
553
+ this.state = base['state']
554
+ this.govtTxnType = base['govtTxnType']
555
+ this
556
+ else
557
+ nil
558
+ end
313
559
  end
560
+ end
314
561
 
315
- def XMLFields.processing_instructions(hash_in)
316
- hash_out ={
317
- :bypassVelocityCheck=>hash_in['bypassVelocityCheck']
318
- }
319
- Checker.purge_null(hash_out)
320
- Checker.required_missing(hash_out)
321
- return hash_out
562
+ class ProcessingInstructions
563
+ include XML::Mapping
564
+ text_node :bypassVelocityCheck, "bypassVelocityCheck", :default_value=>nil
565
+ def self.from_hash(hash, name='processingInstructions')
566
+ base = hash[name]
567
+ if(base)
568
+ this = ProcessingInstructions.new
569
+ this.bypassVelocityCheck = base['bypassVelocityCheck']
570
+ this
571
+ else
572
+ nil
573
+ end
322
574
  end
575
+ end
323
576
 
324
- def XMLFields.echeck_for_token_type(hash_in)
325
- hash_out = {
326
- :accNum=>(hash_in['accNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
327
- :routingNum=>(hash_in['routingNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag'))
328
- }
329
- Checker.purge_null(hash_out)
330
- Checker.required_missing(hash_out)
331
- return hash_out
577
+ class EcheckForToken
578
+ include XML::Mapping
579
+ text_node :accNum, "accNum", :default_value=>nil
580
+ text_node :routingNum, "routingNum", :default_value=>nil
581
+ def self.from_hash(hash, name='echeckForToken')
582
+ base = hash[name]
583
+ if(base)
584
+ this = EcheckForToken.new
585
+ this.accNum = base['accNum']
586
+ this.routingNum = base['routingNum']
587
+ this
588
+ else
589
+ nil
590
+ end
332
591
  end
592
+ end
333
593
 
334
- def XMLFields.filtering_type(hash_in)
335
- hash_out = {
336
- :prepaid=>hash_in['prepaid'],
337
- :international=>hash_in['international'],
338
- :chargeback=>hash_in['chargeback']
339
- }
340
- Checker.purge_null(hash_out)
341
- Checker.required_missing(hash_out)
342
- return hash_out
594
+ class Filtering
595
+ include XML::Mapping
596
+ text_node :prepaid, "prepaid", :default_value=>nil
597
+ text_node :international, "international", :default_value=>nil
598
+ text_node :chargeback, "chargeback", :default_value=>nil
599
+ def self.from_hash(hash, name='filtering')
600
+ base = hash[name]
601
+ if(base)
602
+ this = Filtering.new
603
+ this.prepaid = base['prepaid']
604
+ this.international = base['international']
605
+ this.chargeback = base['chargeback']
606
+ this
607
+ else
608
+ nil
609
+ end
343
610
  end
344
-
345
- def XMLFields.merchant_data(hash_in)
346
- hash_out = {
347
- :campaign=>hash_in['campaign'],
348
- :affiliate=>hash_in['affiliate'],
349
- :merchnatGroupingId=>hash_in['merchantGroupingIdType']
350
- }
351
- Checker.purge_null(hash_out)
352
- Checker.required_missing(hash_out)
353
- return hash_out
611
+ end
612
+
613
+ class MerchantData
614
+ include XML::Mapping
615
+ text_node :campaign, "campaign", :default_value=>nil
616
+ text_node :affiliate, "affiliate", :default_value=>nil
617
+ text_node :merchantGroupingId, "merchantGroupingId", :default_value=>nil
618
+ def self.from_hash(hash, name='merchantData')
619
+ base = hash[name]
620
+ if(base)
621
+ this = MerchantData.new
622
+ this.campaign = base['campaign']
623
+ this.affiliate = base['affiliate']
624
+ this.merchantGroupingId = base['merchantGroupingId']
625
+ this
626
+ else
627
+ nil
628
+ end
354
629
  end
630
+ end
355
631
 
356
- def XMLFields.echeck_type(hash_in)
357
- hash_out= {
358
- :accType=>(hash_in['accType'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
359
- :accNum=>(hash_in['accNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
360
- :routingNum=>(hash_in['routingNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
361
- :checkNum=>hash_in['checkNumberType']
362
- }
363
- Checker.purge_null(hash_out)
364
- Checker.required_missing(hash_out)
365
- return hash_out
632
+ class Echeck
633
+ include XML::Mapping
634
+ text_node :accType, "accType", :default_value=>nil
635
+ text_node :accNum, "accNum", :default_value=>nil
636
+ text_node :routingNum, "routingNum", :default_value=>nil
637
+ text_node :checkNum, "checkNum", :default_value=>nil
638
+ def self.from_hash(hash, name='echeck')
639
+ base = hash[name]
640
+ if(base)
641
+ this = Echeck.new
642
+ this.accType = base['accType']
643
+ this.accNum = base['accNum']
644
+ this.routingNum = base['routingNum']
645
+ this.checkNum = base['checkNum']
646
+ this
647
+ else
648
+ nil
649
+ end
366
650
  end
651
+ end
367
652
 
368
- def XMLFields.echeck_token_type(hash_in)
369
- hash_out= {
370
- :litleToken=>(hash_in['litleToken'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
371
- :routingNum=>(hash_in['routingNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
372
- :accType=>(hash_in['accType'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
373
- :checkNum=>hash_in['checkNum']
374
- }
375
- Checker.purge_null(hash_out)
376
- Checker.required_missing(hash_out)
377
- return hash_out
653
+ class EcheckToken
654
+ include XML::Mapping
655
+ text_node :litleToken, "litleToken", :default_value=>nil
656
+ text_node :routingNum, "routingNum", :default_value=>nil
657
+ text_node :accType, "accType", :default_value=>nil
658
+ text_node :checkNum, "checkNum", :default_value=>nil
659
+ def self.from_hash(hash, name='echeckToken')
660
+ base = hash[name]
661
+ if(base)
662
+ this = EcheckToken.new
663
+ this.litleToken = base['litleToken']
664
+ this.routingNum = base['routingNum']
665
+ this.accType = base['accType']
666
+ this.checkNum = base['checkNum']
667
+ this
668
+ else
669
+ nil
670
+ end
378
671
  end
672
+ end
379
673
 
380
- def XMLFields.recycling_request_type(hash_in)
381
- hash_out= {
382
- :recyleBy=>(hash_in['recyleBy'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
383
- }
384
- Checker.purge_null(hash_out)
385
- Checker.required_missing(hash_out)
386
- return hash_out
674
+ class RecyclingRequest
675
+ include XML::Mapping
676
+ text_node :recyleBy, "recyleBy", :default_value=>nil
677
+ def self.from_hash(hash, name='recyclingRequest')
678
+ base = hash[name]
679
+ if(base)
680
+ this = RecyclingRequest.new
681
+ this.recyleBy = base['recyleBy']
682
+ this
683
+ else
684
+ nil
685
+ end
387
686
  end
388
687
  end
389
688
 
689
+ class Authorization
690
+ include XML::Mapping
691
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
692
+ text_node :transactionId, "@id", :default_value=>nil
693
+ text_node :customerId, "@customerId", :default_value=>nil
694
+
695
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
696
+ text_node :orderId, "orderId", :default_value=>nil
697
+ text_node :amount, "amount", :default_value=>nil
698
+ text_node :orderSource, "orderSource", :default_value=>nil
699
+ object_node :customerInfo, "customerInfo", :class=>CustomerInfo, :default_value=>nil
700
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
701
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
702
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
703
+ :elsif, 'paypal', :then, (object_node :paypal, "paypal", :class=>PayPal),
704
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
705
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage)
706
+ object_node :billMeLaterRequest, "billMeLaterRequest", :class=>BillMeLaterRequest, :default_value=>nil
707
+ object_node :cardholderAuthentication, "cardholderAuthentication", :class=>FraudCheck, :default_value=>nil
708
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
709
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
710
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
711
+ text_node :taxType, "taxType", :default_value=>nil
712
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
713
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
714
+ text_node :allowPartialAuth, "allowPartialAuth", :default_value=>nil
715
+ object_node :healthcareIIAS, "healthcareIIAS", :class=>HealthcareIIAS, :default_value=>nil
716
+ object_node :filtering, "filtering", :class=>Filtering, :default_value=>nil
717
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
718
+ object_node :recyclingRequest, "recyclingRequest", :class=>RecyclingRequest, :default_value=>nil
719
+ end
720
+
721
+ class Sale
722
+ include XML::Mapping
723
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
724
+ text_node :transactionId, "@id", :default_value=>nil
725
+ text_node :customerId, "@customerId", :default_value=>nil
726
+
727
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
728
+ text_node :orderId, "orderId", :default_value=>nil
729
+ text_node :amount, "amount", :default_value=>nil
730
+ text_node :orderSource, "orderSource", :default_value=>nil
731
+ object_node :customerInfo, "customerInfo", :class=>CustomerInfo, :default_value=>nil
732
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
733
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
734
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
735
+ :elsif, 'paypal', :then, (object_node :paypal, "paypal", :class=>PayPal),
736
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
737
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage)
738
+ object_node :billMeLaterRequest, "billMeLaterRequest", :class=>BillMeLaterRequest, :default_value=>nil
739
+ optional_choice_node :if, 'fraudCheck', :then, (object_node :fraudCheck, "fraudCheck", :class=>FraudCheck, :default_value=>nil),
740
+ :elsif, 'cardholderAuthentication', :then, (object_node :cardholderAuthentication, "cardholderAuthentication", :class=>FraudCheck, :default_value=>nil)
741
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
742
+ text_node :taxType, "taxType", :default_value=>nil
743
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
744
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
745
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
746
+ text_node :payPalOrderComplete, "payPalOrderComplete", :default_value=>nil
747
+ text_node :payPalNotes, "payPalNotes", :default_value=>nil
748
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
749
+ text_node :allowPartialAuth, "allowPartialAuth", :default_value=>nil
750
+ object_node :healthcareIIAS, "healthcareIIAS", :class=>HealthcareIIAS, :default_value=>nil
751
+ object_node :filtering, "filtering", :class=>Filtering, :default_value=>nil
752
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
753
+ object_node :recyclingRequest, "recyclingRequest", :class=>RecyclingRequest, :default_value=>nil
754
+ end
755
+
756
+ class Credit
757
+ include XML::Mapping
758
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
759
+ text_node :transactionId, "@id", :default_value=>nil
760
+ text_node :customerId, "@customerId", :default_value=>nil
761
+
762
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
763
+ text_node :orderId, "orderId", :default_value=>nil
764
+ text_node :amount, "amount", :default_value=>nil
765
+ text_node :orderSource, "orderSource", :default_value=>nil
766
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
767
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
768
+ :elsif, 'paypal', :then, (object_node :paypal, "paypal", :class=>CreditPayPal),
769
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
770
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage)
771
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
772
+ text_node :taxType, "taxType", :default_value=>nil
773
+ object_node :billMeLaterRequest, "billMeLaterRequest", :class=>BillMeLaterRequest, :default_value=>nil
774
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
775
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
776
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
777
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
778
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
779
+ text_node :payPalNotes, "payPalNotes", :default_value=>nil
780
+ text_node :actionReason, "actionReason", :default_value=>nil
781
+ end
782
+
783
+ class RegisterTokenRequest
784
+ include XML::Mapping
785
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
786
+ text_node :transactionId, "@id", :default_value=>nil
787
+ text_node :customerId, "@customerId", :default_value=>nil
788
+
789
+ text_node :orderId, "orderId", :default_value=>nil
790
+ optional_choice_node :if, 'accountNumber', :then, (text_node :accountNumber, "accountNumber", :default_value=>nil),
791
+ :elsif, 'echeckForToken', :then, (object_node :echeckForToken, "echeckForToken", :class=>EcheckForToken),
792
+ :elsif, 'paypageRegistrationId', :then, (text_node :paypageRegistrationId, "paypageRegistrationId", :default_value=>nil)
793
+ end
794
+
795
+ class CaptureGivenAuth
796
+ include XML::Mapping
797
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
798
+ text_node :transactionId, "@id", :default_value=>nil
799
+ text_node :customerId, "@customerId", :default_value=>nil
800
+
801
+ text_node :orderId, "orderId", :default_value=>nil
802
+ object_node :authInformation, "authInformation", :class=>AuthInformation, :default_value=>nil
803
+ text_node :amount, "amount", :default_value=>nil
804
+ text_node :orderSource, "orderSource", :default_value=>nil
805
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
806
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
807
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
808
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
809
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage)
810
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
811
+ text_node :taxType, "taxType", :default_value=>nil
812
+ object_node :billMeLaterRequest, "billMeLaterRequest", :class=>BillMeLaterRequest, :default_value=>nil
813
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
814
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
815
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
816
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
817
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
818
+ end
819
+
820
+ class ForceCapture
821
+ include XML::Mapping
822
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
823
+ text_node :transactionId, "@id", :default_value=>nil
824
+ text_node :customerId, "@customerId", :default_value=>nil
825
+
826
+ text_node :orderId, "orderId", :default_value=>nil
827
+ text_node :amount, "amount", :default_value=>nil
828
+ text_node :orderSource, "orderSource", :default_value=>nil
829
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
830
+ optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
831
+ :elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
832
+ :elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage)
833
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
834
+ text_node :taxType, "taxType", :default_value=>nil
835
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
836
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
837
+ object_node :pos, "pos", :class=>Pos, :default_value=>nil
838
+ object_node :amexAggregatorData, "amexAggregatorData", :class=>AmexAggregatorData, :default_value=>nil
839
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
840
+ end
841
+
842
+ class AuthReversal
843
+ include XML::Mapping
844
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
845
+ text_node :transactionId, "@id", :default_value=>nil
846
+ text_node :customerId, "@customerId", :default_value=>nil
847
+ text_node :partial, "@partial", :default_value=>nil
848
+
849
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
850
+ text_node :amount, "amount", :default_value=>nil
851
+ text_node :payPalNotes, "payPalNotes", :default_value=>nil
852
+ text_node :actionReason, "actionReason", :default_value=>nil
853
+ end
854
+
855
+ class Capture
856
+ include XML::Mapping
857
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
858
+ text_node :transactionId, "@id", :default_value=>nil
859
+ text_node :customerId, "@customerId", :default_value=>nil
860
+ text_node :partial, "@partial", :default_value=>nil
861
+
862
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
863
+ text_node :amount, "amount", :default_value=>nil
864
+ object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
865
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
866
+ text_node :payPalOrderComplete, "payPalOrderComplete", :default_value=>nil
867
+ text_node :payPalNotes, "payPalNotes", :default_value=>nil
868
+ end
869
+
870
+ class Void
871
+ include XML::Mapping
872
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
873
+ text_node :transactionId, "@id", :default_value=>nil
874
+ text_node :customerId, "@customerId", :default_value=>nil
875
+
876
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
877
+ object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
878
+ end
879
+
880
+ class EcheckVoid
881
+ include XML::Mapping
882
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
883
+ text_node :transactionId, "@id", :default_value=>nil
884
+ text_node :customerId, "@customerId", :default_value=>nil
885
+
886
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
887
+ end
888
+
889
+ class EcheckVerification
890
+ include XML::Mapping
891
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
892
+ text_node :transactionId, "@id", :default_value=>nil
893
+ text_node :customerId, "@customerId", :default_value=>nil
894
+
895
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
896
+ text_node :orderId, "orderId", :default_value=>nil
897
+ text_node :amount, "amount", :default_value=>nil
898
+ text_node :orderSource, "orderSource", :default_value=>nil
899
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
900
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
901
+ optional_choice_node :if, 'echeck', :then, (object_node :echeck, "echeck", :class=>Echeck),
902
+ :elsif, 'echeckToken', :then, (object_node :echeckToken, "echeckToken", :class=>EcheckToken)
903
+ end
904
+
905
+ class EcheckCredit
906
+ include XML::Mapping
907
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
908
+ text_node :transactionId, "@id", :default_value=>nil
909
+ text_node :customerId, "@customerId", :default_value=>nil
910
+
911
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
912
+ text_node :orderId, "orderId", :default_value=>nil
913
+ text_node :amount, "amount", :default_value=>nil
914
+ text_node :orderSource, "orderSource", :default_value=>nil
915
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
916
+ optional_choice_node :if, 'echeck', :then, (object_node :echeck, "echeck", :class=>Echeck, :default_value=>nil),
917
+ :elsif, 'echeckToken', :then, (object_node :echeckToken, "echeckToken", :class=>EcheckToken, :default_value=>nil)
918
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
919
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
920
+ end
921
+
922
+ class EcheckRedeposit
923
+ include XML::Mapping
924
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
925
+ text_node :transactionId, "@id", :default_value=>nil
926
+ text_node :customerId, "@customerId", :default_value=>nil
927
+
928
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
929
+ optional_choice_node :if, 'echeck', :then, (object_node :echeck, "echeck", :class=>Echeck, :default_value=>nil),
930
+ :elsif, 'echeckToken', :then, (object_node :echeckToken, "echeckToken", :class=>EcheckToken, :default_value=>nil)
931
+ end
932
+
933
+ class EcheckSale
934
+ include XML::Mapping
935
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
936
+ text_node :transactionId, "@id", :default_value=>nil
937
+ text_node :customerId, "@customerId", :default_value=>nil
938
+
939
+ text_node :litleTxnId, "litleTxnId", :default_value=>nil
940
+ text_node :orderId, "orderId", :default_value=>nil
941
+ text_node :verify, "verify", :default_value=>nil
942
+ text_node :amount, "amount", :default_value=>nil
943
+ text_node :orderSource, "orderSource", :default_value=>nil
944
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
945
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
946
+ optional_choice_node :if, 'echeck', :then, (object_node :echeck, "echeck", :class=>Echeck, :default_value=>nil),
947
+ :elsif, 'echeckToken', :then, (object_node :echeckToken, "echeckToken", :class=>EcheckToken, :default_value=>nil)
948
+ object_node :customBilling, "customBilling", :class=>CustomBilling, :default_value=>nil
949
+ object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
950
+ end
951
+
952
+ class OnlineRequest
953
+ include XML::Mapping
954
+ root_element_name "litleOnlineRequest"
955
+ text_node :merchantId, "@merchantId", :default_value=>nil
956
+ text_node :version, "@version", :default_value=>nil
957
+ text_node :xmlns, "@xmlns", :default_value=>nil
958
+ text_node :merchantSdk, "@merchantSdk", :default_vaule=>nil
959
+ object_node :authentication, "authentication", :class=>Authentication
960
+ optional_choice_node :if, 'authorization', :then, (object_node :authorization, "authorization", :class=>Authorization),
961
+ :elsif, 'sale', :then, (object_node :sale, "sale", :class=>Sale),
962
+ :elsif, 'captureGivenAuth', :then, (object_node :captureGivenAuth, "captureGivenAuth", :class=>CaptureGivenAuth),
963
+ :elsif, 'capture', :then, (object_node :capture, "capture", :class=>Capture),
964
+ :elsif, 'void', :then, (object_node :void, "void", :class=>Void),
965
+ :elsif, 'forceCapture', :then, (object_node :forceCapture, "forceCapture", :class=>Capture),
966
+ :elsif, 'credit', :then, (object_node :credit, "credit", :class=>Credit),
967
+ :elsif, 'authReversal', :then, (object_node :authReversal, "authReversal", :class=>AuthReversal),
968
+ :elsif, 'echeckCredit', :then, (object_node :echeckCredit, "echeckCredit", :class=>EcheckCredit),
969
+ :elsif, 'echeckRedeposit', :then, (object_node :echeckRedeposit, "echeckRedeposit", :class=>EcheckRedeposit),
970
+ :elsif, 'echeckSale', :then, (object_node :echeckSale, "echeckSale", :class=>EcheckSale),
971
+ :elsif, 'echeckVoid', :then, (object_node :echeckVoid, "echeckVoid", :class=>EcheckVoid),
972
+ :elsif, 'echeckVerification', :then, (object_node :echeckVerification, "echeckVerification", :class=>EcheckVerification),
973
+ :elsif, 'registerTokenRequest', :then, (object_node :registerTokenRequest, "registerTokenRequest", :class=>RegisterTokenRequest)
974
+ end
975
+
976
+ class LitleOnlineResponse
977
+ attr_accessor :message
978
+ end
979
+
980
+ class XMLFields
981
+
982
+ end