Class: LitleOnline::LitleTransaction

Inherits:
Object
  • Object
show all
Defined in:
lib/LitleTransaction.rb

Instance Method Summary collapse

Instance Method Details

#account_update(options) ⇒ Object



388
389
390
391
392
393
394
395
396
397
# File 'lib/LitleTransaction.rb', line 388

def (options)
  transaction = AccountUpdate.new
  transaction.card = Card.from_hash(options)
  transaction.token = CardToken.from_hash(options,'token')
  transaction.orderId = options['orderId']
  
  (transaction, options)
  
  return transaction
end

#activate(options) ⇒ Object



56
57
58
59
60
61
62
63
64
# File 'lib/LitleTransaction.rb', line 56

def activate(options)
   transaction = Activate.new
   transaction.orderId = options['orderId']
   transaction.orderSource = options['orderSource']
   transaction.amount = options['amount']
   transaction.card = Card.from_hash(options,'card')
   transaction.virtualGiftCard = VirtualGiftCard.from_hash(options,'virtualGiftCard')
   return transaction
end

#activate_reversal(options) ⇒ Object



160
161
162
163
164
# File 'lib/LitleTransaction.rb', line 160

def activate_reversal(options)
  transaction = ActivateReversal.new
  transaction.litleTxnId = options['litleTxnId']
  return transaction
end

#auth_reversal(options) ⇒ Object



244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/LitleTransaction.rb', line 244

def auth_reversal(options)
  transaction = AuthReversal.new

  transaction.litleTxnId      = options['litleTxnId']
  transaction.amount          = options['amount']
  transaction.surchargeAmount = options['surchargeAmount']
  transaction.payPalNotes     = options['payPalNotes']
  transaction.actionReason    = options['actionReason']
  
  (transaction, options)
  return transaction
end

#authorization(options) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/LitleTransaction.rb', line 35

def authorization(options)
  transaction = Authorization.new
  transaction.secondaryAmount = options['secondaryAmount']
  transaction.surchargeAmount    = options['surchargeAmount']
  transaction.recurringRequest   = RecurringRequest.from_hash(options,'recurringRequest')
  transaction.debtRepayment	     = options['debtRepayment']
  transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options, 'advancedFraudChecks')
  transaction.processingType = options['processingType']
  transaction.originalNetworkTransactionId = options['originalNetworkTransactionId']
  transaction.originalTransactionAmount = options['originalTransactionAmount']
  add_transaction_info(transaction, options)
  
  return transaction
end

#balance_inquiry(options) ⇒ Object



92
93
94
95
96
97
98
# File 'lib/LitleTransaction.rb', line 92

def balance_inquiry(options)
   transaction = BalanceInquiry.new
   transaction.orderId = options['orderId']
   transaction.orderSource = options['orderSource']
   transaction.card = Card.from_hash(options,'card')
   return transaction
end

#cancel_subscription(options) ⇒ Object



50
51
52
53
54
# File 'lib/LitleTransaction.rb', line 50

def cancel_subscription(options)
  transaction = CancelSubscription.new
  transaction.subscriptionId = options['subscriptionId']
  return transaction
end

#capture(options) ⇒ Object



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/LitleTransaction.rb', line 295

def capture(options)
  transaction = Capture.new

  transaction.partial                 = options['partial']
  transaction.litleTxnId              = options['litleTxnId']
  transaction.amount                  = options['amount']
  transaction.surchargeAmount         = options['surchargeAmount']
  transaction.enhancedData            = EnhancedData.from_hash(options)
  transaction.processingInstructions  = ProcessingInstructions.from_hash(options)
  transaction.payPalOrderComplete     = options['payPalOrderComplete']
  transaction.payPalNotes             = options['payPalNotes']
  transaction.customBilling           = options['customBilling']

  (transaction, options)
  return transaction
end

#capture_given_auth(options) ⇒ Object



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/LitleTransaction.rb', line 312

def capture_given_auth(options)
  transaction = CaptureGivenAuth.new
  add_order_info(transaction, options)
  transaction.secondaryAmount    = options['secondaryAmount']
  transaction.surchargeAmount    = options['surchargeAmount']
  transaction.authInformation    = AuthInformation.from_hash(options)
  transaction.shipToAddress      = Contact.from_hash(options,'shipToAddress')
  transaction.customBilling      = CustomBilling.from_hash(options)
  transaction.billMeLaterRequest = BillMeLaterRequest.from_hash(options)
  transaction.debtRepayment	     = options['debtRepayment']
  transaction.processingType = options['processingType']
  transaction.originalNetworkTransactionId = options['originalNetworkTransactionId']
  transaction.originalTransactionAmount = options['originalTransactionAmount']
  return transaction
end

#create_plan(options) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/LitleTransaction.rb', line 132

def create_plan(options)
 transaction = CreatePlan.new
 transaction.planCode = options['planCode']
 transaction.name=options['name']
 transaction.description=options['description']
 transaction.intervalType=options['intervalType']
 transaction.amount=options['amount']
 transaction.numberOfPayments=options['numberOfPayments']
 transaction.trialNumberOfIntervals=options['trialNumberOfIntervals']
 transaction.trialIntervalType=options['trialIntervalType']
 transaction.active=options['active']
 return transaction 
end

#credit(options) ⇒ Object



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/LitleTransaction.rb', line 214

def credit(options)
  transaction = Credit.new
  transaction.litleTxnId              = options['litleTxnId']
  if(transaction.litleTxnId.nil?)
    transaction.orderId               = options['orderId']
    transaction.orderSource           = options['orderSource']
    transaction.taxType               = options['taxType']
    transaction.billToAddress         = Contact.from_hash(options,'billToAddress')
    transaction.amexAggregatorData    = AmexAggregatorData.from_hash(options)
    transaction.card                  = Card.from_hash(options)
    transaction.token                 = CardToken.from_hash(options,'token')
    transaction.paypage               = CardPaypage.from_hash(options,'paypage')
    transaction.mpos                  = Mpos.from_hash(options,'mpos') 
  end
  transaction.amount                  = options['amount']
  transaction.secondaryAmount         = options['secondaryAmount']
  transaction.surchargeAmount         = options['surchargeAmount']
  transaction.customBilling           = CustomBilling.from_hash(options)
  transaction.enhancedData            = EnhancedData.from_hash(options)
  transaction.processingInstructions  = ProcessingInstructions.from_hash(options)
  transaction.pos                     = Pos.from_hash(options)
  transaction.billMeLaterRequest      = BillMeLaterRequest.from_hash(options)
  transaction.payPalNotes             = options['payPalNotes']
  transaction.actionReason            = options['actionReason']
  transaction.paypal                  = CreditPayPal.from_hash(options,'paypal')
  
  (transaction, options)
  return transaction
end

#deactivate(options) ⇒ Object



66
67
68
69
70
71
72
# File 'lib/LitleTransaction.rb', line 66

def deactivate(options)
   transaction = Deactivate.new
   transaction.orderId = options['orderId']
   transaction.orderSource = options['orderSource']
   transaction.card = Card.from_hash(options,'card')
   return transaction
end

#deactivate_reversal(options) ⇒ Object



178
179
180
181
182
# File 'lib/LitleTransaction.rb', line 178

def deactivate_reversal(options)
  transaction = DeactivateReversal.new
  transaction.litleTxnId = options['litleTxnId']
  return transaction
end

#deposit_reversal(options) ⇒ Object



166
167
168
169
170
# File 'lib/LitleTransaction.rb', line 166

def deposit_reversal(options)
  transaction = DepositReversal.new
  transaction.litleTxnId = options['litleTxnId']
  return transaction
end

#echeck_credit(options) ⇒ Object



360
361
362
363
364
365
366
367
368
# File 'lib/LitleTransaction.rb', line 360

def echeck_credit(options)
  transaction = EcheckCredit.new
  transaction.customBilling = CustomBilling.from_hash(options)
  transaction.secondaryAmount = options['secondaryAmount']
  add_echeck_order_info(transaction, options)
  add_echeck(transaction, options)

  return transaction
end

#echeck_redeposit(options) ⇒ Object



338
339
340
341
342
343
344
345
346
# File 'lib/LitleTransaction.rb', line 338

def echeck_redeposit(options)
  transaction = EcheckRedeposit.new
  add_echeck(transaction, options)

  transaction.litleTxnId = options['litleTxnId']
  transaction.merchantData              = MerchantData.from_hash(options)

  return transaction
end

#echeck_sale(options) ⇒ Object



348
349
350
351
352
353
354
355
356
357
358
# File 'lib/LitleTransaction.rb', line 348

def echeck_sale(options)
  transaction = EcheckSale.new
  add_echeck(transaction, options)
  add_echeck_order_info(transaction, options)
  transaction.secondaryAmount = options['secondaryAmount']
  transaction.verify        = options['verify']
  transaction.shipToAddress = Contact.from_hash(options,'shipToAddress')
  transaction.customBilling = CustomBilling.from_hash(options)

  return transaction
end

#echeck_verification(options) ⇒ Object



370
371
372
373
374
375
376
377
378
# File 'lib/LitleTransaction.rb', line 370

def echeck_verification(options)
  transaction = EcheckVerification.new

  add_echeck_order_info(transaction, options)
  add_echeck(transaction, options)
  transaction.merchantData = MerchantData.from_hash(options)

  return transaction
end

#echeck_void(options) ⇒ Object



380
381
382
383
384
385
386
# File 'lib/LitleTransaction.rb', line 380

def echeck_void(options)
  transaction = EcheckVoid.new
  transaction.litleTxnId = options['litleTxnId']
  
  (transaction, options)
  return transaction
end

#force_capture(options) ⇒ Object



283
284
285
286
287
288
289
290
291
292
293
# File 'lib/LitleTransaction.rb', line 283

def force_capture(options)
  transaction = ForceCapture.new
  transaction.secondaryAmount = options['secondaryAmount']
  transaction.surchargeAmount    = options['surchargeAmount']
  transaction.customBilling      = CustomBilling.from_hash(options)
  transaction.debtRepayment	     = options['debtRepayment']
  transaction.processingType	     = options['processingType']
  add_order_info(transaction, options)

  return transaction
end

#load_request(options) ⇒ Object



74
75
76
77
78
79
80
81
# File 'lib/LitleTransaction.rb', line 74

def load_request(options)
   transaction = Load.new
   transaction.orderId = options['orderId']
   transaction.orderSource = options['orderSource']
   transaction.amount = options['amount']
   transaction.card = Card.from_hash(options,'card')
   return transaction
end

#load_reversal(options) ⇒ Object



184
185
186
187
188
# File 'lib/LitleTransaction.rb', line 184

def load_reversal(options)
  transaction = LoadReversal.new
  transaction.litleTxnId = options['litleTxnId']
  return transaction
end

#refund_reversal(options) ⇒ Object



172
173
174
175
176
# File 'lib/LitleTransaction.rb', line 172

def refund_reversal(options)
  transaction = RefundReversal.new
  transaction.litleTxnId = options['litleTxnId']
  return transaction
end

#register_token_request(options) ⇒ Object



257
258
259
260
261
262
263
264
265
266
267
# File 'lib/LitleTransaction.rb', line 257

def register_token_request(options)
  transaction = RegisterTokenRequest.new

  transaction.orderId               = options['orderId']
  transaction.accountNumber         = options['accountNumber']
  transaction.echeckForToken        = EcheckForToken.from_hash(options)
  transaction.paypageRegistrationId = options['paypageRegistrationId']
  transaction.applepay              = Applepay.from_hash(options,'applepay')
  (transaction, options)
  return transaction
end

#sale(options) ⇒ Object



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/LitleTransaction.rb', line 196

def sale(options)
  transaction = Sale.new
  add_transaction_info(transaction, options)
  transaction.secondaryAmount     = options['secondaryAmount']
  transaction.surchargeAmount     = options['surchargeAmount']
  transaction.fraudCheck          = FraudCheck.from_hash(options,'fraudCheck')
  transaction.payPalOrderComplete = options['payPalOrderComplete']
  transaction.payPalNotes         = options['payPalNotes']
  transaction.recurringRequest    = RecurringRequest.from_hash(options,'recurringRequest')
  transaction.litleInternalRecurringRequest = LitleInternalRecurringRequest.from_hash(options,'litleInternalRecurringRequest')
  transaction.debtRepayment	     = options['debtRepayment']
  transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options, 'advancedFraudChecks')
  transaction.processingType = options['processingType']
  transaction.originalNetworkTransactionId = options['originalNetworkTransactionId']
  transaction.originalTransactionAmount = options['originalTransactionAmount']
  return transaction
end

#unload_request(options) ⇒ Object



83
84
85
86
87
88
89
90
# File 'lib/LitleTransaction.rb', line 83

def unload_request(options)
   transaction = Unload.new
   transaction.orderId = options['orderId']
   transaction.orderSource = options['orderSource']
   transaction.amount = options['amount']
   transaction.card = Card.from_hash(options,'card')
   return transaction
end

#unload_reversal(options) ⇒ Object



190
191
192
193
194
# File 'lib/LitleTransaction.rb', line 190

def unload_reversal(options)
  transaction = UnloadReversal.new
  transaction.litleTxnId = options['litleTxnId']
  return transaction
end

#update_card_validation_num_on_token(options) ⇒ Object



269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/LitleTransaction.rb', line 269

def update_card_validation_num_on_token(options)
  transaction = UpdateCardValidationNumOnToken.new
  
  transaction.orderId               = options['orderId']
  transaction.litleToken            = options['litleToken']
  transaction.cardValidationNum     = options['cardValidationNum']
  
  SchemaValidation.validate_length(transaction.litleToken, true, 13, 25, "updateCardValidationNumOnToken", "litleToken")
  SchemaValidation.validate_length(transaction.cardValidationNum, true, 1, 4, "updateCardValidationNumOnToken", "cardValidationNum")
  
  (transaction, options)
  return transaction
end

#update_plan(options) ⇒ Object



146
147
148
149
150
151
# File 'lib/LitleTransaction.rb', line 146

def update_plan(options)
 transaction = UpdatePlan.new
 transaction.planCode = options['planCode']
 transaction.active=options['active']
 return transaction 
end

#update_subscription(options) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/LitleTransaction.rb', line 100

def update_subscription(options)
  transaction = UpdateSubscription.new
  transaction.subscriptionId = options['subscriptionId']
  transaction.planCode=options['planCode']
  transaction.billToAddress=Contact.from_hash(options,'billToAddress')
  transaction.card=Card.from_hash(options,'card')
  transaction.billingDate=options['billingDate']
  transaction.card                  = Card.from_hash(options)
  transaction.token                 = CardToken.from_hash(options,'token')
  transaction.paypage               = CardPaypage.from_hash(options,'paypage')
  if(options['createDiscount'])
      options['createDiscount'].each_index {| index | transaction.createDiscount << CreateDiscount.from_hash(options, index,'createDiscount')}
    end
  if(options['updateDiscount'])
      options['updateDiscount'].each_index {| index | transaction.updateDiscount << UpdateDiscount.from_hash(options, index,'updateDiscount')}
    end
  if(options['deleteDiscount'])
      options['deleteDiscount'].each_index {| index | transaction.deleteDiscount << DeleteDiscount.from_hash(options, index,'deleteDiscount')}
    end
  if(options['createAddOn'])
      options['createAddOn'].each_index {| index | transaction.createAddOn << CreateAddOn.from_hash(options, index,'createAddOn')}
    end
  if(options['updateAddOn'])
      options['updateAddOn'].each_index {| index | transaction.updateAddOn << UpdateAddOn.from_hash(options, index,'updateAddOn')}
    end
  if(options['deleteAddOn'])
      options['deleteAddOn'].each_index {| index | transaction.deleteAddOn << DeleteAddOn.from_hash(options, index,'deleteAddOn')}
    end 

  return transaction 
end

#virtual_giftcard(options) ⇒ Object



153
154
155
156
157
158
# File 'lib/LitleTransaction.rb', line 153

def virtual_giftcard(options)
 transaction = VirtualGiftCard.new     
 transaction.accountNumberLength = options['accountNumberLength']     
 transaction.giftCardBin = options['giftCardBin']
 return transaction
end

#void(options) ⇒ Object



328
329
330
331
332
333
334
335
336
# File 'lib/LitleTransaction.rb', line 328

def void(options)
  transaction = Void.new

  transaction.litleTxnId             = options['litleTxnId']
  transaction.processingInstructions = ProcessingInstructions.from_hash(options)
  
  (transaction, options)
  return transaction
end