LitleOnline 8.19.0 → 8.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +5 -13
  2. data/CHANGELOG +34 -0
  3. data/README.md +1 -1
  4. data/Rakefile +2 -2
  5. data/bin/Setup.rb +16 -6
  6. data/lib/LitleBatchRequest.rb +85 -2
  7. data/lib/LitleOnlineRequest.rb +108 -5
  8. data/lib/LitleRequest.rb +14 -9
  9. data/lib/LitleTransaction.rb +152 -3
  10. data/lib/XMLFields.rb +441 -7
  11. data/test/functional/test_activate.rb +100 -0
  12. data/test/functional/test_activateReversal.rb +56 -0
  13. data/test/functional/test_auth.rb +38 -1
  14. data/test/functional/test_balanceInquiry.rb +80 -0
  15. data/test/functional/test_batchStream.rb +145 -0
  16. data/test/functional/test_cancelSubscription.rb +55 -0
  17. data/test/functional/test_captureGivenAuth.rb +32 -2
  18. data/test/functional/test_createPlan.rb +85 -0
  19. data/test/functional/test_credit.rb +22 -1
  20. data/test/functional/test_deactivate.rb +80 -0
  21. data/test/functional/test_deactivateReversal.rb +56 -0
  22. data/test/functional/test_depositReversal.rb +56 -0
  23. data/test/functional/test_forceCapture.rb +23 -1
  24. data/test/functional/test_litle_requests.rb +3 -2
  25. data/test/functional/test_load.rb +82 -0
  26. data/test/functional/test_loadReversal.rb +56 -0
  27. data/test/functional/test_refundReversal.rb +56 -0
  28. data/test/functional/test_sale.rb +23 -1
  29. data/test/functional/test_unload.rb +82 -0
  30. data/test/functional/test_unloadReversal.rb +56 -0
  31. data/test/functional/test_updatePlan.rb +58 -0
  32. data/test/functional/test_updateSubscription.rb +76 -0
  33. data/test/functional/ts_all.rb +21 -2
  34. data/test/unit/test_LitleBatchRequest.rb +47 -2
  35. data/test/unit/test_LitleOnlineRequest.rb +2 -2
  36. data/test/unit/test_activate.rb +92 -0
  37. data/test/{functional/ts_all.rb~ → unit/test_activateReversal.rb} +17 -17
  38. data/test/unit/test_auth.rb +37 -3
  39. data/test/unit/test_balanceInquiry.rb +52 -0
  40. data/test/unit/test_cancelSubscription.rb +43 -0
  41. data/test/unit/test_captureGivenAuth.rb +44 -2
  42. data/test/unit/test_createPlan.rb +52 -0
  43. data/test/unit/test_credit.rb +3 -2
  44. data/test/unit/test_deactivate.rb +52 -0
  45. data/test/unit/test_deactivateReversal.rb +44 -0
  46. data/test/unit/test_depositReversal.rb +44 -0
  47. data/test/unit/test_load.rb +53 -0
  48. data/test/unit/test_loadReversal.rb +44 -0
  49. data/test/unit/test_refundReversal.rb +44 -0
  50. data/test/unit/test_sale.rb +18 -1
  51. data/test/unit/test_unload.rb +53 -0
  52. data/test/unit/test_unloadReversal.rb +44 -0
  53. data/test/unit/test_updatePlan.rb +45 -0
  54. data/test/unit/test_updateSubscription.rb +172 -0
  55. data/test/unit/test_xmlfields.rb +395 -0
  56. data/test/unit/ts_unit.rb +19 -2
  57. metadata +51 -34
  58. data/CHANGELOG~ +0 -81
  59. data/Rakefile~ +0 -93
  60. data/lib/LitleOnlineRequest.rb~ +0 -198
  61. data/lib/LitleRequest.rb~ +0 -513
  62. data/lib/LitleTransaction.rb~ +0 -297
  63. data/lib/XMLFields.rb~ +0 -1380
  64. data/test/unit/test_LitleOnlineRequest.rb~ +0 -296
  65. data/test/unit/test_sale.rb~ +0 -390
  66. data/test/unit/test_xmlfields.rb~ +0 -2515
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YzgyODYzYTg1ZTY0ODBiZDkyYzEzMDY5ZmFiZTlmYTVmNGVlMmE3Zg==
5
- data.tar.gz: !binary |-
6
- ZGVlZmQ4Yzc0ODkyYmM5NzZlMjhjOWJmY2RlN2I1ZjAyNzNlMjY1NQ==
2
+ SHA1:
3
+ metadata.gz: 6051b618f3a2ffae5d17fd39c31763e2a4a04a45
4
+ data.tar.gz: df8f9ee11c301b6491a53ae39560543d07a8f247
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- Yjk1MDI0ZjAyNDg3NWMxYzZkYWIwYTc5Zjc3NzNiNzBlMDFiYzczMTFiNGY0
10
- MjY4NTE3YWFlM2U3MDkwZWM5ZjEyZjUwMzcxMzIzNGRmMGQxZjcwNjBiMTMx
11
- MzY2Njk2ODJiYzBkY2JmYzgwZDRhZGJjM2VjZjMxYzE5NzczZWQ=
12
- data.tar.gz: !binary |-
13
- NjkwNmJhN2UwNzVkYTI4OGU3MGZmYzQ4MGE4ZDQyNjY5YzJmMjk3MjU0N2I4
14
- Y2MxZGFlZmRiYjAxOTVkN2M5ZWRmYmQwOTQyMjY5Y2Y3MzlkZmFkNDA3YzJi
15
- YzgyMTZhZGRkNTRmNDE2MDZhMjEzMDgyZmMyNzg1ZmNmMDM1NDg=
6
+ metadata.gz: cd7645612e27b4c0dca96f740f199bef582171e2ca38c7b4350273642f68f6d5b3f954e0974aa0c27c3eff5a00190a566a91f19eabc664e1160c55363568a4a1
7
+ data.tar.gz: 94a4f2bdb0912b3f58383f67e389735f6b233440597b3036e53943df76642a02b9b706596812cf8968c9cb5cd28bf10dce8d6b0eb1cc6a6eaf1c7bf1d821e248
data/CHANGELOG CHANGED
@@ -1,5 +1,39 @@
1
1
  = LitleOnline CHANGELOG
2
2
 
3
+ == version 8.25.0 (March 17, 2014)
4
+ * Feature: Added support for ROAM: Authorization, ForceCapture, CaptureGivenAuth, Sale, Credit
5
+
6
+ == version 8.24.0 (March 17, 2014)
7
+ * Feature: add triggered rules for advancedFraudCheckResult
8
+
9
+ == Version 8.23.0 (March 14, 2014)
10
+ * Feature: advancedFraudChecks now available in authorization and sale
11
+ * Feature: catLevel (Cardholder Activated Terminal) now available in pos
12
+ * Feature: advancedFraudResults now available in fraudResult
13
+
14
+ == Version 8.22.0 (March 14, 2014)
15
+ * Feature: Support for the following new gift card transactions:
16
+ ActivateReversal, DeactivateReversal, LoadReversal, RefundReversal,
17
+ UnloadReversal, DepositReversal
18
+ * Feature: UpdateSubscription now can take token or paypage updates, and
19
+ can return token in the response
20
+ * Feature: Support for virtualGiftCard in giftCard activations and can be returned in EnhancedAuthResponses
21
+ * Feature: Gift Card responses can be returned from AuthReversal
22
+
23
+ == Version 8.21.0 (March 13, 2014)
24
+ * Feature: Support for the following new recurring transactions:
25
+ CreatePlan, UpdatePlan
26
+ * Feature: Support for the following new gift card transactions:
27
+ Activate, Deactivate, Load, Unload, Balance Inquiry
28
+ * Feature: Gift card responses are now returned as part of
29
+ authorzationResponse, authReversalResponse, captureResponse,
30
+ forceCapture, captureGivenAuthResponse, saleResponse, creditResponse
31
+ * Feature: fraudResult is now returned as part of captureResponse,
32
+ forceCaptureResponse, captureGivenAuthResponse, creditResponse
33
+
34
+ == Version 8.20.0 (December 17, 2013)
35
+ * Feature: More initial support for Recurring, including the ability to update or cancel subscriptions
36
+
3
37
  == Version 8.19.0 (March 07, 2014)
4
38
  * Feature: Added deptRepayment as a choice for authorizations, forceCapture, captureGivenAuth, sale
5
39
  * Feature: More initial support for Recurring, including a backwards incompatible changing a field from numberOfPaymentsRemaining to numberOfPayments
data/README.md CHANGED
@@ -54,7 +54,7 @@ litleSaleTxn = {
54
54
  }
55
55
 
56
56
  # Peform the transaction on the Litle Platform
57
- response = LitleOnlineRequest.sale(litleSaleTxn)
57
+ response = LitleOnlineRequest.new.sale(litleSaleTxn)
58
58
 
59
59
  # display result
60
60
  puts "Message: "+ response.message
data/Rakefile CHANGED
@@ -30,11 +30,11 @@ require 'rake/clean'
30
30
  spec = Gem::Specification.new do |s|
31
31
  FileUtils.rm_rf('pkg')
32
32
  s.name = "LitleOnline"
33
- s.summary = "Ruby SDK produced by Litle & Co. for transaction processing using Litle XML format v8.19"
33
+ s.summary = "Ruby SDK produced by Litle & Co. for transaction processing using Litle XML format v8.25"
34
34
  s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
35
35
  s.requirements =
36
36
  [ 'Contact sdksupport@litle.com for more information' ]
37
- s.version = "8.19.0"
37
+ s.version = "8.25.0"
38
38
  s.author = "Litle & Co"
39
39
  s.email = "sdksupport@litle.com"
40
40
  s.homepage = "http://www.litle.com/developers"
data/bin/Setup.rb CHANGED
@@ -46,7 +46,7 @@ class Setup
46
46
  f.puts " DEFAULT: " + gets
47
47
  f.puts "default_report_group: 'Default Report Group'"
48
48
 
49
- puts "Please choose Litle url from the following list (example: 'cert') or directly input another URL: \nsandbox => https://www.testlitle.com/sandbox/communicator/online \ncert => https://cert.litle.com/vap/communicator/online \nprecert => https://precert.litle.com/vap/communicator/online \nproduction1 => https://payments.litle.com/vap/communicator/online \nproduction2 => https://payments2.litle.com/vap/communicator/online"
49
+ puts "Please choose Litle url from the following list (example: 'prelive') or directly input another URL: \nsandbox => https://www.testlitle.com/sandbox/communicator/online \nprelive => https://prelive.litle.com/vap/communicator/online \npostlive => https://postlive.litle.com/vap/communicator/online \nproduction => https://payments.litle.com/vap/communicator/online \ntransact_prelive => https://transact-prelive.litle.com/vap/communicator/online \ntransact_postlive => https://transact-postlive.litle.com/vap/communicator/online \ntransact_production => https://transact.litle.com/vap/communicator/online \ntransact_betacert => https://transact-betacert.litle.com/vap/communicator/online \nbetacert => https://betacert.litle.com/vap/communicator/online"
50
50
  f.puts "url: " + Setup.choice(gets)
51
51
  puts "Please input the proxy address, if no proxy hit enter key: "
52
52
  f.puts "proxy_addr: " + gets
@@ -77,12 +77,22 @@ class Setup
77
77
  litle_online_ctx = 'vap/communicator/online'
78
78
  if litle_env == "sandbox\n"
79
79
  return 'https://www.testlitle.com/sandbox/communicator/online'
80
- elsif litle_env == "cert\n"
81
- return 'https://cert.litle.com/' + litle_online_ctx
82
- elsif litle_env == "precert\n"
83
- return 'https://precert.litle.com/' + litle_online_ctx
84
- elsif litle_env == "production1\n"
80
+ elsif litle_env == "prelive\n"
81
+ return 'https://prelive.litle.com/' + litle_online_ctx
82
+ elsif litle_env == "postlive\n"
83
+ return 'https://postlive.litle.com/' + litle_online_ctx
84
+ elsif litle_env == "betacert\n"
85
+ return 'https://betacert.litle.com/' + litle_online_ctx
86
+ elsif litle_env == "production\n"
85
87
  return 'https://payments.litle.com/' + litle_online_ctx
88
+ elsif litle_env == "transact_production\n"
89
+ return 'https://transact.litle.com/' + litle_online_ctx
90
+ elsif litle_env == "transact_prelive\n"
91
+ return 'https://transact-prelive.litle.com/' + litle_online_ctx
92
+ elsif litle_env == "transact_postlive\n"
93
+ return 'https://transact-postlive.litle.com/' + litle_online_ctx
94
+ elsif litle_env == "transact_betacert\n"
95
+ return 'https://transact-betacert.litle.com/' + litle_online_ctx
86
96
  else
87
97
  return 'https://www.testlitle.com/sandbox/communicator/online'
88
98
  end
@@ -53,7 +53,17 @@ module LitleOnline
53
53
  :echeckSale=>{ :numEcheckSales=>0, :echeckSalesAmount=>0 },
54
54
  :numUpdateCardValidationNumOnTokens=>0,
55
55
  :numAccountUpdates=>0,
56
- :total=>0
56
+ :total=>0,
57
+ :numCancelSubscriptions=>0,
58
+ :numUpdateSubscriptions=>0,
59
+ :numCreatePlans=>0,
60
+ :numUpdatePlans=>0,
61
+ :activate=>{:numActivates=>0, :activateAmount=>0},
62
+ :numDeactivates=>0,
63
+ :load=>{:numLoads=>0, :loadAmount=>0},
64
+ :unload=>{:numUnloads=>0, :unloadAmount=>0},
65
+ :numBalanceInquirys=>0,
66
+ :merchantSdk=>nil
57
67
  }
58
68
  @litle_txn = LitleTransaction.new
59
69
  @path_to_batch = nil
@@ -166,7 +176,69 @@ module LitleOnline
166
176
 
167
177
  add_txn_to_batch(transaction, :authReversal, options)
168
178
  end
179
+
180
+ def cancel_subscription(options)
181
+ transaction = @litle_txn.cancel_subscription(options)
182
+ @txn_counts[:numCancelSubscriptions] += 1
183
+
184
+ add_txn_to_batch(transaction, :cancelSubscription, options)
185
+ end
186
+
187
+ def update_subscription(options)
188
+ transaction = @litle_txn.update_subscription(options)
189
+ @txn_counts[:numUpdateSubscriptions] += 1
190
+
191
+ add_txn_to_batch(transaction, :updateSubscription, options)
192
+ end
193
+
194
+ def create_plan(options)
195
+ transaction = @litle_txn.create_plan(options)
196
+ @txn_counts[:numCreatePlans] += 1
197
+
198
+ add_txn_to_batch(transaction, :createPlan, options)
199
+ end
169
200
 
201
+ def update_plan(options)
202
+ transaction = @litle_txn.update_plan(options)
203
+ @txn_counts[:numUpdatePlans] += 1
204
+
205
+ add_txn_to_batch(transaction, :updatePlan, options)
206
+ end
207
+
208
+ def activate(options)
209
+ transaction = @litle_txn.activate(options)
210
+ @txn_counts[:numActivates] += 1
211
+
212
+ add_txn_to_batch(transaction, :activate, options)
213
+ end
214
+
215
+ def deactivate(options)
216
+ transaction = @litle_txn.deactivate(options)
217
+ @txn_counts[:numDeactivates] += 1
218
+
219
+ add_txn_to_batch(transaction, :deactivate, options)
220
+ end
221
+
222
+ def load_request(options)
223
+ transaction = @litle_txn.load_request(options)
224
+ @txn_counts[:numLoads] += 1
225
+
226
+ add_txn_to_batch(transaction, :load, options)
227
+ end
228
+
229
+ def unload_request(options)
230
+ transaction = @litle_txn.unload_request(options)
231
+ @txn_counts[:numunLoads] += 1
232
+
233
+ add_txn_to_batch(transaction, :unload, options)
234
+ end
235
+
236
+ def balance_inquiry(options)
237
+ transaction = @litle_txn.balance_inquiry(options)
238
+ @txn_counts[:numBalanceInquirys] += 1
239
+
240
+ add_txn_to_batch(transaction, :balanceInquirys, options)
241
+ end
170
242
  def register_token_request(options)
171
243
  transaction = @litle_txn.register_token_request(options)
172
244
  @txn_counts[:numTokenRegistrations] += 1
@@ -303,7 +375,18 @@ module LitleOnline
303
375
  request.merchantId = get_merchant_id(options)
304
376
  request.id = @txn_counts[:id]
305
377
  request.numUpdateCardValidationNumOnTokens = @txn_counts[:numUpdateCardValidationNumOnTokens]
306
-
378
+ request.numCancelSubscriptions =@txn_counts[:numCancelSubscriptions]
379
+ request.numUpdateSubscriptions =@txn_counts[:numUpdateSubscriptions]
380
+ request.numCreatePlans =@txn_counts[:numCreatePlans]
381
+ request.numUpdatePlans =@txn_counts[:numUpdatePlans]
382
+ request.numActivates =@txn_counts[:activate][:numActivates]
383
+ request.numDeactivates =@txn_counts[:numDeactivates]
384
+ request.activateAmount =@txn_counts[:activate][:activateAmount]
385
+ request.numLoads =@txn_counts[:load][:numLoads]
386
+ request.loadAmount =@txn_counts[:load][:loadAmount]
387
+ request.numUnloads =@txn_counts[:unload][:numLoads]
388
+ request.unloadAmount =@txn_counts[:unload][:unloadAmount]
389
+ request.numBalanceInquirys =@txn_counts[:numBalanceInquirys]
307
390
  header = request.save_to_xml.to_s
308
391
  header['/>']= '>'
309
392
 
@@ -36,6 +36,103 @@ module LitleOnline
36
36
  @litle_transaction = LitleTransaction.new
37
37
  end
38
38
 
39
+ def virtual_giftcard(options)
40
+ transaction =@litle_transaction.virtual_giftcard(options)
41
+
42
+ commit(transaction, :virtualGiftCard, options)
43
+ end
44
+
45
+ def create_plan(options)
46
+ transaction =@litle_transaction.create_plan(options)
47
+
48
+ commit(transaction, :createPlan, options)
49
+ end
50
+
51
+ def update_plan(options)
52
+ transaction =@litle_transaction.update_plan(options)
53
+
54
+ commit(transaction, :updatePlan, options)
55
+ end
56
+
57
+ def cancel_subscription(options)
58
+ transaction =@litle_transaction.cancel_subscription(options)
59
+
60
+ commit(transaction, :cancelSubscription, options)
61
+ end
62
+
63
+ def update_subscription(options)
64
+ transaction =@litle_transaction.update_subscription(options)
65
+
66
+ commit(transaction, :updateSubscription, options)
67
+ end
68
+
69
+ def activate(options)
70
+ transaction = @litle_transaction.activate(options)
71
+
72
+ commit(transaction, :activate, options)
73
+ end
74
+
75
+ def deactivate(options)
76
+ transaction = @litle_transaction.deactivate(options)
77
+
78
+ commit(transaction, :deactivate, options)
79
+ end
80
+
81
+ def load_request(options)
82
+ transaction = @litle_transaction.load_request(options)
83
+
84
+ commit(transaction, :load, options)
85
+ end
86
+
87
+ def unload_request(options)
88
+ transaction = @litle_transaction.unload_request(options)
89
+
90
+ commit(transaction, :unload, options)
91
+ end
92
+
93
+ def balance_inquiry(options)
94
+ transaction = @litle_transaction.balance_inquiry(options)
95
+
96
+ commit(transaction, :balanceInquiry, options)
97
+ end
98
+
99
+ def activate_reversal(options)
100
+ transaction = @litle_transaction.activate_reversal(options)
101
+
102
+ commit(transaction, :activateReversal, options)
103
+ end
104
+
105
+ def deposit_reversal(options)
106
+ transaction = @litle_transaction.deposit_reversal(options)
107
+
108
+ commit(transaction, :depositReversal, options)
109
+ end
110
+
111
+ def refund_reversal(options)
112
+ transaction = @litle_transaction.refund_reversal(options)
113
+
114
+ commit(transaction, :refundReversal, options)
115
+ end
116
+
117
+ def deactivate_reversal(options)
118
+ transaction = @litle_transaction.deactivate_reversal(options)
119
+
120
+ commit(transaction, :deactivateReversal, options)
121
+ end
122
+
123
+ def load_reversal(options)
124
+ transaction = @litle_transaction.load_reversal(options)
125
+
126
+ commit(transaction, :loadReversal, options)
127
+ end
128
+
129
+ def unload_reversal(options)
130
+ transaction = @litle_transaction.unload_reversal(options)
131
+
132
+ commit(transaction, :unloadReversal, options)
133
+ end
134
+
135
+
39
136
  def authorization(options)
40
137
  transaction = @litle_transaction.authorization(options)
41
138
 
@@ -135,9 +232,15 @@ module LitleOnline
135
232
  private
136
233
 
137
234
  def add_account_info(transaction, options)
138
- transaction.reportGroup = get_report_group(options)
139
- transaction.transactionId = options['id']
140
- transaction.customerId = options['customerId']
235
+ if(transaction.respond_to?(:reportGroup))
236
+ transaction.reportGroup = get_report_group(options)
237
+ end
238
+ if(transaction.respond_to?(:transactionId))
239
+ transaction.transactionId = options['id']
240
+ end
241
+ if(transaction.respond_to?(:customerId))
242
+ transaction.customerId = options['customerId']
243
+ end
141
244
  end
142
245
 
143
246
  def build_request(options)
@@ -149,7 +252,7 @@ module LitleOnline
149
252
 
150
253
  request.authentication = authentication
151
254
  request.merchantId = get_merchant_id(options)
152
- request.version = '8.19'
255
+ request.version = '8.25'
153
256
  request.loggedInUser = get_logged_in_user(options)
154
257
  request.xmlns = "http://www.litle.com/schema"
155
258
  request.merchantSdk = get_merchant_sdk(options)
@@ -180,7 +283,7 @@ module LitleOnline
180
283
  end
181
284
 
182
285
  def get_merchant_sdk(options)
183
- options['merchantSdk'] || 'Ruby;8.19.0'
286
+ options['merchantSdk'] || 'Ruby;8.25.0'
184
287
  end
185
288
 
186
289
  def get_report_group(options)
data/lib/LitleRequest.rb CHANGED
@@ -168,9 +168,9 @@ module LitleOnline
168
168
  def add_rfr_request(options, path = (File.dirname(@path_to_batches)))
169
169
 
170
170
  rfrrequest = LitleRFRRequest.new
171
- if(options['litleSessionId'] != nil) then
171
+ if(options['litleSessionId']) then
172
172
  rfrrequest.litleSessionId = options['litleSessionId']
173
- elsif(options['merchantId'] != nil and options['postDay'] != nil) then
173
+ elsif(options['merchantId'] and options['postDay']) then
174
174
  accountUpdate = AccountUpdateFileRequestData.new
175
175
  accountUpdate.merchantId = options['merchantId']
176
176
  accountUpdate.postDay = options['postDay']
@@ -190,7 +190,7 @@ module LitleOnline
190
190
  litleRequest.authentication = authentication
191
191
  litleRequest.numBatchRequests = "0"
192
192
 
193
- litleRequest.version = '8.19'
193
+ litleRequest.version = '8.25'
194
194
  litleRequest.xmlns = "http://www.litle.com/schema"
195
195
 
196
196
 
@@ -296,19 +296,24 @@ module LitleOnline
296
296
  Dir.foreach(path) do |filename|
297
297
  if((filename =~ /request_\d+.complete\z/) != nil) then
298
298
  begin
299
- socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
300
- sockaddr = Socket.pack_sockaddr_in( port.to_i, url )
301
- socket.connect( sockaddr )
299
+ socket = TCPSocket.open(url,port.to_i)
300
+ ssl_context = OpenSSL::SSL::SSLContext.new()
301
+ ssl_context.ssl_version = :SSLv23
302
+ ssl_socket = OpenSSL::SSL::SSLSocket.new(socket, ssl_context)
303
+ ssl_socket.sync_close = true
304
+ ssl_socket.connect
302
305
  rescue => e
303
306
  raise "A connection couldn't be established. Are you sure you have the correct credentials? Exception: " + e.message
304
307
  end
305
308
 
306
309
  File.foreach(path + filename) do |li|
307
- socket.write(li)
310
+ ssl_socket.puts li
308
311
  end
309
312
  File.rename(path + filename, path + filename + '.sent')
310
313
  File.open(path + 'responses/' + (filename + '.asc.received').gsub("request", "response"), 'a+') do |fo|
311
- fo.puts(socket.read)
314
+ while line = ssl_socket.gets
315
+ fo.puts(line)
316
+ end
312
317
  end
313
318
 
314
319
  end
@@ -490,7 +495,7 @@ module LitleOnline
490
495
  authentication.password = get_config(:password, options)
491
496
 
492
497
  litle_request.authentication = authentication
493
- litle_request.version = '8.19'
498
+ litle_request.version = '8.25'
494
499
  litle_request.xmlns = "http://www.litle.com/schema"
495
500
  # litle_request.id = options['sessionId'] #grab from options; okay if nil
496
501
  litle_request.numBatchRequests = @num_batch_requests
@@ -37,11 +37,158 @@ module LitleOnline
37
37
  transaction.surchargeAmount = options['surchargeAmount']
38
38
  transaction.recurringRequest = RecurringRequest.from_hash(options,'recurringRequest')
39
39
  transaction.debtRepayment = options['debtRepayment']
40
+ transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options, 'advancedFraudChecks')
40
41
  add_transaction_info(transaction, options)
41
42
 
42
43
  return transaction
43
44
  end
44
-
45
+
46
+ def cancel_subscription(options)
47
+ transaction = CancelSubscription.new
48
+ transaction.subscriptionId = options['subscriptionId']
49
+ return transaction
50
+ end
51
+
52
+ def activate(options)
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
61
+
62
+ def deactivate(options)
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
68
+ end
69
+
70
+ def load_request(options)
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
77
+ end
78
+
79
+ def unload_request(options)
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
86
+ end
87
+
88
+ def balance_inquiry(options)
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
94
+ end
95
+
96
+ def update_subscription(options)
97
+ transaction = UpdateSubscription.new
98
+ transaction.subscriptionId = options['subscriptionId']
99
+ transaction.planCode=options['planCode']
100
+ transaction.billToAddress=Contact.from_hash(options,'billToAddress')
101
+ transaction.card=Card.from_hash(options,'card')
102
+ transaction.billingDate=options['billingDate']
103
+ transaction.card = Card.from_hash(options)
104
+ transaction.token = CardToken.from_hash(options,'token')
105
+ transaction.paypage = CardPaypage.from_hash(options,'paypage')
106
+ if(options['createDiscount'])
107
+ options['createDiscount'].each_index {| index | transaction.createDiscount << CreateDiscount.from_hash(options, index,'createDiscount')}
108
+ end
109
+ if(options['updateDiscount'])
110
+ options['updateDiscount'].each_index {| index | transaction.updateDiscount << UpdateDiscount.from_hash(options, index,'updateDiscount')}
111
+ end
112
+ if(options['deleteDiscount'])
113
+ options['deleteDiscount'].each_index {| index | transaction.deleteDiscount << DeleteDiscount.from_hash(options, index,'deleteDiscount')}
114
+ end
115
+ if(options['createAddOn'])
116
+ options['createAddOn'].each_index {| index | transaction.createAddOn << CreateAddOn.from_hash(options, index,'createAddOn')}
117
+ end
118
+ if(options['updateAddOn'])
119
+ options['updateAddOn'].each_index {| index | transaction.updateAddOn << UpdateAddOn.from_hash(options, index,'updateAddOn')}
120
+ end
121
+ if(options['deleteAddOn'])
122
+ options['deleteAddOn'].each_index {| index | transaction.deleteAddOn << DeleteAddOn.from_hash(options, index,'deleteAddOn')}
123
+ end
124
+
125
+ return transaction
126
+ end
127
+
128
+ def create_plan(options)
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
140
+ end
141
+
142
+ def update_plan(options)
143
+ transaction = UpdatePlan.new
144
+ transaction.planCode = options['planCode']
145
+ transaction.active=options['active']
146
+ return transaction
147
+ end
148
+
149
+ def virtual_giftcard(options)
150
+ transaction = VirtualGiftCard.new
151
+ transaction.accountNumberLength = options['accountNumberLength']
152
+ transaction.giftCardBin = options['giftCardBin']
153
+ return transaction
154
+ end
155
+
156
+ def activate_reversal(options)
157
+ transaction = ActivateReversal.new
158
+ transaction.litleTxnId = options['litleTxnId']
159
+ return transaction
160
+ end
161
+
162
+ def deposit_reversal(options)
163
+ transaction = DepositReversal.new
164
+ transaction.litleTxnId = options['litleTxnId']
165
+ return transaction
166
+ end
167
+
168
+ def refund_reversal(options)
169
+ transaction = RefundReversal.new
170
+ transaction.litleTxnId = options['litleTxnId']
171
+ return transaction
172
+ end
173
+
174
+ def deactivate_reversal(options)
175
+ transaction = DeactivateReversal.new
176
+ transaction.litleTxnId = options['litleTxnId']
177
+ return transaction
178
+ end
179
+
180
+ def load_reversal(options)
181
+ transaction = LoadReversal.new
182
+ transaction.litleTxnId = options['litleTxnId']
183
+ return transaction
184
+ end
185
+
186
+ def unload_reversal(options)
187
+ transaction = UnloadReversal.new
188
+ transaction.litleTxnId = options['litleTxnId']
189
+ return transaction
190
+ end
191
+
45
192
  def sale(options)
46
193
  transaction = Sale.new
47
194
  add_transaction_info(transaction, options)
@@ -53,6 +200,7 @@ module LitleOnline
53
200
  transaction.recurringRequest = RecurringRequest.from_hash(options,'recurringRequest')
54
201
  transaction.litleInternalRecurringRequest = LitleInternalRecurringRequest.from_hash(options,'litleInternalRecurringRequest')
55
202
  transaction.debtRepayment = options['debtRepayment']
203
+ transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options, 'advancedFraudChecks')
56
204
  return transaction
57
205
  end
58
206
 
@@ -68,6 +216,7 @@ module LitleOnline
68
216
  transaction.card = Card.from_hash(options)
69
217
  transaction.token = CardToken.from_hash(options,'token')
70
218
  transaction.paypage = CardPaypage.from_hash(options,'paypage')
219
+ transaction.mpos = Mpos.from_hash(options,'mpos')
71
220
  end
72
221
  transaction.amount = options['amount']
73
222
  transaction.surchargeAmount = options['surchargeAmount']
@@ -79,7 +228,7 @@ module LitleOnline
79
228
  transaction.payPalNotes = options['payPalNotes']
80
229
  transaction.actionReason = options['actionReason']
81
230
  transaction.paypal = CreditPayPal.from_hash(options,'paypal')
82
-
231
+
83
232
  add_account_info(transaction, options)
84
233
  return transaction
85
234
  end
@@ -272,7 +421,7 @@ module LitleOnline
272
421
  transaction.card = Card.from_hash(options)
273
422
  transaction.token = CardToken.from_hash(options,'token')
274
423
  transaction.paypage = CardPaypage.from_hash(options,'paypage')
275
-
424
+ transaction.mpos = Mpos.from_hash(options,'mpos')
276
425
  add_account_info(transaction, options)
277
426
  end
278
427