CnpOnline 8.31.1 → 9.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +29 -12
- data/DESCRIPTION +2 -2
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Rakefile +4 -4
- data/Rakefile~ +5 -5
- data/SETUP.md +3 -3
- data/bin/Setup.rb +9 -8
- data/bin/sample_batch_driver.rb +1 -1
- data/bin/sample_driver.rb +1 -1
- data/lib/Communications.rb +1 -1
- data/lib/Configuration.rb +16 -16
- data/lib/EnvironmentVariables.rb +1 -2
- data/lib/LitleBatchRequest.rb +283 -147
- data/lib/LitleListeners.rb +132 -33
- data/lib/LitleOnline.rb +5 -4
- data/lib/LitleOnlineRequest.rb +69 -59
- data/lib/LitleRequest.rb +178 -141
- data/lib/LitleTransaction.rb +279 -122
- data/lib/LitleXmlMapper.rb +9 -4
- data/lib/XMLFields.rb +345 -26
- data/test/certification/certTest1_base.rb +74 -73
- data/test/certification/certTest2_authenhanced.rb +1 -1
- data/test/certification/certTest3_authreversal.rb +1 -1
- data/test/certification/certTest4_echeck.rb +4 -1
- data/test/certification/certTest5_token.rb +4 -4
- data/test/certification/certTest_batchAll.rb +296 -55
- data/test/certification/ts_all.rb +1 -1
- data/test/functional/test_activate.rb +7 -3
- data/test/functional/test_activateReversal.rb +7 -3
- data/test/functional/test_auth.rb +119 -16
- data/test/functional/test_authReversal.rb +5 -3
- data/test/functional/test_balanceInquiry.rb +5 -3
- data/test/functional/test_batch.rb +3 -3
- data/test/functional/test_batchStream.rb +14 -4
- data/test/functional/test_cancelSubscription.rb +5 -3
- data/test/functional/test_capture.rb +34 -3
- data/test/functional/test_captureGivenAuth.rb +55 -4
- data/test/functional/test_configuration.rb +2 -2
- data/test/functional/test_createPlan.rb +5 -3
- data/test/functional/test_credit.rb +45 -16
- data/test/functional/test_deactivate.rb +5 -3
- data/test/functional/test_deactivateReversal.rb +5 -3
- data/test/functional/test_depositReversal.rb +5 -3
- data/test/functional/test_echeckCredit.rb +26 -9
- data/test/functional/test_echeckRedeposit.rb +5 -3
- data/test/functional/test_echeckSale.rb +49 -28
- data/test/functional/test_echeckVerification.rb +20 -12
- data/test/functional/test_echeckVoid.rb +1 -1
- data/test/functional/test_forceCapture.rb +44 -22
- data/test/functional/test_fraudCheck.rb +77 -0
- data/test/functional/test_litle_requests.rb +24 -24
- data/test/functional/test_load.rb +5 -3
- data/test/functional/test_loadReversal.rb +5 -3
- data/test/functional/test_refundReversal.rb +5 -3
- data/test/functional/test_sale.rb +214 -29
- data/test/functional/test_token.rb +19 -3
- data/test/functional/test_unload.rb +5 -3
- data/test/functional/test_unloadReversal.rb +6 -4
- data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/functional/test_updatePlan.rb +5 -3
- data/test/functional/test_updateSubscription.rb +5 -3
- data/test/functional/test_utf8.rb +44 -0
- data/test/functional/test_xmlfields.rb +10 -6
- data/test/functional/ts_all.rb +2 -1
- data/test/unit/test_LitleAUBatch.rb +29 -1
- data/test/unit/test_LitleBatchRequest.rb +247 -113
- data/test/unit/test_LitleOnlineRequest.rb +37 -54
- data/test/unit/test_LitleRequest.rb +3 -3
- data/test/unit/test_LitleTransaction.rb +5 -5
- data/test/unit/test_LitleXmlMapper.rb +136 -0
- data/test/unit/test_activate.rb +1 -21
- data/test/unit/test_activateReversal.rb +1 -1
- data/test/unit/test_auth.rb +54 -14
- data/test/unit/test_authReversal.rb +1 -1
- data/test/unit/test_balanceInquiry.rb +1 -1
- data/test/unit/test_cancelSubscription.rb +1 -1
- data/test/unit/test_capture.rb +27 -1
- data/test/unit/test_captureGivenAuth.rb +44 -18
- data/test/unit/test_createPlan.rb +1 -1
- data/test/unit/test_credit.rb +16 -3
- data/test/unit/test_deactivate.rb +1 -1
- data/test/unit/test_deactivateReversal.rb +1 -1
- data/test/unit/test_depositReversal.rb +1 -1
- data/test/unit/test_echeckCredit.rb +15 -2
- data/test/unit/test_echeckRedeposit.rb +1 -1
- data/test/unit/test_echeckSale.rb +18 -1
- data/test/unit/test_echeckVerification.rb +1 -1
- data/test/unit/test_echeckVoid.rb +1 -1
- data/test/unit/test_forceCapture.rb +20 -2
- data/test/unit/test_fraudCheck.rb +45 -0
- data/test/unit/test_load.rb +1 -1
- data/test/unit/test_loadReversal.rb +1 -1
- data/test/unit/test_refundReversal.rb +1 -1
- data/test/unit/test_sale.rb +73 -7
- data/test/unit/test_token.rb +15 -4
- data/test/unit/test_unload.rb +1 -1
- data/test/unit/test_unloadReversal.rb +1 -1
- data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/unit/test_updatePlan.rb +1 -1
- data/test/unit/test_updateSubscription.rb +1 -1
- data/test/unit/test_xmlfields.rb +1 -1
- data/test/unit/ts_unit.rb +2 -1
- metadata +10 -7
- data/CHANGELOG~ +0 -142
data/lib/LitleTransaction.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -25,12 +25,11 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
25
25
|
require_relative 'Configuration'
|
26
26
|
|
27
27
|
#
|
28
|
-
# This class does all the heavy lifting of mapping the Ruby hash into
|
28
|
+
# This class does all the heavy lifting of mapping the Ruby hash into Vantiv eCommerce XML format
|
29
29
|
# It also handles validation looking for missing or incorrect fields
|
30
30
|
# contains the methods to properly create each transaction type
|
31
31
|
#
|
32
32
|
module LitleOnline
|
33
|
-
|
34
33
|
class LitleTransaction
|
35
34
|
def authorization(options)
|
36
35
|
transaction = Authorization.new
|
@@ -39,11 +38,12 @@ module LitleOnline
|
|
39
38
|
transaction.recurringRequest = RecurringRequest.from_hash(options,'recurringRequest')
|
40
39
|
transaction.debtRepayment = options['debtRepayment']
|
41
40
|
transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options, 'advancedFraudChecks')
|
42
|
-
transaction.processingType = options['processingType']
|
43
|
-
transaction.originalNetworkTransactionId = options['originalNetworkTransactionId']
|
44
|
-
transaction.originalTransactionAmount = options['originalTransactionAmount']
|
45
41
|
add_transaction_info(transaction, options)
|
46
|
-
|
42
|
+
#9.10
|
43
|
+
transaction.wallet = Wallet.from_hash(options, 'wallet')
|
44
|
+
transaction.processingType = options['processingType']
|
45
|
+
transaction.originalNetworkTransactionId = options['originalNetworkTransactionId']
|
46
|
+
transaction.originalTransactionAmount = options['originalTransactionAmount']
|
47
47
|
return transaction
|
48
48
|
end
|
49
49
|
|
@@ -52,49 +52,49 @@ module LitleOnline
|
|
52
52
|
transaction.subscriptionId = options['subscriptionId']
|
53
53
|
return transaction
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
def activate(options)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
end
|
57
|
+
transaction = Activate.new
|
58
|
+
transaction.orderId = options['orderId']
|
59
|
+
transaction.orderSource = options['orderSource']
|
60
|
+
transaction.amount = options['amount']
|
61
|
+
transaction.card = Card.from_hash(options,'card')
|
62
|
+
transaction.virtualGiftCard = VirtualGiftCard.from_hash(options,'virtualGiftCard')
|
63
|
+
return transaction
|
64
|
+
end
|
65
65
|
|
66
66
|
def deactivate(options)
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
transaction = Deactivate.new
|
68
|
+
transaction.orderId = options['orderId']
|
69
|
+
transaction.orderSource = options['orderSource']
|
70
|
+
transaction.card = Card.from_hash(options,'card')
|
71
|
+
return transaction
|
72
72
|
end
|
73
73
|
|
74
74
|
def load_request(options)
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
transaction = Load.new
|
76
|
+
transaction.orderId = options['orderId']
|
77
|
+
transaction.orderSource = options['orderSource']
|
78
|
+
transaction.amount = options['amount']
|
79
|
+
transaction.card = Card.from_hash(options,'card')
|
80
|
+
return transaction
|
81
81
|
end
|
82
82
|
|
83
83
|
def unload_request(options)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
84
|
+
transaction = Unload.new
|
85
|
+
transaction.orderId = options['orderId']
|
86
|
+
transaction.orderSource = options['orderSource']
|
87
|
+
transaction.amount = options['amount']
|
88
|
+
transaction.card = Card.from_hash(options,'card')
|
89
|
+
return transaction
|
90
90
|
end
|
91
91
|
|
92
92
|
def balance_inquiry(options)
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
93
|
+
transaction = BalanceInquiry.new
|
94
|
+
transaction.orderId = options['orderId']
|
95
|
+
transaction.orderSource = options['orderSource']
|
96
|
+
transaction.card = Card.from_hash(options,'card')
|
97
|
+
return transaction
|
98
98
|
end
|
99
99
|
|
100
100
|
def update_subscription(options)
|
@@ -108,106 +108,114 @@ module LitleOnline
|
|
108
108
|
transaction.token = CardToken.from_hash(options,'token')
|
109
109
|
transaction.paypage = CardPaypage.from_hash(options,'paypage')
|
110
110
|
if(options['createDiscount'])
|
111
|
-
|
112
|
-
|
111
|
+
options['createDiscount'].each_index {| index | transaction.createDiscount << CreateDiscount.from_hash(options, index,'createDiscount')}
|
112
|
+
end
|
113
113
|
if(options['updateDiscount'])
|
114
|
-
|
115
|
-
|
114
|
+
options['updateDiscount'].each_index {| index | transaction.updateDiscount << UpdateDiscount.from_hash(options, index,'updateDiscount')}
|
115
|
+
end
|
116
116
|
if(options['deleteDiscount'])
|
117
|
-
|
118
|
-
|
117
|
+
options['deleteDiscount'].each_index {| index | transaction.deleteDiscount << DeleteDiscount.from_hash(options, index,'deleteDiscount')}
|
118
|
+
end
|
119
119
|
if(options['createAddOn'])
|
120
|
-
|
121
|
-
|
120
|
+
options['createAddOn'].each_index {| index | transaction.createAddOn << CreateAddOn.from_hash(options, index,'createAddOn')}
|
121
|
+
end
|
122
122
|
if(options['updateAddOn'])
|
123
|
-
|
124
|
-
|
123
|
+
options['updateAddOn'].each_index {| index | transaction.updateAddOn << UpdateAddOn.from_hash(options, index,'updateAddOn')}
|
124
|
+
end
|
125
125
|
if(options['deleteAddOn'])
|
126
|
-
|
127
|
-
|
126
|
+
options['deleteAddOn'].each_index {| index | transaction.deleteAddOn << DeleteAddOn.from_hash(options, index,'deleteAddOn')}
|
127
|
+
end
|
128
128
|
|
129
|
-
return transaction
|
129
|
+
return transaction
|
130
130
|
end
|
131
131
|
|
132
132
|
def create_plan(options)
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
133
|
+
transaction = CreatePlan.new
|
134
|
+
transaction.planCode = options['planCode']
|
135
|
+
transaction.name=options['name']
|
136
|
+
transaction.description=options['description']
|
137
|
+
transaction.intervalType=options['intervalType']
|
138
|
+
transaction.amount=options['amount']
|
139
|
+
transaction.numberOfPayments=options['numberOfPayments']
|
140
|
+
transaction.trialNumberOfIntervals=options['trialNumberOfIntervals']
|
141
|
+
transaction.trialIntervalType=options['trialIntervalType']
|
142
|
+
transaction.active=options['active']
|
143
|
+
return transaction
|
144
144
|
end
|
145
145
|
|
146
146
|
def update_plan(options)
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
147
|
+
transaction = UpdatePlan.new
|
148
|
+
transaction.planCode = options['planCode']
|
149
|
+
transaction.active=options['active']
|
150
|
+
return transaction
|
151
151
|
end
|
152
152
|
|
153
153
|
def virtual_giftcard(options)
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
154
|
+
transaction = VirtualGiftCard.new
|
155
|
+
transaction.accountNumberLength = options['accountNumberLength']
|
156
|
+
transaction.giftCardBin = options['giftCardBin']
|
157
|
+
return transaction
|
158
158
|
end
|
159
|
-
|
159
|
+
|
160
160
|
def activate_reversal(options)
|
161
161
|
transaction = ActivateReversal.new
|
162
162
|
transaction.litleTxnId = options['litleTxnId']
|
163
163
|
return transaction
|
164
|
-
end
|
164
|
+
end
|
165
165
|
|
166
166
|
def deposit_reversal(options)
|
167
167
|
transaction = DepositReversal.new
|
168
168
|
transaction.litleTxnId = options['litleTxnId']
|
169
169
|
return transaction
|
170
|
-
end
|
170
|
+
end
|
171
171
|
|
172
172
|
def refund_reversal(options)
|
173
173
|
transaction = RefundReversal.new
|
174
174
|
transaction.litleTxnId = options['litleTxnId']
|
175
175
|
return transaction
|
176
|
-
end
|
176
|
+
end
|
177
177
|
|
178
178
|
def deactivate_reversal(options)
|
179
179
|
transaction = DeactivateReversal.new
|
180
180
|
transaction.litleTxnId = options['litleTxnId']
|
181
181
|
return transaction
|
182
|
-
end
|
182
|
+
end
|
183
183
|
|
184
184
|
def load_reversal(options)
|
185
185
|
transaction = LoadReversal.new
|
186
186
|
transaction.litleTxnId = options['litleTxnId']
|
187
187
|
return transaction
|
188
|
-
end
|
188
|
+
end
|
189
189
|
|
190
190
|
def unload_reversal(options)
|
191
191
|
transaction = UnloadReversal.new
|
192
192
|
transaction.litleTxnId = options['litleTxnId']
|
193
193
|
return transaction
|
194
|
-
end
|
194
|
+
end
|
195
195
|
|
196
196
|
def sale(options)
|
197
197
|
transaction = Sale.new
|
198
198
|
add_transaction_info(transaction, options)
|
199
|
-
transaction.secondaryAmount
|
200
|
-
transaction.surchargeAmount
|
201
|
-
transaction.fraudCheck
|
202
|
-
transaction.payPalOrderComplete
|
203
|
-
transaction.payPalNotes
|
204
|
-
transaction.recurringRequest
|
205
|
-
transaction.litleInternalRecurringRequest
|
206
|
-
transaction.debtRepayment
|
207
|
-
transaction.advancedFraudChecks
|
208
|
-
|
209
|
-
transaction.
|
210
|
-
transaction.
|
199
|
+
transaction.secondaryAmount = options['secondaryAmount']
|
200
|
+
transaction.surchargeAmount = options['surchargeAmount']
|
201
|
+
transaction.fraudCheck = FraudCheck.from_hash(options,'fraudCheck')
|
202
|
+
transaction.payPalOrderComplete = options['payPalOrderComplete']
|
203
|
+
transaction.payPalNotes = options['payPalNotes']
|
204
|
+
transaction.recurringRequest = RecurringRequest.from_hash(options,'recurringRequest')
|
205
|
+
transaction.litleInternalRecurringRequest = LitleInternalRecurringRequest.from_hash(options,'litleInternalRecurringRequest')
|
206
|
+
transaction.debtRepayment = options['debtRepayment']
|
207
|
+
transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options, 'advancedFraudChecks')
|
208
|
+
#9.10
|
209
|
+
transaction.wallet = Wallet.from_hash(options, 'wallet')
|
210
|
+
transaction.processingType = options['processingType']
|
211
|
+
transaction.originalNetworkTransactionId = options['originalNetworkTransactionId']
|
212
|
+
transaction.originalTransactionAmount = options['originalTransactionAmount']
|
213
|
+
#9.12
|
214
|
+
transaction.sepaDirectDebit = SepaDirectDebitType.from_hash(options,'sepaDirectDebit')
|
215
|
+
transaction.ideal = IdealType.from_hash(options,'ideal')
|
216
|
+
#9.14
|
217
|
+
transaction.giropay = GiropayType.from_hash(options,'giropay')
|
218
|
+
transaction.sofort = SofortType.from_hash(options,'sofort')
|
211
219
|
return transaction
|
212
220
|
end
|
213
221
|
|
@@ -223,7 +231,7 @@ module LitleOnline
|
|
223
231
|
transaction.card = Card.from_hash(options)
|
224
232
|
transaction.token = CardToken.from_hash(options,'token')
|
225
233
|
transaction.paypage = CardPaypage.from_hash(options,'paypage')
|
226
|
-
transaction.mpos = Mpos.from_hash(options,'mpos')
|
234
|
+
transaction.mpos = Mpos.from_hash(options,'mpos')
|
227
235
|
end
|
228
236
|
transaction.amount = options['amount']
|
229
237
|
transaction.secondaryAmount = options['secondaryAmount']
|
@@ -232,15 +240,18 @@ module LitleOnline
|
|
232
240
|
transaction.enhancedData = EnhancedData.from_hash(options)
|
233
241
|
transaction.processingInstructions = ProcessingInstructions.from_hash(options)
|
234
242
|
transaction.pos = Pos.from_hash(options)
|
243
|
+
#9.10
|
244
|
+
transaction.pin = options['pin']
|
245
|
+
#9.10 end
|
235
246
|
transaction.billMeLaterRequest = BillMeLaterRequest.from_hash(options)
|
236
247
|
transaction.payPalNotes = options['payPalNotes']
|
237
248
|
transaction.actionReason = options['actionReason']
|
238
249
|
transaction.paypal = CreditPayPal.from_hash(options,'paypal')
|
239
|
-
|
250
|
+
|
240
251
|
add_account_info(transaction, options)
|
241
252
|
return transaction
|
242
253
|
end
|
243
|
-
|
254
|
+
|
244
255
|
def auth_reversal(options)
|
245
256
|
transaction = AuthReversal.new
|
246
257
|
|
@@ -249,7 +260,7 @@ module LitleOnline
|
|
249
260
|
transaction.surchargeAmount = options['surchargeAmount']
|
250
261
|
transaction.payPalNotes = options['payPalNotes']
|
251
262
|
transaction.actionReason = options['actionReason']
|
252
|
-
|
263
|
+
|
253
264
|
add_account_info(transaction, options)
|
254
265
|
return transaction
|
255
266
|
end
|
@@ -265,28 +276,29 @@ module LitleOnline
|
|
265
276
|
add_account_info(transaction, options)
|
266
277
|
return transaction
|
267
278
|
end
|
268
|
-
|
279
|
+
|
269
280
|
def update_card_validation_num_on_token(options)
|
270
281
|
transaction = UpdateCardValidationNumOnToken.new
|
271
|
-
|
282
|
+
|
272
283
|
transaction.orderId = options['orderId']
|
273
284
|
transaction.litleToken = options['litleToken']
|
274
285
|
transaction.cardValidationNum = options['cardValidationNum']
|
275
|
-
|
286
|
+
|
276
287
|
SchemaValidation.validate_length(transaction.litleToken, true, 13, 25, "updateCardValidationNumOnToken", "litleToken")
|
277
288
|
SchemaValidation.validate_length(transaction.cardValidationNum, true, 1, 4, "updateCardValidationNumOnToken", "cardValidationNum")
|
278
|
-
|
289
|
+
|
279
290
|
add_account_info(transaction, options)
|
280
291
|
return transaction
|
281
292
|
end
|
282
293
|
|
283
294
|
def force_capture(options)
|
284
295
|
transaction = ForceCapture.new
|
285
|
-
transaction.secondaryAmount
|
296
|
+
transaction.secondaryAmount = options['secondaryAmount']
|
286
297
|
transaction.surchargeAmount = options['surchargeAmount']
|
287
298
|
transaction.customBilling = CustomBilling.from_hash(options)
|
288
299
|
transaction.debtRepayment = options['debtRepayment']
|
289
|
-
|
300
|
+
#9.10
|
301
|
+
transaction.processingType = options['processingType']
|
290
302
|
add_order_info(transaction, options)
|
291
303
|
|
292
304
|
return transaction
|
@@ -303,8 +315,10 @@ module LitleOnline
|
|
303
315
|
transaction.processingInstructions = ProcessingInstructions.from_hash(options)
|
304
316
|
transaction.payPalOrderComplete = options['payPalOrderComplete']
|
305
317
|
transaction.payPalNotes = options['payPalNotes']
|
306
|
-
|
307
|
-
|
318
|
+
#9.10
|
319
|
+
transaction.customBilling = CustomBilling.from_hash(options)
|
320
|
+
transaction.pin = options['pin']
|
321
|
+
|
308
322
|
add_account_info(transaction, options)
|
309
323
|
return transaction
|
310
324
|
end
|
@@ -312,16 +326,17 @@ module LitleOnline
|
|
312
326
|
def capture_given_auth(options)
|
313
327
|
transaction = CaptureGivenAuth.new
|
314
328
|
add_order_info(transaction, options)
|
315
|
-
transaction.secondaryAmount
|
316
|
-
transaction.surchargeAmount
|
317
|
-
transaction.authInformation
|
318
|
-
transaction.shipToAddress
|
319
|
-
transaction.customBilling
|
320
|
-
transaction.billMeLaterRequest
|
321
|
-
transaction.debtRepayment
|
322
|
-
|
323
|
-
transaction.
|
324
|
-
transaction.
|
329
|
+
transaction.secondaryAmount = options['secondaryAmount']
|
330
|
+
transaction.surchargeAmount = options['surchargeAmount']
|
331
|
+
transaction.authInformation = AuthInformation.from_hash(options)
|
332
|
+
transaction.shipToAddress = Contact.from_hash(options,'shipToAddress')
|
333
|
+
transaction.customBilling = CustomBilling.from_hash(options)
|
334
|
+
transaction.billMeLaterRequest = BillMeLaterRequest.from_hash(options)
|
335
|
+
transaction.debtRepayment = options['debtRepayment']
|
336
|
+
#9.10
|
337
|
+
transaction.processingType = options['processingType']
|
338
|
+
transaction.originalNetworkTransactionId = options['originalNetworkTransactionId']
|
339
|
+
transaction.originalTransactionAmount = options['originalTransactionAmount']
|
325
340
|
return transaction
|
326
341
|
end
|
327
342
|
|
@@ -330,7 +345,7 @@ module LitleOnline
|
|
330
345
|
|
331
346
|
transaction.litleTxnId = options['litleTxnId']
|
332
347
|
transaction.processingInstructions = ProcessingInstructions.from_hash(options)
|
333
|
-
|
348
|
+
|
334
349
|
add_account_info(transaction, options)
|
335
350
|
return transaction
|
336
351
|
end
|
@@ -345,6 +360,138 @@ module LitleOnline
|
|
345
360
|
return transaction
|
346
361
|
end
|
347
362
|
|
363
|
+
def echeck_pre_note_sale(options)
|
364
|
+
transaction = EcheckPreNoteSale.new
|
365
|
+
transaction.echeck = Echeck.from_hash(options)
|
366
|
+
transaction.orderId = options['orderId']
|
367
|
+
transaction.orderSource = options['orderSource']
|
368
|
+
transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
369
|
+
add_account_info(transaction, options)
|
370
|
+
transaction.merchantData = MerchantData.from_hash(options)
|
371
|
+
|
372
|
+
return transaction
|
373
|
+
end
|
374
|
+
|
375
|
+
def echeck_pre_note_credit(options)
|
376
|
+
transaction = EcheckPreNoteCredit.new
|
377
|
+
transaction.echeck = Echeck.from_hash(options)
|
378
|
+
transaction.orderId = options['orderId']
|
379
|
+
transaction.orderSource = options['orderSource']
|
380
|
+
transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
381
|
+
add_account_info(transaction, options)
|
382
|
+
transaction.merchantData = MerchantData.from_hash(options)
|
383
|
+
|
384
|
+
return transaction
|
385
|
+
end
|
386
|
+
|
387
|
+
def submerchant_credit(options)
|
388
|
+
transaction = SubmerchantCredit.new
|
389
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
390
|
+
transaction.submerchantName = options['submerchantName']
|
391
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
392
|
+
transaction.amount = options['amount']
|
393
|
+
transaction.accountInfo = Echeck.from_hash(options,'accountInfo')
|
394
|
+
add_account_info(transaction, options)
|
395
|
+
|
396
|
+
return transaction
|
397
|
+
end
|
398
|
+
|
399
|
+
def vendor_credit(options)
|
400
|
+
transaction = VendorCredit.new
|
401
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
402
|
+
transaction.vendorName = options['vendorName']
|
403
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
404
|
+
transaction.amount = options['amount']
|
405
|
+
transaction.accountInfo = Echeck.from_hash(options,'accountInfo')
|
406
|
+
add_account_info(transaction, options)
|
407
|
+
|
408
|
+
return transaction
|
409
|
+
end
|
410
|
+
|
411
|
+
def payFac_credit(options)
|
412
|
+
transaction = PayFacCredit.new
|
413
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
414
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
415
|
+
transaction.amount = options['amount']
|
416
|
+
add_account_info(transaction, options)
|
417
|
+
|
418
|
+
return transaction
|
419
|
+
end
|
420
|
+
|
421
|
+
def reserve_credit(options)
|
422
|
+
transaction = ReserveCredit.new
|
423
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
424
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
425
|
+
transaction.amount = options['amount']
|
426
|
+
add_account_info(transaction, options)
|
427
|
+
|
428
|
+
return transaction
|
429
|
+
end
|
430
|
+
|
431
|
+
def physical_check_credit(options)
|
432
|
+
transaction = PhysicalCheckCredit.new
|
433
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
434
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
435
|
+
transaction.amount = options['amount']
|
436
|
+
add_account_info(transaction, options)
|
437
|
+
|
438
|
+
return transaction
|
439
|
+
end
|
440
|
+
|
441
|
+
def submerchant_debit(options)
|
442
|
+
transaction = SubmerchantDebit.new
|
443
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
444
|
+
transaction.submerchantName = options['submerchantName']
|
445
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
446
|
+
transaction.amount = options['amount']
|
447
|
+
transaction.accountInfo = Echeck.from_hash(options,'accountInfo')
|
448
|
+
add_account_info(transaction, options)
|
449
|
+
|
450
|
+
return transaction
|
451
|
+
end
|
452
|
+
|
453
|
+
def vendor_debit(options)
|
454
|
+
transaction = VendorDebit.new
|
455
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
456
|
+
transaction.vendorName = options['vendorName']
|
457
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
458
|
+
transaction.amount = options['amount']
|
459
|
+
transaction.accountInfo = Echeck.from_hash(options,'accountInfo')
|
460
|
+
add_account_info(transaction, options)
|
461
|
+
|
462
|
+
return transaction
|
463
|
+
end
|
464
|
+
|
465
|
+
def payFac_debit(options)
|
466
|
+
transaction = PayFacDebit.new
|
467
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
468
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
469
|
+
transaction.amount = options['amount']
|
470
|
+
add_account_info(transaction, options)
|
471
|
+
|
472
|
+
return transaction
|
473
|
+
end
|
474
|
+
|
475
|
+
def reserve_debit(options)
|
476
|
+
transaction = ReserveDebit.new
|
477
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
478
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
479
|
+
transaction.amount = options['amount']
|
480
|
+
add_account_info(transaction, options)
|
481
|
+
|
482
|
+
return transaction
|
483
|
+
end
|
484
|
+
|
485
|
+
def physical_check_debit(options)
|
486
|
+
transaction = PhysicalCheckDebit.new
|
487
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
488
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
489
|
+
transaction.amount = options['amount']
|
490
|
+
add_account_info(transaction, options)
|
491
|
+
|
492
|
+
return transaction
|
493
|
+
end
|
494
|
+
|
348
495
|
def echeck_sale(options)
|
349
496
|
transaction = EcheckSale.new
|
350
497
|
add_echeck(transaction, options)
|
@@ -380,30 +527,40 @@ module LitleOnline
|
|
380
527
|
def echeck_void(options)
|
381
528
|
transaction = EcheckVoid.new
|
382
529
|
transaction.litleTxnId = options['litleTxnId']
|
383
|
-
|
530
|
+
|
384
531
|
add_account_info(transaction, options)
|
385
532
|
return transaction
|
386
533
|
end
|
387
|
-
|
534
|
+
|
388
535
|
def account_update(options)
|
389
536
|
transaction = AccountUpdate.new
|
390
537
|
transaction.card = Card.from_hash(options)
|
391
538
|
transaction.token = CardToken.from_hash(options,'token')
|
392
539
|
transaction.orderId = options['orderId']
|
393
|
-
|
540
|
+
|
394
541
|
add_account_info(transaction, options)
|
395
|
-
|
542
|
+
|
396
543
|
return transaction
|
397
544
|
end
|
398
|
-
|
545
|
+
|
546
|
+
def fraud_check_request(options)
|
547
|
+
transaction = FraudCheckRequest.new
|
548
|
+
transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options,'advancedFraudChecks')
|
549
|
+
transaction.transactionId = options["id"]
|
550
|
+
|
551
|
+
add_account_info(transaction, options)
|
552
|
+
|
553
|
+
return transaction
|
554
|
+
end
|
555
|
+
|
399
556
|
private
|
400
|
-
|
557
|
+
|
401
558
|
def add_account_info(transaction, options)
|
402
559
|
transaction.reportGroup = get_report_group(options)
|
403
560
|
transaction.transactionId = options['id']
|
404
561
|
transaction.customerId = options['customerId']
|
405
562
|
end
|
406
|
-
|
563
|
+
|
407
564
|
def add_transaction_info(transaction, options)
|
408
565
|
transaction.litleTxnId = options['litleTxnId']
|
409
566
|
transaction.customerInfo = CustomerInfo.from_hash(options)
|
@@ -451,13 +608,13 @@ module LitleOnline
|
|
451
608
|
def add_echeck(transaction, options)
|
452
609
|
transaction.echeck = Echeck.from_hash(options)
|
453
610
|
transaction.echeckToken = EcheckToken.from_hash(options)
|
454
|
-
|
611
|
+
|
455
612
|
add_account_info(transaction, options)
|
456
613
|
end
|
457
|
-
|
614
|
+
|
458
615
|
def get_report_group(options)
|
459
616
|
#options['reportGroup'] || @config_hash['default_report_group']
|
460
617
|
options['reportGroup']
|
461
618
|
end
|
462
|
-
end
|
619
|
+
end
|
463
620
|
end
|