LitleOnline 9.3.0 → 9.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +5 -2
- data/Rakefile +1 -1
- data/lib/Communications.rb +1 -1
- data/lib/LitleBatchRequest.rb +268 -150
- data/lib/LitleListeners.rb +119 -44
- data/lib/LitleOnlineRequest.rb +1 -1
- data/lib/LitleTransaction.rb +219 -112
- data/lib/XMLFields.rb +166 -18
- data/test/certification/certTest_batchAll.rb +282 -68
- data/test/unit/test_LitleAUBatch.rb +28 -0
- data/test/unit/test_LitleBatchRequest.rb +243 -109
- data/test/unit/test_LitleOnlineRequest.rb +1 -1
- metadata +2 -2
data/lib/LitleListeners.rb
CHANGED
@@ -22,145 +22,220 @@ 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
|
-
|
27
25
|
# This file contains the preloaded listeners for parsing the response XML.
|
28
26
|
|
29
|
-
|
30
27
|
module LitleOnline
|
31
|
-
|
32
28
|
# This listener will run the provided closure over every response hash
|
33
29
|
# This is the base class for all listeners applied to transaction responses
|
34
30
|
class DefaultLitleListener
|
35
31
|
def initialize(&action)
|
36
|
-
@action = action
|
32
|
+
@action = action
|
37
33
|
end
|
38
|
-
|
34
|
+
|
39
35
|
def apply(duck)
|
40
36
|
# apply the proc uniformly across all response types
|
41
37
|
@action.call(duck)
|
42
38
|
end
|
43
39
|
end
|
44
|
-
|
40
|
+
|
45
41
|
class AuthorizationListener < DefaultLitleListener
|
46
42
|
def apply(duck)
|
47
43
|
if(duck["type"] == "authorizationResponse") then
|
48
44
|
@action.call(duck)
|
49
45
|
end
|
50
|
-
end
|
46
|
+
end
|
51
47
|
end
|
52
|
-
|
48
|
+
|
53
49
|
class CaptureListener < DefaultLitleListener
|
54
50
|
def apply(duck)
|
55
51
|
if(duck["type"] == "captureResponse") then
|
56
52
|
@action.call(duck)
|
57
53
|
end
|
58
|
-
end
|
54
|
+
end
|
59
55
|
end
|
60
|
-
|
56
|
+
|
61
57
|
class ForceCaptureListener < DefaultLitleListener
|
62
58
|
def apply(duck)
|
63
59
|
if(duck["type"] == "forceCaptureResponse") then
|
64
60
|
@action.call(duck)
|
65
61
|
end
|
66
|
-
end
|
62
|
+
end
|
67
63
|
end
|
68
|
-
|
64
|
+
|
69
65
|
class CaptureGivenAuthListener < DefaultLitleListener
|
70
66
|
def apply(duck)
|
71
67
|
if(duck["type"] == "captureGivenAuthResponse") then
|
72
68
|
@action.call(duck)
|
73
69
|
end
|
74
|
-
end
|
70
|
+
end
|
75
71
|
end
|
76
|
-
|
72
|
+
|
77
73
|
class SaleListener < DefaultLitleListener
|
78
74
|
def apply(duck)
|
79
75
|
if(duck["type"] == "saleResponse") then
|
80
76
|
@action.call(duck)
|
81
77
|
end
|
82
|
-
end
|
78
|
+
end
|
83
79
|
end
|
84
|
-
|
85
|
-
|
80
|
+
|
86
81
|
class CreditListener < DefaultLitleListener
|
87
82
|
def apply(duck)
|
88
83
|
if(duck["type"] == "creditResponse") then
|
89
84
|
@action.call(duck)
|
90
85
|
end
|
91
|
-
end
|
86
|
+
end
|
92
87
|
end
|
93
|
-
|
88
|
+
|
94
89
|
class EcheckSaleListener < DefaultLitleListener
|
95
90
|
def apply(duck)
|
96
91
|
if(duck["type"] == "echeckSaleResponse") then
|
97
92
|
@action.call(duck)
|
98
93
|
end
|
99
|
-
end
|
94
|
+
end
|
100
95
|
end
|
101
|
-
|
96
|
+
|
102
97
|
class EcheckCreditListener < DefaultLitleListener
|
103
98
|
def apply(duck)
|
104
99
|
if(duck["type"] == "echeckCreditResponse") then
|
105
100
|
@action.call(duck)
|
106
101
|
end
|
107
|
-
end
|
102
|
+
end
|
108
103
|
end
|
109
|
-
|
104
|
+
|
110
105
|
class EcheckVerificationListener < DefaultLitleListener
|
111
106
|
def apply(duck)
|
112
107
|
if(duck["type"] == "echeckVerificationResponse") then
|
113
108
|
@action.call(duck)
|
114
109
|
end
|
115
|
-
end
|
110
|
+
end
|
116
111
|
end
|
117
|
-
|
112
|
+
|
118
113
|
class EcheckRedepositListener < DefaultLitleListener
|
119
114
|
def apply(duck)
|
120
115
|
if(duck["type"] == "echeckRedepositResponse") then
|
121
116
|
@action.call(duck)
|
122
117
|
end
|
123
|
-
end
|
118
|
+
end
|
124
119
|
end
|
125
|
-
|
120
|
+
|
126
121
|
class EcheckPreNoteSaleListener < DefaultLitleListener
|
127
122
|
def apply(duck)
|
128
123
|
if(duck["type"] == "echeckPreNoteSaleResponse") then
|
129
124
|
@action.call(duck)
|
130
125
|
end
|
131
|
-
end
|
126
|
+
end
|
132
127
|
end
|
133
|
-
|
128
|
+
|
134
129
|
class EcheckPreNoteCreditListener < DefaultLitleListener
|
135
130
|
def apply(duck)
|
136
131
|
if(duck["type"] == "echeckPreNoteCreditResponse") then
|
137
132
|
@action.call(duck)
|
138
133
|
end
|
139
|
-
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
class SubmerchantCreditListener < DefaultLitleListener
|
138
|
+
def apply(duck)
|
139
|
+
if(duck["type"] == "submerchantCreditResponse") then
|
140
|
+
@action.call(duck)
|
141
|
+
end
|
142
|
+
end
|
140
143
|
end
|
141
|
-
|
144
|
+
|
145
|
+
class PayFacCreditListener < DefaultLitleListener
|
146
|
+
def apply(duck)
|
147
|
+
if(duck["type"] == "payFacCreditResponse") then
|
148
|
+
@action.call(duck)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
class ReserveCreditListener < DefaultLitleListener
|
154
|
+
def apply(duck)
|
155
|
+
if(duck["type"] == "reserveCreditResponse") then
|
156
|
+
@action.call(duck)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
class VendorCreditListener < DefaultLitleListener
|
162
|
+
def apply(duck)
|
163
|
+
if(duck["type"] == "vendorCreditResponse") then
|
164
|
+
@action.call(duck)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
class PhysicalCheckCreditListener < DefaultLitleListener
|
170
|
+
def apply(duck)
|
171
|
+
if(duck["type"] == "physicalCheckCreditResponse") then
|
172
|
+
@action.call(duck)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
class SubmerchantDebitListener < DefaultLitleListener
|
178
|
+
def apply(duck)
|
179
|
+
if(duck["type"] == "submerchantDebitResponse") then
|
180
|
+
@action.call(duck)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
class PayFacDebitListener < DefaultLitleListener
|
186
|
+
def apply(duck)
|
187
|
+
if(duck["type"] == "payFacDebitResponse") then
|
188
|
+
@action.call(duck)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
class ReserveDebitListener < DefaultLitleListener
|
194
|
+
def apply(duck)
|
195
|
+
if(duck["type"] == "reserveDebitResponse") then
|
196
|
+
@action.call(duck)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
class VendorDebitListener < DefaultLitleListener
|
202
|
+
def apply(duck)
|
203
|
+
if(duck["type"] == "vendorDebitResponse") then
|
204
|
+
@action.call(duck)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
class PhysicalCheckDebitListener < DefaultLitleListener
|
210
|
+
def apply(duck)
|
211
|
+
if(duck["type"] == "physicalCheckDebitResponse") then
|
212
|
+
@action.call(duck)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
142
217
|
class AuthReversalListener < DefaultLitleListener
|
143
218
|
def apply(duck)
|
144
219
|
if(duck["type"] == "authReversalResponse") then
|
145
220
|
@action.call(duck)
|
146
221
|
end
|
147
|
-
end
|
222
|
+
end
|
148
223
|
end
|
149
|
-
|
224
|
+
|
150
225
|
class RegisterTokenListener < DefaultLitleListener
|
151
226
|
def apply(duck)
|
152
227
|
if(duck["type"] == "registerTokenResponse") then
|
153
228
|
@action.call(duck)
|
154
229
|
end
|
155
|
-
end
|
230
|
+
end
|
156
231
|
end
|
157
|
-
#
|
158
|
-
# class FraudCheckListener < DefaultLitleListener
|
159
|
-
# def apply(duck)
|
160
|
-
# if(duck["type"] == "fraudCheckResponse") then
|
161
|
-
# @action.call(duck)
|
162
|
-
# end
|
163
|
-
# end
|
164
|
-
# end
|
165
|
-
|
232
|
+
#
|
233
|
+
# class FraudCheckListener < DefaultLitleListener
|
234
|
+
# def apply(duck)
|
235
|
+
# if(duck["type"] == "fraudCheckResponse") then
|
236
|
+
# @action.call(duck)
|
237
|
+
# end
|
238
|
+
# end
|
239
|
+
# end
|
240
|
+
|
166
241
|
end
|
data/lib/LitleOnlineRequest.rb
CHANGED
data/lib/LitleTransaction.rb
CHANGED
@@ -30,7 +30,6 @@ require_relative 'Configuration'
|
|
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
|
@@ -40,7 +39,7 @@ module LitleOnline
|
|
40
39
|
transaction.debtRepayment = options['debtRepayment']
|
41
40
|
transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options, 'advancedFraudChecks')
|
42
41
|
add_transaction_info(transaction, options)
|
43
|
-
|
42
|
+
|
44
43
|
return transaction
|
45
44
|
end
|
46
45
|
|
@@ -49,49 +48,49 @@ module LitleOnline
|
|
49
48
|
transaction.subscriptionId = options['subscriptionId']
|
50
49
|
return transaction
|
51
50
|
end
|
52
|
-
|
51
|
+
|
53
52
|
def activate(options)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
53
|
+
transaction = Activate.new
|
54
|
+
transaction.orderId = options['orderId']
|
55
|
+
transaction.orderSource = options['orderSource']
|
56
|
+
transaction.amount = options['amount']
|
57
|
+
transaction.card = Card.from_hash(options,'card')
|
58
|
+
transaction.virtualGiftCard = VirtualGiftCard.from_hash(options,'virtualGiftCard')
|
59
|
+
return transaction
|
60
|
+
end
|
62
61
|
|
63
62
|
def deactivate(options)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
transaction = Deactivate.new
|
64
|
+
transaction.orderId = options['orderId']
|
65
|
+
transaction.orderSource = options['orderSource']
|
66
|
+
transaction.card = Card.from_hash(options,'card')
|
67
|
+
return transaction
|
69
68
|
end
|
70
69
|
|
71
70
|
def load_request(options)
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
transaction = Load.new
|
72
|
+
transaction.orderId = options['orderId']
|
73
|
+
transaction.orderSource = options['orderSource']
|
74
|
+
transaction.amount = options['amount']
|
75
|
+
transaction.card = Card.from_hash(options,'card')
|
76
|
+
return transaction
|
78
77
|
end
|
79
78
|
|
80
79
|
def unload_request(options)
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
80
|
+
transaction = Unload.new
|
81
|
+
transaction.orderId = options['orderId']
|
82
|
+
transaction.orderSource = options['orderSource']
|
83
|
+
transaction.amount = options['amount']
|
84
|
+
transaction.card = Card.from_hash(options,'card')
|
85
|
+
return transaction
|
87
86
|
end
|
88
87
|
|
89
88
|
def balance_inquiry(options)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
89
|
+
transaction = BalanceInquiry.new
|
90
|
+
transaction.orderId = options['orderId']
|
91
|
+
transaction.orderSource = options['orderSource']
|
92
|
+
transaction.card = Card.from_hash(options,'card')
|
93
|
+
return transaction
|
95
94
|
end
|
96
95
|
|
97
96
|
def update_subscription(options)
|
@@ -105,90 +104,90 @@ module LitleOnline
|
|
105
104
|
transaction.token = CardToken.from_hash(options,'token')
|
106
105
|
transaction.paypage = CardPaypage.from_hash(options,'paypage')
|
107
106
|
if(options['createDiscount'])
|
108
|
-
|
109
|
-
|
107
|
+
options['createDiscount'].each_index {| index | transaction.createDiscount << CreateDiscount.from_hash(options, index,'createDiscount')}
|
108
|
+
end
|
110
109
|
if(options['updateDiscount'])
|
111
|
-
|
112
|
-
|
110
|
+
options['updateDiscount'].each_index {| index | transaction.updateDiscount << UpdateDiscount.from_hash(options, index,'updateDiscount')}
|
111
|
+
end
|
113
112
|
if(options['deleteDiscount'])
|
114
|
-
|
115
|
-
|
113
|
+
options['deleteDiscount'].each_index {| index | transaction.deleteDiscount << DeleteDiscount.from_hash(options, index,'deleteDiscount')}
|
114
|
+
end
|
116
115
|
if(options['createAddOn'])
|
117
|
-
|
118
|
-
|
116
|
+
options['createAddOn'].each_index {| index | transaction.createAddOn << CreateAddOn.from_hash(options, index,'createAddOn')}
|
117
|
+
end
|
119
118
|
if(options['updateAddOn'])
|
120
|
-
|
121
|
-
|
119
|
+
options['updateAddOn'].each_index {| index | transaction.updateAddOn << UpdateAddOn.from_hash(options, index,'updateAddOn')}
|
120
|
+
end
|
122
121
|
if(options['deleteAddOn'])
|
123
|
-
|
124
|
-
|
122
|
+
options['deleteAddOn'].each_index {| index | transaction.deleteAddOn << DeleteAddOn.from_hash(options, index,'deleteAddOn')}
|
123
|
+
end
|
125
124
|
|
126
|
-
return transaction
|
125
|
+
return transaction
|
127
126
|
end
|
128
127
|
|
129
128
|
def create_plan(options)
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
129
|
+
transaction = CreatePlan.new
|
130
|
+
transaction.planCode = options['planCode']
|
131
|
+
transaction.name=options['name']
|
132
|
+
transaction.description=options['description']
|
133
|
+
transaction.intervalType=options['intervalType']
|
134
|
+
transaction.amount=options['amount']
|
135
|
+
transaction.numberOfPayments=options['numberOfPayments']
|
136
|
+
transaction.trialNumberOfIntervals=options['trialNumberOfIntervals']
|
137
|
+
transaction.trialIntervalType=options['trialIntervalType']
|
138
|
+
transaction.active=options['active']
|
139
|
+
return transaction
|
141
140
|
end
|
142
141
|
|
143
142
|
def update_plan(options)
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
143
|
+
transaction = UpdatePlan.new
|
144
|
+
transaction.planCode = options['planCode']
|
145
|
+
transaction.active=options['active']
|
146
|
+
return transaction
|
148
147
|
end
|
149
148
|
|
150
149
|
def virtual_giftcard(options)
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
150
|
+
transaction = VirtualGiftCard.new
|
151
|
+
transaction.accountNumberLength = options['accountNumberLength']
|
152
|
+
transaction.giftCardBin = options['giftCardBin']
|
153
|
+
return transaction
|
155
154
|
end
|
156
|
-
|
155
|
+
|
157
156
|
def activate_reversal(options)
|
158
157
|
transaction = ActivateReversal.new
|
159
158
|
transaction.litleTxnId = options['litleTxnId']
|
160
159
|
return transaction
|
161
|
-
end
|
160
|
+
end
|
162
161
|
|
163
162
|
def deposit_reversal(options)
|
164
163
|
transaction = DepositReversal.new
|
165
164
|
transaction.litleTxnId = options['litleTxnId']
|
166
165
|
return transaction
|
167
|
-
end
|
166
|
+
end
|
168
167
|
|
169
168
|
def refund_reversal(options)
|
170
169
|
transaction = RefundReversal.new
|
171
170
|
transaction.litleTxnId = options['litleTxnId']
|
172
171
|
return transaction
|
173
|
-
end
|
172
|
+
end
|
174
173
|
|
175
174
|
def deactivate_reversal(options)
|
176
175
|
transaction = DeactivateReversal.new
|
177
176
|
transaction.litleTxnId = options['litleTxnId']
|
178
177
|
return transaction
|
179
|
-
end
|
178
|
+
end
|
180
179
|
|
181
180
|
def load_reversal(options)
|
182
181
|
transaction = LoadReversal.new
|
183
182
|
transaction.litleTxnId = options['litleTxnId']
|
184
183
|
return transaction
|
185
|
-
end
|
184
|
+
end
|
186
185
|
|
187
186
|
def unload_reversal(options)
|
188
187
|
transaction = UnloadReversal.new
|
189
188
|
transaction.litleTxnId = options['litleTxnId']
|
190
189
|
return transaction
|
191
|
-
end
|
190
|
+
end
|
192
191
|
|
193
192
|
def sale(options)
|
194
193
|
transaction = Sale.new
|
@@ -217,7 +216,7 @@ module LitleOnline
|
|
217
216
|
transaction.card = Card.from_hash(options)
|
218
217
|
transaction.token = CardToken.from_hash(options,'token')
|
219
218
|
transaction.paypage = CardPaypage.from_hash(options,'paypage')
|
220
|
-
transaction.mpos = Mpos.from_hash(options,'mpos')
|
219
|
+
transaction.mpos = Mpos.from_hash(options,'mpos')
|
221
220
|
end
|
222
221
|
transaction.amount = options['amount']
|
223
222
|
transaction.secondaryAmount = options['secondaryAmount']
|
@@ -230,11 +229,11 @@ module LitleOnline
|
|
230
229
|
transaction.payPalNotes = options['payPalNotes']
|
231
230
|
transaction.actionReason = options['actionReason']
|
232
231
|
transaction.paypal = CreditPayPal.from_hash(options,'paypal')
|
233
|
-
|
232
|
+
|
234
233
|
add_account_info(transaction, options)
|
235
234
|
return transaction
|
236
235
|
end
|
237
|
-
|
236
|
+
|
238
237
|
def auth_reversal(options)
|
239
238
|
transaction = AuthReversal.new
|
240
239
|
|
@@ -243,7 +242,7 @@ module LitleOnline
|
|
243
242
|
transaction.surchargeAmount = options['surchargeAmount']
|
244
243
|
transaction.payPalNotes = options['payPalNotes']
|
245
244
|
transaction.actionReason = options['actionReason']
|
246
|
-
|
245
|
+
|
247
246
|
add_account_info(transaction, options)
|
248
247
|
return transaction
|
249
248
|
end
|
@@ -259,17 +258,17 @@ module LitleOnline
|
|
259
258
|
add_account_info(transaction, options)
|
260
259
|
return transaction
|
261
260
|
end
|
262
|
-
|
261
|
+
|
263
262
|
def update_card_validation_num_on_token(options)
|
264
263
|
transaction = UpdateCardValidationNumOnToken.new
|
265
|
-
|
264
|
+
|
266
265
|
transaction.orderId = options['orderId']
|
267
266
|
transaction.litleToken = options['litleToken']
|
268
267
|
transaction.cardValidationNum = options['cardValidationNum']
|
269
|
-
|
268
|
+
|
270
269
|
SchemaValidation.validate_length(transaction.litleToken, true, 13, 25, "updateCardValidationNumOnToken", "litleToken")
|
271
270
|
SchemaValidation.validate_length(transaction.cardValidationNum, true, 1, 4, "updateCardValidationNumOnToken", "cardValidationNum")
|
272
|
-
|
271
|
+
|
273
272
|
add_account_info(transaction, options)
|
274
273
|
return transaction
|
275
274
|
end
|
@@ -319,7 +318,7 @@ module LitleOnline
|
|
319
318
|
|
320
319
|
transaction.litleTxnId = options['litleTxnId']
|
321
320
|
transaction.processingInstructions = ProcessingInstructions.from_hash(options)
|
322
|
-
|
321
|
+
|
323
322
|
add_account_info(transaction, options)
|
324
323
|
return transaction
|
325
324
|
end
|
@@ -333,31 +332,139 @@ module LitleOnline
|
|
333
332
|
|
334
333
|
return transaction
|
335
334
|
end
|
336
|
-
|
335
|
+
|
337
336
|
def echeck_pre_note_sale(options)
|
338
337
|
transaction = EcheckPreNoteSale.new
|
339
338
|
transaction.echeck = Echeck.from_hash(options)
|
340
339
|
transaction.orderId = options['orderId']
|
341
340
|
transaction.orderSource = options['orderSource']
|
342
|
-
transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
343
|
-
add_account_info(transaction, options)
|
341
|
+
transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
342
|
+
add_account_info(transaction, options)
|
344
343
|
transaction.merchantData = MerchantData.from_hash(options)
|
345
344
|
|
346
345
|
return transaction
|
347
346
|
end
|
348
|
-
|
347
|
+
|
349
348
|
def echeck_pre_note_credit(options)
|
350
349
|
transaction = EcheckPreNoteCredit.new
|
351
|
-
transaction.echeck = Echeck.from_hash(options)
|
350
|
+
transaction.echeck = Echeck.from_hash(options)
|
352
351
|
transaction.orderId = options['orderId']
|
353
352
|
transaction.orderSource = options['orderSource']
|
354
|
-
transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
355
|
-
add_account_info(transaction, options)
|
353
|
+
transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
354
|
+
add_account_info(transaction, options)
|
356
355
|
transaction.merchantData = MerchantData.from_hash(options)
|
357
356
|
|
358
357
|
return transaction
|
359
358
|
end
|
360
359
|
|
360
|
+
def submerchant_credit(options)
|
361
|
+
transaction = SubmerchantCredit.new
|
362
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
363
|
+
transaction.submerchantName = options['submerchantName']
|
364
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
365
|
+
transaction.amount = options['amount']
|
366
|
+
transaction.accountInfo = Echeck.from_hash(options,'accountInfo')
|
367
|
+
add_account_info(transaction, options)
|
368
|
+
|
369
|
+
return transaction
|
370
|
+
end
|
371
|
+
|
372
|
+
def vendor_credit(options)
|
373
|
+
transaction = VendorCredit.new
|
374
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
375
|
+
transaction.vendorName = options['vendorName']
|
376
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
377
|
+
transaction.amount = options['amount']
|
378
|
+
transaction.accountInfo = Echeck.from_hash(options,'accountInfo')
|
379
|
+
add_account_info(transaction, options)
|
380
|
+
|
381
|
+
return transaction
|
382
|
+
end
|
383
|
+
|
384
|
+
def payFac_credit(options)
|
385
|
+
transaction = PayFacCredit.new
|
386
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
387
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
388
|
+
transaction.amount = options['amount']
|
389
|
+
add_account_info(transaction, options)
|
390
|
+
|
391
|
+
return transaction
|
392
|
+
end
|
393
|
+
|
394
|
+
def reserve_credit(options)
|
395
|
+
transaction = ReserveCredit.new
|
396
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
397
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
398
|
+
transaction.amount = options['amount']
|
399
|
+
add_account_info(transaction, options)
|
400
|
+
|
401
|
+
return transaction
|
402
|
+
end
|
403
|
+
|
404
|
+
def physical_check_credit(options)
|
405
|
+
transaction = PhysicalCheckCredit.new
|
406
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
407
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
408
|
+
transaction.amount = options['amount']
|
409
|
+
add_account_info(transaction, options)
|
410
|
+
|
411
|
+
return transaction
|
412
|
+
end
|
413
|
+
|
414
|
+
def submerchant_debit(options)
|
415
|
+
transaction = SubmerchantDebit.new
|
416
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
417
|
+
transaction.submerchantName = options['submerchantName']
|
418
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
419
|
+
transaction.amount = options['amount']
|
420
|
+
transaction.accountInfo = Echeck.from_hash(options,'accountInfo')
|
421
|
+
add_account_info(transaction, options)
|
422
|
+
|
423
|
+
return transaction
|
424
|
+
end
|
425
|
+
|
426
|
+
def vendor_debit(options)
|
427
|
+
transaction = VendorDebit.new
|
428
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
429
|
+
transaction.vendorName = options['vendorName']
|
430
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
431
|
+
transaction.amount = options['amount']
|
432
|
+
transaction.accountInfo = Echeck.from_hash(options,'accountInfo')
|
433
|
+
add_account_info(transaction, options)
|
434
|
+
|
435
|
+
return transaction
|
436
|
+
end
|
437
|
+
|
438
|
+
def payFac_debit(options)
|
439
|
+
transaction = PayFacDebit.new
|
440
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
441
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
442
|
+
transaction.amount = options['amount']
|
443
|
+
add_account_info(transaction, options)
|
444
|
+
|
445
|
+
return transaction
|
446
|
+
end
|
447
|
+
|
448
|
+
def reserve_debit(options)
|
449
|
+
transaction = ReserveDebit.new
|
450
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
451
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
452
|
+
transaction.amount = options['amount']
|
453
|
+
add_account_info(transaction, options)
|
454
|
+
|
455
|
+
return transaction
|
456
|
+
end
|
457
|
+
|
458
|
+
def physical_check_debit(options)
|
459
|
+
transaction = PhysicalCheckDebit.new
|
460
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
461
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
462
|
+
transaction.amount = options['amount']
|
463
|
+
add_account_info(transaction, options)
|
464
|
+
|
465
|
+
return transaction
|
466
|
+
end
|
467
|
+
|
361
468
|
def echeck_sale(options)
|
362
469
|
transaction = EcheckSale.new
|
363
470
|
add_echeck(transaction, options)
|
@@ -393,42 +500,42 @@ module LitleOnline
|
|
393
500
|
def echeck_void(options)
|
394
501
|
transaction = EcheckVoid.new
|
395
502
|
transaction.litleTxnId = options['litleTxnId']
|
396
|
-
|
503
|
+
|
397
504
|
add_account_info(transaction, options)
|
398
505
|
return transaction
|
399
506
|
end
|
400
|
-
|
507
|
+
|
401
508
|
def account_update(options)
|
402
509
|
transaction = AccountUpdate.new
|
403
510
|
transaction.card = Card.from_hash(options)
|
404
511
|
transaction.token = CardToken.from_hash(options,'token')
|
405
512
|
transaction.orderId = options['orderId']
|
406
|
-
|
513
|
+
|
407
514
|
add_account_info(transaction, options)
|
408
|
-
|
409
|
-
return transaction
|
410
|
-
end
|
411
|
-
#
|
412
|
-
# def fraud_check_request(options)
|
413
|
-
# transaction = FraudCheckRequest.new
|
414
|
-
# transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options,'advancedFraudChecks')
|
415
|
-
# transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
416
|
-
# transaction.shipToAddress = Contact.from_hash(options,'shipToAddress')
|
417
|
-
# transaction.amount = options['amount']
|
418
|
-
#
|
419
|
-
# add_account_info(transaction, options)
|
420
|
-
#
|
421
|
-
# return transaction
|
422
|
-
# end
|
423
|
-
|
515
|
+
|
516
|
+
return transaction
|
517
|
+
end
|
518
|
+
#
|
519
|
+
# def fraud_check_request(options)
|
520
|
+
# transaction = FraudCheckRequest.new
|
521
|
+
# transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options,'advancedFraudChecks')
|
522
|
+
# transaction.billToAddress = Contact.from_hash(options,'billToAddress')
|
523
|
+
# transaction.shipToAddress = Contact.from_hash(options,'shipToAddress')
|
524
|
+
# transaction.amount = options['amount']
|
525
|
+
#
|
526
|
+
# add_account_info(transaction, options)
|
527
|
+
#
|
528
|
+
# return transaction
|
529
|
+
# end
|
530
|
+
|
424
531
|
private
|
425
|
-
|
532
|
+
|
426
533
|
def add_account_info(transaction, options)
|
427
534
|
transaction.reportGroup = get_report_group(options)
|
428
535
|
transaction.transactionId = options['id']
|
429
536
|
transaction.customerId = options['customerId']
|
430
537
|
end
|
431
|
-
|
538
|
+
|
432
539
|
def add_transaction_info(transaction, options)
|
433
540
|
transaction.litleTxnId = options['litleTxnId']
|
434
541
|
transaction.customerInfo = CustomerInfo.from_hash(options)
|
@@ -476,13 +583,13 @@ module LitleOnline
|
|
476
583
|
def add_echeck(transaction, options)
|
477
584
|
transaction.echeck = Echeck.from_hash(options)
|
478
585
|
transaction.echeckToken = EcheckToken.from_hash(options)
|
479
|
-
|
586
|
+
|
480
587
|
add_account_info(transaction, options)
|
481
588
|
end
|
482
|
-
|
589
|
+
|
483
590
|
def get_report_group(options)
|
484
591
|
#options['reportGroup'] || @config_hash['default_report_group']
|
485
592
|
options['reportGroup']
|
486
593
|
end
|
487
|
-
end
|
594
|
+
end
|
488
595
|
end
|