CnpOnline 11.4.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -164
  3. data/CHANGELOG~ +0 -0
  4. data/CONTRIBUTORS +0 -2
  5. data/DESCRIPTION +1 -1
  6. data/LICENSE +0 -0
  7. data/README.md +13 -15
  8. data/Rakefile +3 -2
  9. data/Rakefile~ +4 -3
  10. data/SETUP.md +13 -10
  11. data/bin/Setup.rb +26 -22
  12. data/bin/sample_batch_driver.rb +15 -15
  13. data/bin/sample_driver.rb +5 -5
  14. data/lib/{LitleBatchRequest.rb → CnpBatchRequest.rb} +68 -66
  15. data/lib/{LitleListeners.rb → CnpListeners.rb} +48 -40
  16. data/lib/{LitleOnline.rb → CnpOnline.rb} +8 -7
  17. data/lib/{LitleOnlineRequest.rb → CnpOnlineRequest.rb} +53 -53
  18. data/lib/{LitleRequest.rb → CnpRequest.rb} +186 -192
  19. data/lib/{LitleTransaction.rb → CnpTransaction.rb} +53 -52
  20. data/lib/{LitleXmlMapper.rb → CnpXmlMapper.rb} +7 -7
  21. data/lib/Communications.rb +8 -7
  22. data/lib/Configuration.rb +7 -6
  23. data/lib/EnvironmentVariables.rb +2 -2
  24. data/lib/XMLFields.rb +98 -108
  25. data/lib/cacert.pem +0 -0
  26. data/samples/Auth/CnpAuthReversalTransaction.rb +15 -0
  27. data/samples/Auth/{LitleAuthorizationTransaction.rb → CnpAuthorizationTransaction.rb} +4 -4
  28. data/samples/Auth/{LitlePaymentFullLifeCycle.rb → CnpPaymentFullLifeCycle.rb} +11 -11
  29. data/samples/Batch/AccountUpdate.rb +11 -11
  30. data/samples/Batch/SampleBatchDriver.rb +16 -16
  31. data/samples/Capture/{LitleCaptureGivenAuthTransaction.rb → CnpCaptureGivenAuthTransaction.rb} +4 -4
  32. data/samples/Capture/CnpCaptureTransaction.rb +14 -0
  33. data/samples/Capture/{LitleForceCaptureTransaction.rb → CnpForceCaptureTransaction.rb} +5 -5
  34. data/samples/Capture/CnpPartialCapture.rb +16 -0
  35. data/samples/Credit/CnpCreditTransaction.rb +16 -0
  36. data/samples/Credit/{LitleRefundTransaction.rb → CnpRefundTransaction.rb} +4 -4
  37. data/samples/Other/{LitleAvsTransaction.rb → CnpAvsTransaction.rb} +4 -4
  38. data/samples/Other/CnpVoidTransaction.rb +19 -0
  39. data/samples/Paypage/FullPaypageLifeCycle.rb +16 -16
  40. data/samples/Run_all.rb +12 -12
  41. data/samples/Sale/{LitleSaleTransaction.rb → CnpSaleTransaction.rb} +4 -4
  42. data/samples/Sale/SampleSaleTransaction.rb +5 -5
  43. data/test/certification/certTest1_base.rb +104 -103
  44. data/test/certification/certTest2_authenhanced.rb +90 -88
  45. data/test/certification/certTest3_authreversal.rb +29 -28
  46. data/test/certification/certTest4_echeck.rb +22 -20
  47. data/test/certification/certTest5_token.rb +51 -49
  48. data/test/certification/certTest_batchAll.rb +60 -60
  49. data/test/certification/ts_all.rb +1 -1
  50. data/test/functional/test_activate.rb +9 -8
  51. data/test/functional/test_activateReversal.rb +5 -5
  52. data/test/functional/test_auth.rb +31 -30
  53. data/test/functional/test_authReversal.rb +8 -8
  54. data/test/functional/test_balanceInquiry.rb +6 -6
  55. data/test/functional/test_batch.rb +32 -32
  56. data/test/functional/test_batchStream.rb +14 -14
  57. data/test/functional/test_cancelSubscription.rb +4 -4
  58. data/test/functional/test_capture.rb +14 -14
  59. data/test/functional/test_captureGivenAuth.rb +16 -16
  60. data/test/functional/test_configuration.rb +26 -26
  61. data/test/functional/test_createPlan.rb +5 -5
  62. data/test/functional/test_credit.rb +13 -33
  63. data/test/functional/test_deactivate.rb +6 -6
  64. data/test/functional/test_deactivateReversal.rb +5 -5
  65. data/test/functional/test_depositReversal.rb +5 -5
  66. data/test/functional/test_echeckCredit.rb +20 -20
  67. data/test/functional/test_echeckRedeposit.rb +16 -16
  68. data/test/functional/test_echeckSale.rb +35 -35
  69. data/test/functional/test_echeckVerification.rb +17 -17
  70. data/test/functional/test_echeckVoid.rb +4 -4
  71. data/test/functional/test_forceCapture.rb +21 -21
  72. data/test/functional/test_fraudCheck.rb +6 -5
  73. data/test/functional/test_giftCardAuthReversal.rb +5 -5
  74. data/test/functional/test_giftCardCapture.rb +5 -5
  75. data/test/functional/test_giftCardCredit.rb +5 -5
  76. data/test/functional/test_litle_requests.rb +101 -99
  77. data/test/functional/test_load.rb +6 -6
  78. data/test/functional/test_loadReversal.rb +5 -5
  79. data/test/functional/test_override.rb +9 -9
  80. data/test/functional/{test_pgp_litle_requests.rb → test_pgp_cnp_requests.rb} +61 -60
  81. data/test/functional/test_queryTransaction.rb +10 -10
  82. data/test/functional/test_refundReversal.rb +5 -5
  83. data/test/functional/test_sale.rb +36 -36
  84. data/test/functional/test_token.rb +10 -10
  85. data/test/functional/test_unload.rb +6 -6
  86. data/test/functional/test_unloadReversal.rb +5 -5
  87. data/test/functional/test_updateCardValidationNumOnToken.rb +4 -4
  88. data/test/functional/test_updatePlan.rb +4 -4
  89. data/test/functional/test_updateSubscription.rb +5 -5
  90. data/test/functional/test_wallet.rb +5 -5
  91. data/test/functional/test_xmlfields.rb +29 -69
  92. data/test/functional/ts_all.rb +2 -2
  93. data/test/unit/test_LitleAUBatch.rb +15 -15
  94. data/test/unit/test_LitleBatchRequest.rb +42 -76
  95. data/test/unit/test_LitleOnlineRequest.rb +38 -38
  96. data/test/unit/test_LitleRequest.rb +47 -47
  97. data/test/unit/test_LitleTransaction.rb +34 -34
  98. data/test/unit/test_LitleXmlMapper.rb +27 -27
  99. data/test/unit/test_activate.rb +8 -8
  100. data/test/unit/test_activateReversal.rb +5 -5
  101. data/test/unit/test_auth.rb +43 -43
  102. data/test/unit/test_authReversal.rb +14 -14
  103. data/test/unit/test_balanceInquiry.rb +4 -4
  104. data/test/unit/test_cancelSubscription.rb +4 -4
  105. data/test/unit/test_capture.rb +20 -20
  106. data/test/unit/test_captureGivenAuth.rb +22 -22
  107. data/test/unit/test_createPlan.rb +4 -4
  108. data/test/unit/test_credit.rb +43 -43
  109. data/test/unit/test_deactivate.rb +6 -6
  110. data/test/unit/test_deactivateReversal.rb +5 -5
  111. data/test/unit/test_depositReversal.rb +5 -5
  112. data/test/unit/test_echeckCredit.rb +16 -16
  113. data/test/unit/test_echeckRedeposit.rb +19 -19
  114. data/test/unit/test_echeckSale.rb +16 -16
  115. data/test/unit/test_echeckVerification.rb +11 -11
  116. data/test/unit/test_echeckVoid.rb +8 -8
  117. data/test/unit/test_forceCapture.rb +19 -19
  118. data/test/unit/test_fraudCheck.rb +4 -4
  119. data/test/unit/test_giftCardAuthReversal.rb +5 -5
  120. data/test/unit/test_giftCardCapture.rb +5 -5
  121. data/test/unit/test_giftCardCredit.rb +5 -5
  122. data/test/unit/test_load.rb +4 -4
  123. data/test/unit/test_loadReversal.rb +5 -5
  124. data/test/unit/{test_pgp_LitleRequest → test_pgp_CnpRequest.rb} +32 -32
  125. data/test/unit/test_queryTransaction.rb +8 -8
  126. data/test/unit/test_refundReversal.rb +5 -5
  127. data/test/unit/test_sale.rb +64 -64
  128. data/test/unit/test_token.rb +13 -13
  129. data/test/unit/test_unload.rb +4 -4
  130. data/test/unit/test_unloadReversal.rb +5 -5
  131. data/test/unit/test_updateCardValidationNumOnToken.rb +16 -16
  132. data/test/unit/test_updatePlan.rb +4 -4
  133. data/test/unit/test_updateSubscription.rb +11 -11
  134. data/test/unit/test_wallet.rb +13 -13
  135. data/test/unit/test_xmlfields.rb +119 -119
  136. data/test/unit/ts_unit.rb +6 -6
  137. metadata +35 -26
  138. data/samples/Auth/LitleAuthReversalTransaction.rb +0 -15
  139. data/samples/Capture/LitleCaptureTransaction.rb +0 -14
  140. data/samples/Capture/LitlePartialCapture.rb +0 -16
  141. data/samples/Credit/LitleCreditTransaction.rb +0 -16
  142. data/samples/Other/LitleVoidTransaction.rb +0 -19
@@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
25
25
  =end
26
26
 
27
27
  #Sample Driver
28
- require_relative '../lib/LitleOnline'
28
+ require_relative '../lib/CnpOnline'
29
29
 
30
30
  saleHash = {
31
31
  'reportGroup'=>'Planets',
@@ -57,14 +57,14 @@ rfrHash = {
57
57
 
58
58
  path = Dir.pwd
59
59
 
60
- request = LitleOnline::LitleRequest.new({'sessionId'=>'8675309'})
60
+ request = CnpOnline::CnpRequest.new({'sessionId'=>'8675309'})
61
61
 
62
- request.create_new_litle_request(path)
63
- puts "Created new LitleRequest at location: " + path
62
+ request.create_new_cnp_request(path)
63
+ puts "Created new CnpRequest at location: " + path
64
64
  start = Time::now
65
65
  #create five batches, each with 10 sales
66
66
  #5.times{
67
- batch = LitleOnline::LitleBatchRequest.new
67
+ batch = CnpOnline::CnpBatchRequest.new
68
68
  batch.create_new_batch(path)
69
69
 
70
70
  #add the same sale ten times
@@ -75,7 +75,7 @@ start = Time::now
75
75
 
76
76
  #close the batch, indicating we plan to add no more transactions
77
77
  batch.close_batch()
78
- #add the batch to the LitleRequest
78
+ #add the batch to the CnpRequest
79
79
  request.commit_batch(batch)
80
80
  #}
81
81
 
@@ -83,28 +83,28 @@ request.add_rfr_request(rfrHash)
83
83
 
84
84
 
85
85
 
86
- # puts "Finished adding batches to LitleRequest at " + request.get_path_to_batches
87
- #finish the Litle Request, indicating we plan to add no more batches
86
+ # puts "Finished adding batches to CnpRequest at " + request.get_path_to_batches
87
+ #finish the Cnp Request, indicating we plan to add no more batches
88
88
  request.finish_request
89
- puts "Generated final XML markup of the LitleRequest"
89
+ puts "Generated final XML markup of the CnpRequest"
90
90
 
91
91
  #send the batch files at the given directory over sFTP
92
- request.send_to_litle
93
- puts "Dropped off the XML of the LitleRequest over FTP"
92
+ request.send_to_cnp
93
+ puts "Dropped off the XML of the CnpRequest over FTP"
94
94
  #grab the expected number of responses from the sFTP server and save them to the given path
95
95
  request.get_responses_from_server()
96
- puts "Received the LitleRequest responses from the server"
96
+ puts "Received the CnpRequest responses from the server"
97
97
  #process the responses from the server with a listener which applies the given block
98
98
  start = Time::now
99
- request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
99
+ request.process_responses({:transaction_listener => CnpOnline::DefaultCnpListener.new do |transaction|
100
100
  type = transaction["type"]
101
- #if we're dealing with a saleResponse (check the Litle XML Reference Guide!)
101
+ #if we're dealing with a saleResponse (check the Cnp XML Reference Guide!)
102
102
  if(type == "saleResponse") then
103
103
  #grab an attribute of the parent of the response
104
104
  puts "Report Group: " + transaction["reportGroup"]
105
105
 
106
106
  #grab some child elements of the transaction
107
- puts "Litle Txn Id: " + transaction["litleTxnId"]
107
+ puts "Cnp Txn Id: " + transaction["cnpTxnId"]
108
108
  puts "Order Id: " + transaction["orderId"]
109
109
  puts "Response: " + transaction["response"]
110
110
 
@@ -26,9 +26,9 @@ OTHER DEALINGS IN THE SOFTWARE.
26
26
  =end
27
27
 
28
28
  #Sample Driver
29
- #require 'LitleOnline'
30
- #include LitleOnline
31
- require_relative '../lib/LitleOnline'
29
+ #require 'CnpOnline'
30
+ #include CnpOnline
31
+ require_relative '../lib/CnpOnline'
32
32
  hash = {
33
33
  'reportGroup'=>'product1',
34
34
  'orderId'=>'12344',
@@ -42,8 +42,8 @@ hash = {
42
42
  }
43
43
 
44
44
  #perform credit transaction
45
- response= LitleOnline::LitleOnlineRequest.new.credit(hash)
45
+ response= CnpOnline::CnpOnlineRequest.new.credit(hash)
46
46
 
47
47
  #display results
48
48
  puts "Message: "+response.message
49
- puts "Litle Transaction ID: "+response.creditResponse.litleTxnId
49
+ puts "Cnp Transaction ID: "+response.creditResponse.cnpTxnId
@@ -22,12 +22,12 @@ OTHER DEALINGS IN THE SOFTWARE.
22
22
  require_relative 'Configuration'
23
23
 
24
24
  #
25
- # This class creates a new batch to which Litle XML transactions are added.
25
+ # This class creates a new batch to which Cnp XML transactions are added.
26
26
  # The batch is stored in the local file system until it is ready to be sent
27
- # to Litle.
27
+ # to Cnp.
28
28
  #
29
- module LitleOnline
30
- class LitleBatchRequest
29
+ module CnpOnline
30
+ class CnpBatchRequest
31
31
  include XML::Mapping
32
32
  def initialize ()
33
33
  #load configuration data
@@ -42,12 +42,14 @@ module LitleOnline
42
42
  :captureGivenAuth=>{ :numCaptureGivenAuths=>0, :captureGivenAuthAmount=>0 },
43
43
  :forceCapture=>{ :numForceCaptures=>0, :forceCaptureAmount=>0 },
44
44
  :authReversal=>{ :numAuthReversals=>0, :authReversalAmount=>0 },
45
+ #12.1
45
46
  :fastAccessFunding=>{ :numFastAccessFunding=>0, :fastAccessFundingAmount=>0 },
46
- #11.0 begin
47
+ #12.1
48
+ #12.0 begin
47
49
  :giftCardAuthReversal=>{ :numGiftCardAuthReversals=>0, :giftCardAuthReversalOriginalAmount=>0 },
48
50
  #end
49
51
  :capture=>{ :numCaptures=>0, :captureAmount=>0 },
50
- #11.0 begin
52
+ #12.0 begin
51
53
  :giftCardCapture=>{ :numGiftCardCaptures=>0, :giftCardCaptureAmount=>0 },
52
54
  :giftCardCredit=>{ :numGiftCardCredits=>0, :giftCardCreditAmount=>0 },
53
55
  #end
@@ -83,7 +85,7 @@ module LitleOnline
83
85
  #SDK XML 10
84
86
  :numFundingInstructionVoid=>0
85
87
  }
86
- @litle_txn = LitleTransaction.new
88
+ @cnp_txn = CnpTransaction.new
87
89
  @path_to_batch = nil
88
90
  @txn_file = nil
89
91
  @MAX_TXNS_IN_BATCH = 100000
@@ -144,7 +146,7 @@ module LitleOnline
144
146
  temp_counts = File.open(@path_to_batch, "rb") { |f| Marshal.load(f) }
145
147
  # woops, they opened an AU batch
146
148
  if(temp_counts[:numAccountUpdates] != 0) then
147
- au_batch = LitleAUBatch.new
149
+ au_batch = CnpAUBatch.new
148
150
  au_batch.open_existing_batch(pathToBatchFile)
149
151
  initialize()
150
152
  create_new_batch(File.dirname(pathToBatchFile))
@@ -180,7 +182,7 @@ module LitleOnline
180
182
  end
181
183
 
182
184
  def authorization(options)
183
- transaction = @litle_txn.authorization(options)
185
+ transaction = @cnp_txn.authorization(options)
184
186
  @txn_counts[:auth][:numAuths] += 1
185
187
  @txn_counts[:auth][:authAmount] += options['amount'].to_i
186
188
 
@@ -188,7 +190,7 @@ module LitleOnline
188
190
  end
189
191
 
190
192
  def sale(options)
191
- transaction = @litle_txn.sale(options)
193
+ transaction = @cnp_txn.sale(options)
192
194
  @txn_counts[:sale][:numSales] += 1
193
195
  @txn_counts[:sale][:saleAmount] += options['amount'].to_i
194
196
 
@@ -196,7 +198,7 @@ module LitleOnline
196
198
  end
197
199
 
198
200
  def credit(options)
199
- transaction = @litle_txn.credit(options)
201
+ transaction = @cnp_txn.credit(options)
200
202
  @txn_counts[:credit][:numCredits] += 1
201
203
  @txn_counts[:credit][:creditAmount] += options['amount'].to_i
202
204
 
@@ -204,113 +206,121 @@ module LitleOnline
204
206
  end
205
207
 
206
208
  def auth_reversal(options)
207
- transaction = @litle_txn.auth_reversal(options)
209
+ transaction = @cnp_txn.auth_reversal(options)
208
210
  @txn_counts[:authReversal][:numAuthReversals] += 1
209
211
  @txn_counts[:authReversal][:authReversalAmount] += options['amount'].to_i
210
212
 
211
213
  add_txn_to_batch(transaction, :authReversal, options)
212
214
  end
213
215
 
216
+ def fast_access_funding(options)
217
+ transaction = @cnp_txn.fast_access_funding(options)
218
+ @txn_counts[:fastAccessFunding][:numFastAccessFunding] += 1
219
+ @txn_counts[:fastAccessFunding][:fastAccessFundingAmount] += options['amount'].to_i
220
+
221
+ add_txn_to_batch(transaction, :fastAccessFunding, options)
222
+ end
223
+
214
224
  def gift_card_auth_reversal(options)
215
- transaction = @litle_txn.gift_card_auth_reversal(options)
225
+ transaction = @cnp_txn.gift_card_auth_reversal(options)
216
226
  @txn_counts[:giftCardAuthReversal][:numGiftCardAuthReversals] += 1
217
227
  @txn_counts[:giftCardAuthReversal][:giftCardAuthReversalOriginalAmount] += options['amount'].to_i
218
228
  add_txn_to_batch(transaction, :giftCardAuthReversal, options)
219
229
  end
220
230
 
221
231
  def gift_card_capture(options)
222
- transaction = @litle_txn.gift_card_capture(options)
232
+ transaction = @cnp_txn.gift_card_capture(options)
223
233
  @txn_counts[:giftCardCapture][:numGiftCardCaptures] += 1
224
234
  @txn_counts[:giftCardCapture][:giftCardCaptureAmount] += options['amount'].to_i
225
235
  add_txn_to_batch(transaction, :giftCardCapture, options)
226
236
  end
227
237
 
228
238
  def gift_card_credit(options)
229
- transaction = @litle_txn.gift_card_credit(options)
239
+ transaction = @cnp_txn.gift_card_credit(options)
230
240
  @txn_counts[:giftCardCredit][:numGiftCardCredits] += 1
231
241
  @txn_counts[:giftCardCredit][:giftCardCreditAmount] += options['amount'].to_i
232
242
  add_txn_to_batch(transaction, :giftCardCredit, options)
233
243
  end
234
244
 
235
245
  def cancel_subscription(options)
236
- transaction = @litle_txn.cancel_subscription(options)
246
+ transaction = @cnp_txn.cancel_subscription(options)
237
247
  @txn_counts[:numCancelSubscriptions] += 1
238
248
 
239
249
  add_txn_to_batch(transaction, :cancelSubscription, options)
240
250
  end
241
251
 
242
252
  def update_subscription(options)
243
- transaction = @litle_txn.update_subscription(options)
253
+ transaction = @cnp_txn.update_subscription(options)
244
254
  @txn_counts[:numUpdateSubscriptions] += 1
245
255
 
246
256
  add_txn_to_batch(transaction, :updateSubscription, options)
247
257
  end
248
258
 
249
259
  def create_plan(options)
250
- transaction = @litle_txn.create_plan(options)
260
+ transaction = @cnp_txn.create_plan(options)
251
261
  @txn_counts[:numCreatePlans] += 1
252
262
 
253
263
  add_txn_to_batch(transaction, :createPlan, options)
254
264
  end
255
265
 
256
266
  def update_plan(options)
257
- transaction = @litle_txn.update_plan(options)
267
+ transaction = @cnp_txn.update_plan(options)
258
268
  @txn_counts[:numUpdatePlans] += 1
259
269
 
260
270
  add_txn_to_batch(transaction, :updatePlan, options)
261
271
  end
262
272
 
263
273
  def activate(options)
264
- transaction = @litle_txn.activate(options)
274
+ transaction = @cnp_txn.activate(options)
265
275
  @txn_counts[:numActivates] += 1
266
276
 
267
277
  add_txn_to_batch(transaction, :activate, options)
268
278
  end
269
279
 
270
280
  def deactivate(options)
271
- transaction = @litle_txn.deactivate(options)
281
+ transaction = @cnp_txn.deactivate(options)
272
282
  @txn_counts[:numDeactivates] += 1
273
283
 
274
284
  add_txn_to_batch(transaction, :deactivate, options)
275
285
  end
276
286
 
277
287
  def load_request(options)
278
- transaction = @litle_txn.load_request(options)
288
+ transaction = @cnp_txn.load_request(options)
279
289
  @txn_counts[:numLoads] += 1
280
290
 
281
291
  add_txn_to_batch(transaction, :load, options)
282
292
  end
283
293
 
284
294
  def unload_request(options)
285
- transaction = @litle_txn.unload_request(options)
295
+ transaction = @cnp_txn.unload_request(options)
286
296
  @txn_counts[:numunLoads] += 1
287
297
 
288
298
  add_txn_to_batch(transaction, :unload, options)
289
299
  end
290
300
 
291
301
  def balance_inquiry(options)
292
- transaction = @litle_txn.balance_inquiry(options)
302
+ transaction = @cnp_txn.balance_inquiry(options)
293
303
  @txn_counts[:numBalanceInquirys] += 1
294
304
 
295
305
  add_txn_to_batch(transaction, :balanceInquirys, options)
296
306
  end
297
307
 
298
308
  def register_token_request(options)
299
- transaction = @litle_txn.register_token_request(options)
309
+ transaction = @cnp_txn.register_token_request(options)
300
310
  @txn_counts[:numTokenRegistrations] += 1
301
311
 
302
312
  add_txn_to_batch(transaction, :numTokenRegistrations, options)
303
313
  end
304
314
 
305
315
  def update_card_validation_num_on_token(options)
306
- transaction = @litle_txn.update_card_validation_num_on_token(options)
316
+ transaction = @cnp_txn.update_card_validation_num_on_token(options)
307
317
  @txn_counts[:numUpdateCardValidationNumOnTokens] += 1
308
318
 
309
319
  add_txn_to_batch(transaction, :numUpdateCardValidationNumOnTokens, options)
310
320
  end
311
321
 
312
322
  def force_capture(options)
313
- transaction = @litle_txn.force_capture(options)
323
+ transaction = @cnp_txn.force_capture(options)
314
324
  @txn_counts[:forceCapture][:numForceCaptures] += 1
315
325
  @txn_counts[:forceCapture][:forceCaptureAmount] += options['amount'].to_i
316
326
 
@@ -318,7 +328,7 @@ module LitleOnline
318
328
  end
319
329
 
320
330
  def capture(options)
321
- transaction = @litle_txn.capture(options)
331
+ transaction = @cnp_txn.capture(options)
322
332
  @txn_counts[:capture][:numCaptures] += 1
323
333
  @txn_counts[:capture][:captureAmount] += options['amount'].to_i
324
334
 
@@ -326,7 +336,7 @@ module LitleOnline
326
336
  end
327
337
 
328
338
  def capture_given_auth(options)
329
- transaction = @litle_txn.capture_given_auth(options)
339
+ transaction = @cnp_txn.capture_given_auth(options)
330
340
  @txn_counts[:captureGivenAuth][:numCaptureGivenAuths] += 1
331
341
  @txn_counts[:captureGivenAuth][:captureGivenAuthAmount] += options['amount'].to_i
332
342
 
@@ -334,7 +344,7 @@ module LitleOnline
334
344
  end
335
345
 
336
346
  def echeck_verification(options)
337
- transaction = @litle_txn.echeck_verification(options)
347
+ transaction = @cnp_txn.echeck_verification(options)
338
348
  @txn_counts[:echeckVerification][:numEcheckVerification] += 1
339
349
  @txn_counts[:echeckVerification][:echeckVerificationAmount] += options['amount'].to_i
340
350
 
@@ -342,7 +352,7 @@ module LitleOnline
342
352
  end
343
353
 
344
354
  def echeck_credit(options)
345
- transaction = @litle_txn.echeck_credit(options)
355
+ transaction = @cnp_txn.echeck_credit(options)
346
356
  @txn_counts[:echeckCredit][:numEcheckCredit] += 1
347
357
  @txn_counts[:echeckCredit][:echeckCreditAmount] += options['amount'].to_i
348
358
 
@@ -350,28 +360,28 @@ module LitleOnline
350
360
  end
351
361
 
352
362
  def echeck_redeposit(options)
353
- transaction = @litle_txn.echeck_redeposit(options)
363
+ transaction = @cnp_txn.echeck_redeposit(options)
354
364
  @txn_counts[:numEcheckRedeposit] += 1
355
365
 
356
366
  add_txn_to_batch(transaction, :echeckRedeposit, options)
357
367
  end
358
368
 
359
369
  def echeck_pre_note_sale(options)
360
- transaction = @litle_txn.echeck_pre_note_sale(options)
370
+ transaction = @cnp_txn.echeck_pre_note_sale(options)
361
371
  @txn_counts[:numEcheckPreNoteSale] += 1
362
372
 
363
373
  add_txn_to_batch(transaction, :echeckPreNoteSale, options)
364
374
  end
365
375
 
366
376
  def echeck_pre_note_credit(options)
367
- transaction = @litle_txn.echeck_pre_note_credit(options)
377
+ transaction = @cnp_txn.echeck_pre_note_credit(options)
368
378
  @txn_counts[:numEcheckPreNoteCredit] += 1
369
379
 
370
380
  add_txn_to_batch(transaction, :echeckPreNoteCredit, options)
371
381
  end
372
382
 
373
383
  def payFac_credit(options)
374
- transaction = @litle_txn.payFac_credit(options)
384
+ transaction = @cnp_txn.payFac_credit(options)
375
385
  @txn_counts[:payFacCredit][:numPayFacCredit] += 1
376
386
  @txn_counts[:payFacCredit][:payFacCreditAmount] += options['amount'].to_i
377
387
 
@@ -379,7 +389,7 @@ module LitleOnline
379
389
  end
380
390
 
381
391
  def submerchant_credit(options)
382
- transaction = @litle_txn.submerchant_credit(options)
392
+ transaction = @cnp_txn.submerchant_credit(options)
383
393
  @txn_counts[:submerchantCredit][:numSubmerchantCredit] += 1
384
394
  @txn_counts[:submerchantCredit][:submerchantCreditAmount] += options['amount'].to_i
385
395
 
@@ -387,7 +397,7 @@ module LitleOnline
387
397
  end
388
398
 
389
399
  def reserve_credit(options)
390
- transaction = @litle_txn.reserve_credit(options)
400
+ transaction = @cnp_txn.reserve_credit(options)
391
401
  @txn_counts[:reserveCredit][:numReserveCredit] += 1
392
402
  @txn_counts[:reserveCredit][:reserveCreditAmount] += options['amount'].to_i
393
403
 
@@ -395,7 +405,7 @@ module LitleOnline
395
405
  end
396
406
 
397
407
  def vendor_credit(options)
398
- transaction = @litle_txn.vendor_credit(options)
408
+ transaction = @cnp_txn.vendor_credit(options)
399
409
  @txn_counts[:vendorCredit][:numVendorCredit] += 1
400
410
  @txn_counts[:vendorCredit][:vendorCreditAmount] += options['amount'].to_i
401
411
 
@@ -403,7 +413,7 @@ module LitleOnline
403
413
  end
404
414
 
405
415
  def physical_check_credit(options)
406
- transaction = @litle_txn.physical_check_credit(options)
416
+ transaction = @cnp_txn.physical_check_credit(options)
407
417
  @txn_counts[:physicalCheckCredit][:numPhysicalCheckCredit] += 1
408
418
  @txn_counts[:physicalCheckCredit][:physicalCheckCreditAmount] += options['amount'].to_i
409
419
 
@@ -417,14 +427,14 @@ module LitleOnline
417
427
  # Desc: Change proposed as a part of SDK XML 10 to incorporate the feature of voiding transactions
418
428
  # on request.
419
429
  def funding_txn_void(options)
420
- transaction = @litle_txn.funding_txn_void(options)
430
+ transaction = @cnp_txn.funding_txn_void(options)
421
431
  @txn_counts[:numFundingInstructionVoid] += 1
422
432
 
423
433
  add_txn_to_batch(transaction, :fundingInstructionVoid, options)
424
434
  end
425
435
 
426
436
  def payFac_debit(options)
427
- transaction = @litle_txn.payFac_debit(options)
437
+ transaction = @cnp_txn.payFac_debit(options)
428
438
  @txn_counts[:payFacDebit][:numPayFacDebit] += 1
429
439
  @txn_counts[:payFacDebit][:payFacDebitAmount] += options['amount'].to_i
430
440
 
@@ -432,7 +442,7 @@ module LitleOnline
432
442
  end
433
443
 
434
444
  def submerchant_debit(options)
435
- transaction = @litle_txn.submerchant_debit(options)
445
+ transaction = @cnp_txn.submerchant_debit(options)
436
446
  @txn_counts[:submerchantDebit][:numSubmerchantDebit] += 1
437
447
  @txn_counts[:submerchantDebit][:submerchantDebitAmount] += options['amount'].to_i
438
448
 
@@ -440,7 +450,7 @@ module LitleOnline
440
450
  end
441
451
 
442
452
  def reserve_debit(options)
443
- transaction = @litle_txn.reserve_debit(options)
453
+ transaction = @cnp_txn.reserve_debit(options)
444
454
  @txn_counts[:reserveDebit][:numReserveDebit] += 1
445
455
  @txn_counts[:reserveDebit][:reserveDebitAmount] += options['amount'].to_i
446
456
 
@@ -448,7 +458,7 @@ module LitleOnline
448
458
  end
449
459
 
450
460
  def vendor_debit(options)
451
- transaction = @litle_txn.vendor_debit(options)
461
+ transaction = @cnp_txn.vendor_debit(options)
452
462
  @txn_counts[:vendorDebit][:numVendorDebit] += 1
453
463
  @txn_counts[:vendorDebit][:vendorDebitAmount] += options['amount'].to_i
454
464
 
@@ -456,7 +466,7 @@ module LitleOnline
456
466
  end
457
467
 
458
468
  def physical_check_debit(options)
459
- transaction = @litle_txn.physical_check_debit(options)
469
+ transaction = @cnp_txn.physical_check_debit(options)
460
470
  @txn_counts[:physicalCheckDebit][:numPhysicalCheckDebit] += 1
461
471
  @txn_counts[:physicalCheckDebit][:physicalCheckDebitAmount] += options['amount'].to_i
462
472
 
@@ -464,25 +474,17 @@ module LitleOnline
464
474
  end
465
475
 
466
476
  def echeck_sale(options)
467
- transaction = @litle_txn.echeck_sale(options)
477
+ transaction = @cnp_txn.echeck_sale(options)
468
478
  @txn_counts[:echeckSale][:numEcheckSales] += 1
469
479
  @txn_counts[:echeckSale][:echeckSalesAmount] += options['amount'].to_i
470
480
 
471
481
  add_txn_to_batch(transaction, :echeckSale, options)
472
482
  end
473
483
 
474
- def fast_access_funding(options)
475
- transaction = @litle_txn.fast_access_funding(options)
476
- @txn_counts[:fastAccessFunding][:numFastAccessFunding] += 1
477
- @txn_counts[:fastAccessFunding][:fastAccessFundingAmount] += options['amount'].to_i
478
-
479
- add_txn_to_batch(transaction, :fastAccessFunding, options)
480
- end
481
-
482
484
  def account_update(options)
483
485
 
484
486
  if(@au_batch == nil) then
485
- @au_batch = LitleAUBatch.new
487
+ @au_batch = CnpAUBatch.new
486
488
  @au_batch.create_new_batch(File.dirname(@path_to_batch))
487
489
  end
488
490
  @au_batch.account_update(options)
@@ -534,22 +536,22 @@ module LitleOnline
534
536
  request.forceCaptureAmount = @txn_counts[:forceCapture][:forceCaptureAmount]
535
537
  request.numAuthReversals = @txn_counts[:authReversal][:numAuthReversals]
536
538
  request.authReversalAmount = @txn_counts[:authReversal][:authReversalAmount]
537
- #11.4 begin
538
- # request.numFastAccessFunding = @txn_counts[:fastAccessFunding][:numFastAccessFunding]
539
- # request.fastAccessFundingAmount = @txn_counts[:fastAccessFunding][:fastAccessFundingAmount]
540
- # 11.4 end
541
- # 11.0 begin
539
+ # 12.1 begin
540
+ request.numFastAccessFunding = @txn_counts[:fastAccessFunding][:numFastAccessFunding]
541
+ request.fastAccessFundingAmount = @txn_counts[:fastAccessFunding][:fastAccessFundingAmount]
542
+ # end
543
+ # 12.0 begin
542
544
  request.numGiftCardAuthReversals = @txn_counts[:giftCardAuthReversal][:numGiftCardAuthReversals]
543
545
  request.giftCardAuthReversalOriginalAmount = @txn_counts[:giftCardAuthReversal][:giftCardAuthReversalOriginalAmount]
544
- # 11.0 end
546
+ # 12.0 end
545
547
  request.numCaptures = @txn_counts[:capture][:numCaptures]
546
548
  request.captureAmount = @txn_counts[:capture][:captureAmount]
547
- # 11.0 begin
549
+ # 12.0 begin
548
550
  request.numGiftCardCaptures = @txn_counts[:giftCardCapture][:numGiftCardCaptures]
549
551
  request.giftCardCaptureAmount = @txn_counts[:giftCardCapture][:giftCardCaptureAmount]
550
552
  request.numGiftCardCredits = @txn_counts[:giftCardCredit][:numGiftCardCredits]
551
553
  request.giftCardCreditAmount = @txn_counts[:giftCardCredit][:giftCardCreditAmount]
552
- # 11.0 end
554
+ # 12.0 end
553
555
  request.numEcheckSales = @txn_counts[:echeckSale][:numEcheckSales]
554
556
  request.echeckSalesAmount = @txn_counts[:echeckSale][:echeckSalesAmount]
555
557
  request.numEcheckRedeposit = @txn_counts[:numEcheckRedeposit]
@@ -619,7 +621,7 @@ module LitleOnline
619
621
 
620
622
  # IF YOU ARE A MERCHANT, DON'T LOOK HERE. IT'S SCARY!
621
623
 
622
- class LitleAUBatch
624
+ class CnpAUBatch
623
625
  include XML::Mapping
624
626
  def initialize
625
627
  #load configuration data
@@ -630,7 +632,7 @@ module LitleOnline
630
632
  :numAccountUpdates=>0,
631
633
  :total=>0
632
634
  }
633
- @litle_txn = LitleTransaction.new
635
+ @cnp_txn = CnpTransaction.new
634
636
  @path_to_batch = nil
635
637
  @txn_file = nil
636
638
  @MAX_TXNS_IN_BATCH = 100000
@@ -707,7 +709,7 @@ module LitleOnline
707
709
  end
708
710
 
709
711
  def account_update(options)
710
- transaction = @litle_txn.account_update(options)
712
+ transaction = @cnp_txn.account_update(options)
711
713
  @txn_counts[:numAccountUpdates] += 1
712
714
 
713
715
  add_txn_to_batch(transaction, :authorization, options)