LitleOnline 8.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/DESCRIPTION +5 -0
- data/LICENSE +22 -0
- data/README.md +69 -0
- data/Rakefile +92 -0
- data/SETUP.md +47 -0
- data/bin/Setup.rb +103 -0
- data/bin/sample_driver.rb +49 -0
- data/index.html +176 -0
- data/index.html.1 +176 -0
- data/lib/Checker.rb +56 -0
- data/lib/Communications.rb +85 -0
- data/lib/Configuration.rb +45 -0
- data/lib/LitleOnline.rb +52 -0
- data/lib/LitleOnlineRequest.rb +399 -0
- data/lib/LitleXmlMapper.rb +48 -0
- data/lib/Obj2xml.rb +37 -0
- data/lib/XMLFields.rb +378 -0
- data/test/certification/certTest1_base.rb +948 -0
- data/test/certification/certTest2_authenhanced.rb +571 -0
- data/test/certification/certTest3_authreversal.rb +184 -0
- data/test/certification/certTest4_echeck.rb +279 -0
- data/test/certification/certTest5_token.rb +222 -0
- data/test/certification/ts_all.rb +31 -0
- data/test/functional/test_auth.rb +135 -0
- data/test/functional/test_authReversal.rb +68 -0
- data/test/functional/test_capture.rb +71 -0
- data/test/functional/test_captureGivenAuth.rb +161 -0
- data/test/functional/test_credit.rb +154 -0
- data/test/functional/test_echeckCredit.rb +116 -0
- data/test/functional/test_echeckRedeposit.rb +78 -0
- data/test/functional/test_echeckSale.rb +157 -0
- data/test/functional/test_echeckVerification.rb +92 -0
- data/test/functional/test_forceCapture.rb +105 -0
- data/test/functional/test_sale.rb +198 -0
- data/test/functional/test_token.rb +102 -0
- data/test/functional/test_xmlfields.rb +403 -0
- data/test/functional/ts_all.rb +39 -0
- data/test/unit/test_Checker.rb +58 -0
- data/test/unit/test_LitleOnlineRequest.rb +288 -0
- data/test/unit/test_auth.rb +168 -0
- data/test/unit/test_authReversal.rb +41 -0
- data/test/unit/test_capture.rb +40 -0
- data/test/unit/test_captureGivenAuth.rb +108 -0
- data/test/unit/test_credit.rb +117 -0
- data/test/unit/test_echeckCredit.rb +45 -0
- data/test/unit/test_echeckRedeposit.rb +76 -0
- data/test/unit/test_echeckSale.rb +45 -0
- data/test/unit/test_echeckVerification.rb +75 -0
- data/test/unit/test_forceCapture.rb +122 -0
- data/test/unit/test_sale.rb +249 -0
- data/test/unit/test_token.rb +70 -0
- data/test/unit/test_xmlfields.rb +173 -0
- data/test/unit/ts_unit.rb +41 -0
- metadata +166 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2011 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
|
26
|
+
#
|
27
|
+
# Handles round trip of transactions
|
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
|
+
#
|
30
|
+
class LitleXmlMapper
|
31
|
+
def LitleXmlMapper.request(hash,config_hash)
|
32
|
+
|
33
|
+
# create a Litle XML request from the nested hashes
|
34
|
+
request_xml = Obj2xml.to_XML(hash)
|
35
|
+
if(config_hash['printxml'])
|
36
|
+
puts request_xml
|
37
|
+
end
|
38
|
+
# get the Litle Online Response from the API server over HTTP
|
39
|
+
response_xml = Communications.http_post(request_xml,config_hash)
|
40
|
+
if(config_hash['printxml'])
|
41
|
+
puts response_xml
|
42
|
+
end
|
43
|
+
# create response object from xml returned form the Litle API
|
44
|
+
response_object = XMLObject.new(response_xml)
|
45
|
+
|
46
|
+
return response_object
|
47
|
+
end
|
48
|
+
end
|
data/lib/Obj2xml.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2011 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
|
26
|
+
#
|
27
|
+
# Used for formulation of Litle XML
|
28
|
+
# Creates an XML document from a set of input hashes
|
29
|
+
#
|
30
|
+
class Obj2xml
|
31
|
+
def Obj2xml.to_XML(hash)
|
32
|
+
request_xml = REXML::Document.new XmlSimple.xml_out(hash, 'Rootname'=>'litleOnlineRequest', 'AttrPrefix' => true)
|
33
|
+
doc ="<?xml version=\"1.0\" ?>\n"# insure proper heading for XMl doc
|
34
|
+
request_xml.write(doc)
|
35
|
+
return doc
|
36
|
+
end
|
37
|
+
end
|
data/lib/XMLFields.rb
ADDED
@@ -0,0 +1,378 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2011 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
|
26
|
+
#
|
27
|
+
# Contains all of the underlying XML fields and specifications needed to create the transaction set
|
28
|
+
#
|
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
|
50
|
+
end
|
51
|
+
|
52
|
+
def XMLFields.customerInfo(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
|
70
|
+
end
|
71
|
+
|
72
|
+
def XMLFields.billMeLaterRequest(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
|
91
|
+
end
|
92
|
+
|
93
|
+
def XMLFields.fraudCheckType(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
|
103
|
+
end
|
104
|
+
|
105
|
+
def XMLFields.authInformation(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=>fraudResult((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
|
115
|
+
end
|
116
|
+
|
117
|
+
def XMLFields.fraudResult(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
|
127
|
+
end
|
128
|
+
|
129
|
+
def XMLFields.healthcareAmounts(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
|
140
|
+
end
|
141
|
+
|
142
|
+
def XMLFields.healthcareIIAS(hash_in)
|
143
|
+
hash_out ={
|
144
|
+
:healthcareAmounts=>healthcareAmounts((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
|
150
|
+
end
|
151
|
+
|
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
|
161
|
+
end
|
162
|
+
|
163
|
+
def XMLFields.detailTax(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
|
174
|
+
end
|
175
|
+
|
176
|
+
def XMLFields.lineItemData(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 => detailTax((hash_in['detailTax'] or ' '))
|
190
|
+
}
|
191
|
+
Checker.purge_null(hash_out)
|
192
|
+
Checker.required_missing(hash_out)
|
193
|
+
return hash_out
|
194
|
+
end
|
195
|
+
|
196
|
+
def XMLFields.enhancedData(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=> detailTax((hash_in['detailTax'] or ' ')),
|
211
|
+
:lineItemData=> lineItemData((hash_in['lineItemData'] or ' '))
|
212
|
+
}
|
213
|
+
Checker.purge_null(hash_out)
|
214
|
+
Checker.required_missing(hash_out)
|
215
|
+
return hash_out
|
216
|
+
end
|
217
|
+
|
218
|
+
def XMLFields.amexAggregatorData(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
|
226
|
+
end
|
227
|
+
|
228
|
+
def XMLFields.cardType(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
|
240
|
+
end
|
241
|
+
|
242
|
+
def XMLFields.cardTokenType(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
|
252
|
+
end
|
253
|
+
|
254
|
+
def XMLFields.cardPaypageType(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
|
264
|
+
end
|
265
|
+
|
266
|
+
def XMLFields.payPal(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
|
275
|
+
end
|
276
|
+
|
277
|
+
def XMLFields.credit_payPal(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
|
287
|
+
end
|
288
|
+
|
289
|
+
def XMLFields.customBilling(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
|
301
|
+
|
302
|
+
end
|
303
|
+
|
304
|
+
def XMLFields.taxBilling(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
|
313
|
+
end
|
314
|
+
|
315
|
+
def XMLFields.processingInstructions(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
|
322
|
+
end
|
323
|
+
|
324
|
+
def XMLFields.echeckForTokenType(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
|
332
|
+
end
|
333
|
+
|
334
|
+
def XMLFields.filteringType(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
|
343
|
+
end
|
344
|
+
|
345
|
+
def XMLFields.echeckType(hash_in)
|
346
|
+
hash_out= {
|
347
|
+
:accType=>(hash_in['accType'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
348
|
+
:accNum=>(hash_in['accNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
349
|
+
:routingNum=>(hash_in['routingNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
350
|
+
:checkNum=>hash_in['checkNumberType']
|
351
|
+
}
|
352
|
+
Checker.purge_null(hash_out)
|
353
|
+
Checker.required_missing(hash_out)
|
354
|
+
return hash_out
|
355
|
+
end
|
356
|
+
|
357
|
+
def XMLFields.echeckTokenType(hash_in)
|
358
|
+
hash_out= {
|
359
|
+
:litleToken=>(hash_in['litleToken'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
360
|
+
:routingNum=>(hash_in['routingNum'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
361
|
+
:accType=>(hash_in['accType'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
362
|
+
:checkNum=>hash_in['checkNum']
|
363
|
+
}
|
364
|
+
Checker.purge_null(hash_out)
|
365
|
+
Checker.required_missing(hash_out)
|
366
|
+
return hash_out
|
367
|
+
end
|
368
|
+
|
369
|
+
def XMLFields.recyclingRequestType(hash_in)
|
370
|
+
hash_out= {
|
371
|
+
:recyleBy=>(hash_in['recyleBy'] or (!(hash_in.length== 1) ? 'REQUIRED':'throwFlag')),
|
372
|
+
}
|
373
|
+
Checker.purge_null(hash_out)
|
374
|
+
Checker.required_missing(hash_out)
|
375
|
+
return hash_out
|
376
|
+
end
|
377
|
+
end
|
378
|
+
|