LitleOnline 8.16.0 → 8.17.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/CHANGELOG +7 -0
- data/DESCRIPTION +1 -1
- data/README.md +2 -2
- data/Rakefile +6 -3
- data/bin/Setup.rb +14 -0
- data/bin/sample_batch_driver.rb +122 -0
- data/lib/LitleBatchRequest.rb +466 -0
- data/lib/LitleListeners.rb +142 -0
- data/lib/LitleOnline.rb +4 -0
- data/lib/LitleOnlineRequest.rb +25 -144
- data/lib/LitleRequest.rb +513 -0
- data/lib/LitleTransaction.rb +295 -0
- data/lib/XMLFields.rb +114 -4
- data/test/certification/certTest_batchAll.rb +337 -0
- data/test/certification/ts_all.rb +2 -0
- data/test/functional/test_batch.rb +164 -0
- data/test/functional/test_credit.rb +0 -18
- data/test/functional/test_litle_requests.rb +355 -0
- data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/functional/test_xmlfields.rb +0 -19
- data/test/functional/ts_all.rb +2 -0
- data/test/unit/test_LitleAUBatch.rb +217 -0
- data/test/unit/test_LitleBatchRequest.rb +599 -0
- data/test/unit/test_LitleOnlineRequest.rb +9 -57
- data/test/unit/test_LitleRequest.rb +320 -0
- data/test/unit/test_LitleTransaction.rb +398 -0
- data/test/unit/test_auth.rb +25 -2
- data/test/unit/test_authReversal.rb +28 -5
- data/test/unit/test_capture.rb +24 -1
- data/test/unit/test_captureGivenAuth.rb +23 -1
- data/test/unit/test_credit.rb +92 -19
- data/test/unit/test_echeckCredit.rb +1 -1
- data/test/unit/test_echeckRedeposit.rb +1 -1
- data/test/unit/test_echeckSale.rb +1 -1
- data/test/unit/test_echeckVerification.rb +1 -1
- data/test/unit/test_echeckVoid.rb +1 -1
- data/test/unit/test_forceCapture.rb +24 -1
- data/test/unit/test_sale.rb +25 -2
- data/test/unit/test_token.rb +1 -1
- data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/unit/test_xmlfields.rb +1 -1
- data/test/unit/ts_unit.rb +4 -0
- metadata +59 -14
@@ -0,0 +1,295 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2011 Litle & Co.
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require_relative 'Configuration'
|
26
|
+
|
27
|
+
#
|
28
|
+
# This class does all the heavy lifting of mapping the Ruby hash into Litle XML format
|
29
|
+
# It also handles validation looking for missing or incorrect fields
|
30
|
+
# contains the methods to properly create each transaction type
|
31
|
+
#
|
32
|
+
module LitleOnline
|
33
|
+
|
34
|
+
class LitleTransaction
|
35
|
+
def authorization(options)
|
36
|
+
transaction = Authorization.new
|
37
|
+
transaction.surchargeAmount = options['surchargeAmount']
|
38
|
+
add_transaction_info(transaction, options)
|
39
|
+
|
40
|
+
return transaction
|
41
|
+
end
|
42
|
+
|
43
|
+
def sale(options)
|
44
|
+
transaction = Sale.new
|
45
|
+
add_transaction_info(transaction, options)
|
46
|
+
|
47
|
+
transaction.surchargeAmount = options['surchargeAmount']
|
48
|
+
transaction.fraudCheck = FraudCheck.from_hash(options,'fraudCheck')
|
49
|
+
transaction.payPalOrderComplete = options['payPalOrderComplete']
|
50
|
+
transaction.payPalNotes = options['payPalNotes']
|
51
|
+
|
52
|
+
return transaction
|
53
|
+
end
|
54
|
+
|
55
|
+
def credit(options)
|
56
|
+
transaction = Credit.new
|
57
|
+
transaction.litleTxnId = options['litleTxnId']
|
58
|
+
if(transaction.litleTxnId.nil?)
|
59
|
+
transaction.orderId = options['orderId']
|
60
|
+
transaction.orderSource = options['orderSource']
|
61
|
+
transaction.taxType = options['taxType']
|
62
|
+
transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
63
|
+
transaction.amexAggregatorData = AmexAggregatorData.from_hash(options)
|
64
|
+
transaction.card = Card.from_hash(options)
|
65
|
+
transaction.token = CardToken.from_hash(options,'token')
|
66
|
+
transaction.paypage = CardPaypage.from_hash(options,'paypage')
|
67
|
+
end
|
68
|
+
transaction.amount = options['amount']
|
69
|
+
transaction.surchargeAmount = options['surchargeAmount']
|
70
|
+
transaction.customBilling = CustomBilling.from_hash(options)
|
71
|
+
transaction.enhancedData = EnhancedData.from_hash(options)
|
72
|
+
transaction.processingInstructions = ProcessingInstructions.from_hash(options)
|
73
|
+
transaction.pos = Pos.from_hash(options)
|
74
|
+
transaction.billMeLaterRequest = BillMeLaterRequest.from_hash(options)
|
75
|
+
transaction.payPalNotes = options['payPalNotes']
|
76
|
+
transaction.actionReason = options['actionReason']
|
77
|
+
transaction.paypal = CreditPayPal.from_hash(options,'paypal')
|
78
|
+
|
79
|
+
add_account_info(transaction, options)
|
80
|
+
return transaction
|
81
|
+
end
|
82
|
+
|
83
|
+
def auth_reversal(options)
|
84
|
+
transaction = AuthReversal.new
|
85
|
+
|
86
|
+
transaction.litleTxnId = options['litleTxnId']
|
87
|
+
transaction.amount = options['amount']
|
88
|
+
transaction.surchargeAmount = options['surchargeAmount']
|
89
|
+
transaction.payPalNotes = options['payPalNotes']
|
90
|
+
transaction.actionReason = options['actionReason']
|
91
|
+
|
92
|
+
add_account_info(transaction, options)
|
93
|
+
return transaction
|
94
|
+
end
|
95
|
+
|
96
|
+
def register_token_request(options)
|
97
|
+
transaction = RegisterTokenRequest.new
|
98
|
+
|
99
|
+
transaction.orderId = options['orderId']
|
100
|
+
transaction.accountNumber = options['accountNumber']
|
101
|
+
transaction.echeckForToken = EcheckForToken.from_hash(options)
|
102
|
+
transaction.paypageRegistrationId = options['paypageRegistrationId']
|
103
|
+
|
104
|
+
add_account_info(transaction, options)
|
105
|
+
return transaction
|
106
|
+
end
|
107
|
+
|
108
|
+
def update_card_validation_num_on_token(options)
|
109
|
+
transaction = UpdateCardValidationNumOnToken.new
|
110
|
+
|
111
|
+
transaction.orderId = options['orderId']
|
112
|
+
transaction.litleToken = options['litleToken']
|
113
|
+
transaction.cardValidationNum = options['cardValidationNum']
|
114
|
+
|
115
|
+
SchemaValidation.validate_length(transaction.litleToken, true, 13, 25, "updateCardValidationNumOnToken", "litleToken")
|
116
|
+
SchemaValidation.validate_length(transaction.cardValidationNum, true, 1, 4, "updateCardValidationNumOnToken", "cardValidationNum")
|
117
|
+
|
118
|
+
add_account_info(transaction, options)
|
119
|
+
return transaction
|
120
|
+
end
|
121
|
+
|
122
|
+
def force_capture(options)
|
123
|
+
transaction = ForceCapture.new
|
124
|
+
transaction.surchargeAmount = options['surchargeAmount']
|
125
|
+
transaction.customBilling = CustomBilling.from_hash(options)
|
126
|
+
|
127
|
+
add_order_info(transaction, options)
|
128
|
+
|
129
|
+
return transaction
|
130
|
+
end
|
131
|
+
|
132
|
+
def capture(options)
|
133
|
+
transaction = Capture.new
|
134
|
+
|
135
|
+
transaction.partial = options['partial']
|
136
|
+
transaction.litleTxnId = options['litleTxnId']
|
137
|
+
transaction.amount = options['amount']
|
138
|
+
transaction.surchargeAmount = options['surchargeAmount']
|
139
|
+
transaction.enhancedData = EnhancedData.from_hash(options)
|
140
|
+
transaction.processingInstructions = ProcessingInstructions.from_hash(options)
|
141
|
+
transaction.payPalOrderComplete = options['payPalOrderComplete']
|
142
|
+
transaction.payPalNotes = options['payPalNotes']
|
143
|
+
|
144
|
+
add_account_info(transaction, options)
|
145
|
+
return transaction
|
146
|
+
end
|
147
|
+
|
148
|
+
def capture_given_auth(options)
|
149
|
+
transaction = CaptureGivenAuth.new
|
150
|
+
add_order_info(transaction, options)
|
151
|
+
|
152
|
+
transaction.surchargeAmount = options['surchargeAmount']
|
153
|
+
transaction.authInformation = AuthInformation.from_hash(options)
|
154
|
+
transaction.shipToAddress = Contact.from_hash(options,'shipToAddress')
|
155
|
+
transaction.customBilling = CustomBilling.from_hash(options)
|
156
|
+
transaction.billMeLaterRequest = BillMeLaterRequest.from_hash(options)
|
157
|
+
|
158
|
+
return transaction
|
159
|
+
end
|
160
|
+
|
161
|
+
def void(options)
|
162
|
+
transaction = Void.new
|
163
|
+
|
164
|
+
transaction.litleTxnId = options['litleTxnId']
|
165
|
+
transaction.processingInstructions = ProcessingInstructions.from_hash(options)
|
166
|
+
|
167
|
+
add_account_info(transaction, options)
|
168
|
+
return transaction
|
169
|
+
end
|
170
|
+
|
171
|
+
def echeck_redeposit(options)
|
172
|
+
transaction = EcheckRedeposit.new
|
173
|
+
add_echeck(transaction, options)
|
174
|
+
|
175
|
+
transaction.litleTxnId = options['litleTxnId']
|
176
|
+
transaction.merchantData = MerchantData.from_hash(options)
|
177
|
+
|
178
|
+
return transaction
|
179
|
+
end
|
180
|
+
|
181
|
+
def echeck_sale(options)
|
182
|
+
transaction = EcheckSale.new
|
183
|
+
add_echeck(transaction, options)
|
184
|
+
add_echeck_order_info(transaction, options)
|
185
|
+
|
186
|
+
transaction.verify = options['verify']
|
187
|
+
transaction.shipToAddress = Contact.from_hash(options,'shipToAddress')
|
188
|
+
transaction.customBilling = CustomBilling.from_hash(options)
|
189
|
+
|
190
|
+
return transaction
|
191
|
+
end
|
192
|
+
|
193
|
+
def echeck_credit(options)
|
194
|
+
transaction = EcheckCredit.new
|
195
|
+
transaction.customBilling = CustomBilling.from_hash(options)
|
196
|
+
|
197
|
+
add_echeck_order_info(transaction, options)
|
198
|
+
add_echeck(transaction, options)
|
199
|
+
|
200
|
+
return transaction
|
201
|
+
end
|
202
|
+
|
203
|
+
def echeck_verification(options)
|
204
|
+
transaction = EcheckVerification.new
|
205
|
+
|
206
|
+
add_echeck_order_info(transaction, options)
|
207
|
+
add_echeck(transaction, options)
|
208
|
+
transaction.merchantData = MerchantData.from_hash(options)
|
209
|
+
|
210
|
+
return transaction
|
211
|
+
end
|
212
|
+
|
213
|
+
def echeck_void(options)
|
214
|
+
transaction = EcheckVoid.new
|
215
|
+
transaction.litleTxnId = options['litleTxnId']
|
216
|
+
|
217
|
+
add_account_info(transaction, options)
|
218
|
+
return transaction
|
219
|
+
end
|
220
|
+
|
221
|
+
def account_update(options)
|
222
|
+
transaction = AccountUpdate.new
|
223
|
+
transaction.card = Card.from_hash(options)
|
224
|
+
transaction.token = CardToken.from_hash(options,'token')
|
225
|
+
transaction.orderId = options['orderId']
|
226
|
+
|
227
|
+
add_account_info(transaction, options)
|
228
|
+
|
229
|
+
return transaction
|
230
|
+
end
|
231
|
+
|
232
|
+
private
|
233
|
+
|
234
|
+
def add_account_info(transaction, options)
|
235
|
+
transaction.reportGroup = get_report_group(options)
|
236
|
+
transaction.transactionId = options['id']
|
237
|
+
transaction.customerId = options['customerId']
|
238
|
+
end
|
239
|
+
|
240
|
+
def add_transaction_info(transaction, options)
|
241
|
+
transaction.litleTxnId = options['litleTxnId']
|
242
|
+
transaction.customerInfo = CustomerInfo.from_hash(options)
|
243
|
+
transaction.shipToAddress = Contact.from_hash(options,'shipToAddress')
|
244
|
+
transaction.billMeLaterRequest = BillMeLaterRequest.from_hash(options)
|
245
|
+
transaction.cardholderAuthentication = FraudCheck.from_hash(options)
|
246
|
+
transaction.allowPartialAuth = options['allowPartialAuth']
|
247
|
+
transaction.healthcareIIAS = HealthcareIIAS.from_hash(options)
|
248
|
+
transaction.filtering = Filtering.from_hash(options)
|
249
|
+
transaction.merchantData = MerchantData.from_hash(options)
|
250
|
+
transaction.recyclingRequest = RecyclingRequest.from_hash(options)
|
251
|
+
transaction.fraudFilterOverride = options['fraudFilterOverride']
|
252
|
+
transaction.customBilling = CustomBilling.from_hash(options)
|
253
|
+
transaction.paypal = PayPal.from_hash(options,'paypal')
|
254
|
+
|
255
|
+
add_order_info(transaction, options)
|
256
|
+
end
|
257
|
+
|
258
|
+
def add_order_info(transaction, options)
|
259
|
+
transaction.amount = options['amount']
|
260
|
+
transaction.orderId = options['orderId']
|
261
|
+
transaction.orderSource = options['orderSource']
|
262
|
+
transaction.taxType = options['taxType']
|
263
|
+
transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
264
|
+
transaction.enhancedData = EnhancedData.from_hash(options)
|
265
|
+
transaction.processingInstructions = ProcessingInstructions.from_hash(options)
|
266
|
+
transaction.pos = Pos.from_hash(options)
|
267
|
+
transaction.amexAggregatorData = AmexAggregatorData.from_hash(options)
|
268
|
+
transaction.card = Card.from_hash(options)
|
269
|
+
transaction.token = CardToken.from_hash(options,'token')
|
270
|
+
transaction.paypage = CardPaypage.from_hash(options,'paypage')
|
271
|
+
|
272
|
+
add_account_info(transaction, options)
|
273
|
+
end
|
274
|
+
|
275
|
+
def add_echeck_order_info(transaction, options)
|
276
|
+
transaction.litleTxnId = options['litleTxnId']
|
277
|
+
transaction.orderId = options['orderId']
|
278
|
+
transaction.amount = options['amount']
|
279
|
+
transaction.orderSource = options['orderSource']
|
280
|
+
transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
281
|
+
end
|
282
|
+
|
283
|
+
def add_echeck(transaction, options)
|
284
|
+
transaction.echeck = Echeck.from_hash(options)
|
285
|
+
transaction.echeckToken = EcheckToken.from_hash(options)
|
286
|
+
|
287
|
+
add_account_info(transaction, options)
|
288
|
+
end
|
289
|
+
|
290
|
+
def get_report_group(options)
|
291
|
+
#options['reportGroup'] || @config_hash['default_report_group']
|
292
|
+
options['reportGroup']
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
data/lib/XMLFields.rb
CHANGED
@@ -112,7 +112,8 @@ module LitleOnline
|
|
112
112
|
return
|
113
113
|
end
|
114
114
|
if(!list.include?(value))
|
115
|
-
|
115
|
+
str = '["'+ list.join('", "') + '"]'
|
116
|
+
raise "If #{class_name} #{field_name} is specified, it must be in #{str}"
|
116
117
|
end
|
117
118
|
end
|
118
119
|
|
@@ -423,6 +424,7 @@ module LitleOnline
|
|
423
424
|
text_node :capability, "capability", :default_value=>nil
|
424
425
|
text_node :entryMode, "entryMode", :default_value=>nil
|
425
426
|
text_node :cardholderId, "cardholderId", :default_value=>nil
|
427
|
+
text_node :terminalId, "terminalId", :default_value=>nil
|
426
428
|
def self.from_hash(hash, name='pos')
|
427
429
|
base = hash[name]
|
428
430
|
if(base)
|
@@ -430,6 +432,7 @@ module LitleOnline
|
|
430
432
|
this.capability = base['capability']
|
431
433
|
this.entryMode = base['entryMode']
|
432
434
|
this.cardholderId = base['cardholderId']
|
435
|
+
this.terminalId = base['terminalId']
|
433
436
|
SchemaValidation.validate_enum(this.capability, true, ['notused','magstripe','keyedonly'], name, 'capability')
|
434
437
|
SchemaValidation.validate_enum(this.entryMode, true, ['notused','keyed','track1','track2','completeread'], name, 'entryMode')
|
435
438
|
SchemaValidation.validate_enum(this.cardholderId, true, ['signature','pin','nopin','directmarket'], name, 'cardholderId')
|
@@ -888,6 +891,7 @@ module LitleOnline
|
|
888
891
|
|
889
892
|
class Authorization
|
890
893
|
include XML::Mapping
|
894
|
+
root_element_name "authorization"
|
891
895
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
892
896
|
text_node :transactionId, "@id", :default_value=>nil
|
893
897
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -895,6 +899,7 @@ module LitleOnline
|
|
895
899
|
text_node :litleTxnId, "litleTxnId", :default_value=>nil
|
896
900
|
text_node :orderId, "orderId", :default_value=>nil
|
897
901
|
text_node :amount, "amount", :default_value=>nil
|
902
|
+
text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
|
898
903
|
text_node :orderSource, "orderSource", :default_value=>nil
|
899
904
|
object_node :customerInfo, "customerInfo", :class=>CustomerInfo, :default_value=>nil
|
900
905
|
object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
|
@@ -921,6 +926,7 @@ module LitleOnline
|
|
921
926
|
|
922
927
|
class Sale
|
923
928
|
include XML::Mapping
|
929
|
+
root_element_name "sale"
|
924
930
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
925
931
|
text_node :transactionId, "@id", :default_value=>nil
|
926
932
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -928,6 +934,7 @@ module LitleOnline
|
|
928
934
|
text_node :litleTxnId, "litleTxnId", :default_value=>nil
|
929
935
|
text_node :orderId, "orderId", :default_value=>nil
|
930
936
|
text_node :amount, "amount", :default_value=>nil
|
937
|
+
text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
|
931
938
|
text_node :orderSource, "orderSource", :default_value=>nil
|
932
939
|
object_node :customerInfo, "customerInfo", :class=>CustomerInfo, :default_value=>nil
|
933
940
|
object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
|
@@ -957,6 +964,7 @@ module LitleOnline
|
|
957
964
|
|
958
965
|
class Credit
|
959
966
|
include XML::Mapping
|
967
|
+
root_element_name "credit"
|
960
968
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
961
969
|
text_node :transactionId, "@id", :default_value=>nil
|
962
970
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -964,6 +972,7 @@ module LitleOnline
|
|
964
972
|
text_node :litleTxnId, "litleTxnId", :default_value=>nil
|
965
973
|
text_node :orderId, "orderId", :default_value=>nil
|
966
974
|
text_node :amount, "amount", :default_value=>nil
|
975
|
+
text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
|
967
976
|
text_node :orderSource, "orderSource", :default_value=>nil
|
968
977
|
object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
|
969
978
|
optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
|
@@ -984,6 +993,7 @@ module LitleOnline
|
|
984
993
|
|
985
994
|
class RegisterTokenRequest
|
986
995
|
include XML::Mapping
|
996
|
+
root_element_name "registerTokenRequest"
|
987
997
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
988
998
|
text_node :transactionId, "@id", :default_value=>nil
|
989
999
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -996,6 +1006,7 @@ module LitleOnline
|
|
996
1006
|
|
997
1007
|
class CaptureGivenAuth
|
998
1008
|
include XML::Mapping
|
1009
|
+
root_element_name "captureGivenAuth"
|
999
1010
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1000
1011
|
text_node :transactionId, "@id", :default_value=>nil
|
1001
1012
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1003,6 +1014,7 @@ module LitleOnline
|
|
1003
1014
|
text_node :orderId, "orderId", :default_value=>nil
|
1004
1015
|
object_node :authInformation, "authInformation", :class=>AuthInformation, :default_value=>nil
|
1005
1016
|
text_node :amount, "amount", :default_value=>nil
|
1017
|
+
text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
|
1006
1018
|
text_node :orderSource, "orderSource", :default_value=>nil
|
1007
1019
|
object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
|
1008
1020
|
object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
|
@@ -1021,12 +1033,14 @@ module LitleOnline
|
|
1021
1033
|
|
1022
1034
|
class ForceCapture
|
1023
1035
|
include XML::Mapping
|
1036
|
+
root_element_name "forceCapture"
|
1024
1037
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1025
1038
|
text_node :transactionId, "@id", :default_value=>nil
|
1026
1039
|
text_node :customerId, "@customerId", :default_value=>nil
|
1027
1040
|
|
1028
1041
|
text_node :orderId, "orderId", :default_value=>nil
|
1029
1042
|
text_node :amount, "amount", :default_value=>nil
|
1043
|
+
text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
|
1030
1044
|
text_node :orderSource, "orderSource", :default_value=>nil
|
1031
1045
|
object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
|
1032
1046
|
optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
|
@@ -1043,6 +1057,7 @@ module LitleOnline
|
|
1043
1057
|
|
1044
1058
|
class AuthReversal
|
1045
1059
|
include XML::Mapping
|
1060
|
+
root_element_name "authReversal"
|
1046
1061
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1047
1062
|
text_node :transactionId, "@id", :default_value=>nil
|
1048
1063
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1050,12 +1065,14 @@ module LitleOnline
|
|
1050
1065
|
|
1051
1066
|
text_node :litleTxnId, "litleTxnId", :default_value=>nil
|
1052
1067
|
text_node :amount, "amount", :default_value=>nil
|
1068
|
+
text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
|
1053
1069
|
text_node :payPalNotes, "payPalNotes", :default_value=>nil
|
1054
1070
|
text_node :actionReason, "actionReason", :default_value=>nil
|
1055
1071
|
end
|
1056
1072
|
|
1057
1073
|
class Capture
|
1058
1074
|
include XML::Mapping
|
1075
|
+
root_element_name "capture"
|
1059
1076
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1060
1077
|
text_node :transactionId, "@id", :default_value=>nil
|
1061
1078
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1063,6 +1080,7 @@ module LitleOnline
|
|
1063
1080
|
|
1064
1081
|
text_node :litleTxnId, "litleTxnId", :default_value=>nil
|
1065
1082
|
text_node :amount, "amount", :default_value=>nil
|
1083
|
+
text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
|
1066
1084
|
object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
|
1067
1085
|
object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
|
1068
1086
|
text_node :payPalOrderComplete, "payPalOrderComplete", :default_value=>nil
|
@@ -1071,6 +1089,7 @@ module LitleOnline
|
|
1071
1089
|
|
1072
1090
|
class Void
|
1073
1091
|
include XML::Mapping
|
1092
|
+
root_element_name "void"
|
1074
1093
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1075
1094
|
text_node :transactionId, "@id", :default_value=>nil
|
1076
1095
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1081,6 +1100,7 @@ module LitleOnline
|
|
1081
1100
|
|
1082
1101
|
class EcheckVoid
|
1083
1102
|
include XML::Mapping
|
1103
|
+
root_element_name "echeckVoid"
|
1084
1104
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1085
1105
|
text_node :transactionId, "@id", :default_value=>nil
|
1086
1106
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1090,6 +1110,7 @@ module LitleOnline
|
|
1090
1110
|
|
1091
1111
|
class EcheckVerification
|
1092
1112
|
include XML::Mapping
|
1113
|
+
root_element_name "echeckVerification"
|
1093
1114
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1094
1115
|
text_node :transactionId, "@id", :default_value=>nil
|
1095
1116
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1107,6 +1128,7 @@ module LitleOnline
|
|
1107
1128
|
|
1108
1129
|
class EcheckCredit
|
1109
1130
|
include XML::Mapping
|
1131
|
+
root_element_name "echeckCredit"
|
1110
1132
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1111
1133
|
text_node :transactionId, "@id", :default_value=>nil
|
1112
1134
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1124,6 +1146,7 @@ module LitleOnline
|
|
1124
1146
|
|
1125
1147
|
class EcheckRedeposit
|
1126
1148
|
include XML::Mapping
|
1149
|
+
root_element_name "echeckRedeposit"
|
1127
1150
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1128
1151
|
text_node :transactionId, "@id", :default_value=>nil
|
1129
1152
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1136,6 +1159,7 @@ module LitleOnline
|
|
1136
1159
|
|
1137
1160
|
class EcheckSale
|
1138
1161
|
include XML::Mapping
|
1162
|
+
root_element_name "echeckSale"
|
1139
1163
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1140
1164
|
text_node :transactionId, "@id", :default_value=>nil
|
1141
1165
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1155,6 +1179,7 @@ module LitleOnline
|
|
1155
1179
|
|
1156
1180
|
class UpdateCardValidationNumOnToken
|
1157
1181
|
include XML::Mapping
|
1182
|
+
root_element_name "updateCardValidationNumOnToken"
|
1158
1183
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1159
1184
|
text_node :transactionId, "@id", :default_value=>nil
|
1160
1185
|
text_node :customerId, "@customerId", :default_value=>nil
|
@@ -1164,6 +1189,17 @@ module LitleOnline
|
|
1164
1189
|
text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
|
1165
1190
|
end
|
1166
1191
|
|
1192
|
+
class AccountUpdate
|
1193
|
+
include XML::Mapping
|
1194
|
+
root_element_name "accountUpdate"
|
1195
|
+
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1196
|
+
text_node :transactionId, "@id", :default_value=>nil
|
1197
|
+
text_node :customerId, "@customerId", :default_value=>nil
|
1198
|
+
|
1199
|
+
text_node :orderId, "orderId", :default_value=>nil
|
1200
|
+
optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
|
1201
|
+
:else, (object_node :token, "token", :class=>CardToken)
|
1202
|
+
end
|
1167
1203
|
|
1168
1204
|
class OnlineRequest
|
1169
1205
|
include XML::Mapping
|
@@ -1199,11 +1235,85 @@ module LitleOnline
|
|
1199
1235
|
|
1200
1236
|
end
|
1201
1237
|
|
1202
|
-
class
|
1203
|
-
|
1238
|
+
class BatchRequest
|
1239
|
+
include XML::Mapping
|
1240
|
+
root_element_name "batchRequest"
|
1241
|
+
|
1242
|
+
text_node :numAuths, "@numAuths", :default_value=>"0"
|
1243
|
+
text_node :authAmount, "@authAmount", :default_value=>"0"
|
1244
|
+
text_node :numSales, "@numSales", :default_value=>"0"
|
1245
|
+
text_node :saleAmount, "@saleAmount", :default_value=>"0"
|
1246
|
+
text_node :numCredits, "@numCredits", :default_value=>"0"
|
1247
|
+
text_node :creditAmount, "@creditAmount", :default_value=>"0"
|
1248
|
+
text_node :numTokenRegistrations, "@numTokenRegistrations", :default_value=>"0"
|
1249
|
+
text_node :numCaptureGivenAuths, "@numCaptureGivenAuths", :default_value=>"0"
|
1250
|
+
text_node :captureGivenAuthAmount, "@captureGivenAuthAmount", :default_value=>"0"
|
1251
|
+
text_node :numForceCaptures, "@numForceCaptures", :default_value=>"0"
|
1252
|
+
text_node :forceCaptureAmount, "@forceCaptureAmount", :default_value=>"0"
|
1253
|
+
text_node :numAuthReversals, "@numAuthReversals", :default_value=>"0"
|
1254
|
+
text_node :authReversalAmount, "@authReversalAmount", :default_value=>"0"
|
1255
|
+
text_node :numCaptures, "@numCaptures", :default_value=>"0"
|
1256
|
+
text_node :captureAmount, "@captureAmount", :default_value=>"0"
|
1257
|
+
text_node :numEcheckSales, "@numEcheckSales", :default_value=>"0"
|
1258
|
+
text_node :echeckSalesAmount, "@echeckSalesAmount", :default_value=>"0"
|
1259
|
+
text_node :numEcheckRedeposit, "@numEcheckRedeposit", :default_value=>"0"
|
1260
|
+
text_node :numEcheckCredit, "@numEcheckCredit", :default_value=>"0"
|
1261
|
+
text_node :echeckCreditAmount, "@echeckCreditAmount", :default_value=>"0"
|
1262
|
+
text_node :numEcheckVerification, "@numEcheckVerification", :default_value=>"0"
|
1263
|
+
text_node :echeckVerificationAmount, "@echeckVerificationAmount", :default_value=>"0"
|
1264
|
+
text_node :numUpdateCardValidationNumOnTokens, "@numUpdateCardValidationNumOnTokens", :default_value=>"0"
|
1265
|
+
text_node :numAccountUpdates, "@numAccountUpdates", :default_value=>"0"
|
1266
|
+
text_node :merchantId, "@merchantId", :default_value=>nil
|
1267
|
+
text_node :id, "@id", :default_value=>nil
|
1268
|
+
end
|
1269
|
+
|
1270
|
+
class LitleRequest
|
1271
|
+
include XML::Mapping
|
1272
|
+
# version="6.0" xmlns="http://www.litle.com/schema" numBatchRequests = "1">
|
1273
|
+
# <authentication>
|
1274
|
+
# <user>XMLTESTV6ORG14</user>
|
1275
|
+
# <password>password</password>
|
1276
|
+
# </authentication>
|
1277
|
+
root_element_name "litleRequest"
|
1278
|
+
|
1279
|
+
text_node :version, "@version", :default_value=>"0"
|
1280
|
+
text_node :xmlns, "@xmlns", :default_value=>nil
|
1281
|
+
#TODO: ask greg about sessionId
|
1282
|
+
#text_node :sessionId, "@id", default_vale:nil
|
1283
|
+
text_node :numBatchRequests, "@numBatchRequests", :default_value=>"0"
|
1284
|
+
object_node :authentication, "authentication", :class=>Authentication
|
1285
|
+
end
|
1286
|
+
|
1287
|
+
class AccountUpdateFileRequestData
|
1288
|
+
include XML::Mapping
|
1289
|
+
root_element_name "accountUpdateFileRequestData"
|
1290
|
+
|
1291
|
+
text_node :merchantId, "merchantId", :default_value=>nil
|
1292
|
+
text_node :postDay, "postDay", :default_value=>nil
|
1204
1293
|
end
|
1205
1294
|
|
1206
|
-
class
|
1295
|
+
class LitleRFRRequest
|
1296
|
+
include XML::Mapping
|
1297
|
+
root_element_name "RFRRequest"
|
1298
|
+
optional_choice_node :if, 'litleSessionId', :then, (text_node :litleSessionId, "litleSessionId"),
|
1299
|
+
:elsif, 'accountUpdateFileRequestData', :then, (object_node :accountUpdateFileRequestData, "accountUpdateFileRequestData", :class=>AccountUpdateFileRequestData)
|
1300
|
+
end
|
1207
1301
|
|
1302
|
+
class LitleRequestForRFR
|
1303
|
+
include XML::Mapping
|
1304
|
+
root_element_name "litleRequest"
|
1305
|
+
text_node :version, "@version", :default_value=>"0"
|
1306
|
+
text_node :xmlns, "@xmlns", :default_value=>nil
|
1307
|
+
text_node :numBatchRequests, "@numBatchRequests", :default_value=>nil
|
1308
|
+
object_node :authentication, "authentication", :class=>Authentication
|
1309
|
+
object_node :rfrRequest, 'RFRRequest', :class=>LitleRFRRequest
|
1208
1310
|
end
|
1311
|
+
# begin
|
1312
|
+
# class LitleOnlineResponse
|
1313
|
+
# attr_accessor :message
|
1314
|
+
# end
|
1315
|
+
#
|
1316
|
+
# class XMLFields
|
1317
|
+
#
|
1318
|
+
# end
|
1209
1319
|
end
|