CnpOnline 11.4.0 → 12.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -164
- data/CHANGELOG~ +0 -0
- data/CONTRIBUTORS +0 -2
- data/DESCRIPTION +1 -1
- data/LICENSE +0 -0
- data/README.md +13 -15
- data/Rakefile +3 -2
- data/Rakefile~ +4 -3
- data/SETUP.md +13 -10
- data/bin/Setup.rb +26 -22
- data/bin/sample_batch_driver.rb +15 -15
- data/bin/sample_driver.rb +5 -5
- data/lib/{LitleBatchRequest.rb → CnpBatchRequest.rb} +68 -66
- data/lib/{LitleListeners.rb → CnpListeners.rb} +48 -40
- data/lib/{LitleOnline.rb → CnpOnline.rb} +8 -7
- data/lib/{LitleOnlineRequest.rb → CnpOnlineRequest.rb} +53 -53
- data/lib/{LitleRequest.rb → CnpRequest.rb} +186 -192
- data/lib/{LitleTransaction.rb → CnpTransaction.rb} +53 -52
- data/lib/{LitleXmlMapper.rb → CnpXmlMapper.rb} +7 -7
- data/lib/Communications.rb +8 -7
- data/lib/Configuration.rb +7 -6
- data/lib/EnvironmentVariables.rb +2 -2
- data/lib/XMLFields.rb +98 -108
- data/lib/cacert.pem +0 -0
- data/samples/Auth/CnpAuthReversalTransaction.rb +15 -0
- data/samples/Auth/{LitleAuthorizationTransaction.rb → CnpAuthorizationTransaction.rb} +4 -4
- data/samples/Auth/{LitlePaymentFullLifeCycle.rb → CnpPaymentFullLifeCycle.rb} +11 -11
- data/samples/Batch/AccountUpdate.rb +11 -11
- data/samples/Batch/SampleBatchDriver.rb +16 -16
- data/samples/Capture/{LitleCaptureGivenAuthTransaction.rb → CnpCaptureGivenAuthTransaction.rb} +4 -4
- data/samples/Capture/CnpCaptureTransaction.rb +14 -0
- data/samples/Capture/{LitleForceCaptureTransaction.rb → CnpForceCaptureTransaction.rb} +5 -5
- data/samples/Capture/CnpPartialCapture.rb +16 -0
- data/samples/Credit/CnpCreditTransaction.rb +16 -0
- data/samples/Credit/{LitleRefundTransaction.rb → CnpRefundTransaction.rb} +4 -4
- data/samples/Other/{LitleAvsTransaction.rb → CnpAvsTransaction.rb} +4 -4
- data/samples/Other/CnpVoidTransaction.rb +19 -0
- data/samples/Paypage/FullPaypageLifeCycle.rb +16 -16
- data/samples/Run_all.rb +12 -12
- data/samples/Sale/{LitleSaleTransaction.rb → CnpSaleTransaction.rb} +4 -4
- data/samples/Sale/SampleSaleTransaction.rb +5 -5
- data/test/certification/certTest1_base.rb +104 -103
- data/test/certification/certTest2_authenhanced.rb +90 -88
- data/test/certification/certTest3_authreversal.rb +29 -28
- data/test/certification/certTest4_echeck.rb +22 -20
- data/test/certification/certTest5_token.rb +51 -49
- data/test/certification/certTest_batchAll.rb +60 -60
- data/test/certification/ts_all.rb +1 -1
- data/test/functional/test_activate.rb +9 -8
- data/test/functional/test_activateReversal.rb +5 -5
- data/test/functional/test_auth.rb +31 -30
- data/test/functional/test_authReversal.rb +8 -8
- data/test/functional/test_balanceInquiry.rb +6 -6
- data/test/functional/test_batch.rb +32 -32
- data/test/functional/test_batchStream.rb +14 -14
- data/test/functional/test_cancelSubscription.rb +4 -4
- data/test/functional/test_capture.rb +14 -14
- data/test/functional/test_captureGivenAuth.rb +16 -16
- data/test/functional/test_configuration.rb +26 -26
- data/test/functional/test_createPlan.rb +5 -5
- data/test/functional/test_credit.rb +13 -33
- data/test/functional/test_deactivate.rb +6 -6
- data/test/functional/test_deactivateReversal.rb +5 -5
- data/test/functional/test_depositReversal.rb +5 -5
- data/test/functional/test_echeckCredit.rb +20 -20
- data/test/functional/test_echeckRedeposit.rb +16 -16
- data/test/functional/test_echeckSale.rb +35 -35
- data/test/functional/test_echeckVerification.rb +17 -17
- data/test/functional/test_echeckVoid.rb +4 -4
- data/test/functional/test_forceCapture.rb +21 -21
- data/test/functional/test_fraudCheck.rb +6 -5
- data/test/functional/test_giftCardAuthReversal.rb +5 -5
- data/test/functional/test_giftCardCapture.rb +5 -5
- data/test/functional/test_giftCardCredit.rb +5 -5
- data/test/functional/test_litle_requests.rb +101 -99
- data/test/functional/test_load.rb +6 -6
- data/test/functional/test_loadReversal.rb +5 -5
- data/test/functional/test_override.rb +9 -9
- data/test/functional/{test_pgp_litle_requests.rb → test_pgp_cnp_requests.rb} +61 -60
- data/test/functional/test_queryTransaction.rb +10 -10
- data/test/functional/test_refundReversal.rb +5 -5
- data/test/functional/test_sale.rb +36 -36
- data/test/functional/test_token.rb +10 -10
- data/test/functional/test_unload.rb +6 -6
- data/test/functional/test_unloadReversal.rb +5 -5
- data/test/functional/test_updateCardValidationNumOnToken.rb +4 -4
- data/test/functional/test_updatePlan.rb +4 -4
- data/test/functional/test_updateSubscription.rb +5 -5
- data/test/functional/test_wallet.rb +5 -5
- data/test/functional/test_xmlfields.rb +29 -69
- data/test/functional/ts_all.rb +2 -2
- data/test/unit/test_LitleAUBatch.rb +15 -15
- data/test/unit/test_LitleBatchRequest.rb +42 -76
- data/test/unit/test_LitleOnlineRequest.rb +38 -38
- data/test/unit/test_LitleRequest.rb +47 -47
- data/test/unit/test_LitleTransaction.rb +34 -34
- data/test/unit/test_LitleXmlMapper.rb +27 -27
- data/test/unit/test_activate.rb +8 -8
- data/test/unit/test_activateReversal.rb +5 -5
- data/test/unit/test_auth.rb +43 -43
- data/test/unit/test_authReversal.rb +14 -14
- data/test/unit/test_balanceInquiry.rb +4 -4
- data/test/unit/test_cancelSubscription.rb +4 -4
- data/test/unit/test_capture.rb +20 -20
- data/test/unit/test_captureGivenAuth.rb +22 -22
- data/test/unit/test_createPlan.rb +4 -4
- data/test/unit/test_credit.rb +43 -43
- data/test/unit/test_deactivate.rb +6 -6
- data/test/unit/test_deactivateReversal.rb +5 -5
- data/test/unit/test_depositReversal.rb +5 -5
- data/test/unit/test_echeckCredit.rb +16 -16
- data/test/unit/test_echeckRedeposit.rb +19 -19
- data/test/unit/test_echeckSale.rb +16 -16
- data/test/unit/test_echeckVerification.rb +11 -11
- data/test/unit/test_echeckVoid.rb +8 -8
- data/test/unit/test_forceCapture.rb +19 -19
- data/test/unit/test_fraudCheck.rb +4 -4
- data/test/unit/test_giftCardAuthReversal.rb +5 -5
- data/test/unit/test_giftCardCapture.rb +5 -5
- data/test/unit/test_giftCardCredit.rb +5 -5
- data/test/unit/test_load.rb +4 -4
- data/test/unit/test_loadReversal.rb +5 -5
- data/test/unit/{test_pgp_LitleRequest → test_pgp_CnpRequest.rb} +32 -32
- data/test/unit/test_queryTransaction.rb +8 -8
- data/test/unit/test_refundReversal.rb +5 -5
- data/test/unit/test_sale.rb +64 -64
- data/test/unit/test_token.rb +13 -13
- data/test/unit/test_unload.rb +4 -4
- data/test/unit/test_unloadReversal.rb +5 -5
- data/test/unit/test_updateCardValidationNumOnToken.rb +16 -16
- data/test/unit/test_updatePlan.rb +4 -4
- data/test/unit/test_updateSubscription.rb +11 -11
- data/test/unit/test_wallet.rb +13 -13
- data/test/unit/test_xmlfields.rb +119 -119
- data/test/unit/ts_unit.rb +6 -6
- metadata +35 -26
- data/samples/Auth/LitleAuthReversalTransaction.rb +0 -15
- data/samples/Capture/LitleCaptureTransaction.rb +0 -14
- data/samples/Capture/LitlePartialCapture.rb +0 -16
- data/samples/Credit/LitleCreditTransaction.rb +0 -16
- data/samples/Other/LitleVoidTransaction.rb +0 -19
@@ -22,12 +22,34 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
require_relative 'Configuration'
|
23
23
|
|
24
24
|
#
|
25
|
-
# This class does all the heavy lifting of mapping the Ruby hash into
|
25
|
+
# This class does all the heavy lifting of mapping the Ruby hash into Cnp XML format
|
26
26
|
# It also handles validation looking for missing or incorrect fields
|
27
27
|
# contains the methods to properly create each transaction type
|
28
28
|
#
|
29
|
-
module
|
30
|
-
class
|
29
|
+
module CnpOnline
|
30
|
+
class CnpTransaction
|
31
|
+
|
32
|
+
def fast_access_funding(options)
|
33
|
+
transaction = FastAccessFunding.new
|
34
|
+
transaction.reportGroup = options['reportGroup']
|
35
|
+
transaction.transactionId = options['transactionId']
|
36
|
+
transaction.customerId = options['customerId']
|
37
|
+
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
38
|
+
transaction.submerchantName = options['submerchantName']
|
39
|
+
transaction.fundsTransferId = options['fundsTransferId']
|
40
|
+
transaction.amount = options['amount']
|
41
|
+
if(options['card'])
|
42
|
+
transaction.card = Card.from_hash(options)
|
43
|
+
end
|
44
|
+
if(options['token'])
|
45
|
+
transaction.token = CardToken.from_hash(options,'token')
|
46
|
+
end
|
47
|
+
if(options['paypage'])
|
48
|
+
transaction.paypage = CardPaypage.from_hash(options,'paypage')
|
49
|
+
end
|
50
|
+
return transaction
|
51
|
+
end
|
52
|
+
|
31
53
|
def authorization(options)
|
32
54
|
transaction = Authorization.new
|
33
55
|
transaction.secondaryAmount = options['secondaryAmount']
|
@@ -158,7 +180,7 @@ module LitleOnline
|
|
158
180
|
|
159
181
|
def activate_reversal(options)
|
160
182
|
transaction = ActivateReversal.new
|
161
|
-
transaction.
|
183
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
162
184
|
transaction.card = GiftCardCardType.from_hash(options,'card')
|
163
185
|
transaction.originalRefCode = options['originalRefCode']
|
164
186
|
transaction.originalAmount = options['originalAmount']
|
@@ -170,7 +192,7 @@ module LitleOnline
|
|
170
192
|
|
171
193
|
def deposit_reversal(options)
|
172
194
|
transaction = DepositReversal.new
|
173
|
-
transaction.
|
195
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
174
196
|
transaction.card = GiftCardCardType.from_hash(options,'card')
|
175
197
|
transaction.originalRefCode = options['originalRefCode']
|
176
198
|
transaction.originalAmount = options['originalAmount']
|
@@ -180,11 +202,11 @@ module LitleOnline
|
|
180
202
|
return transaction
|
181
203
|
end
|
182
204
|
|
183
|
-
#XML
|
205
|
+
#XML 12.0
|
184
206
|
|
185
207
|
def giftCardAuth_reversal(options)
|
186
208
|
transaction = GiftCardAuthReversal.new
|
187
|
-
transaction.
|
209
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
188
210
|
transaction.card = GiftCardCardType.from_hash(options,'card')
|
189
211
|
transaction.originalRefCode = options['originalRefCode']
|
190
212
|
transaction.originalAmount = options['originalAmount']
|
@@ -193,10 +215,10 @@ module LitleOnline
|
|
193
215
|
transaction.originalSequenceNumber = options['originalSequenceNumber']
|
194
216
|
return transaction
|
195
217
|
end
|
196
|
-
|
197
|
-
|
218
|
+
|
219
|
+
def giftCardCapture(options)
|
198
220
|
transaction = GiftCardCapture.new
|
199
|
-
transaction.
|
221
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
200
222
|
transaction.captureAmount = options['captureAmount']
|
201
223
|
transaction.card = GiftCardCardType.from_hash(options,'card')
|
202
224
|
transaction.originalRefCode = options['originalRefCode']
|
@@ -207,9 +229,9 @@ module LitleOnline
|
|
207
229
|
return transaction
|
208
230
|
end
|
209
231
|
|
210
|
-
|
232
|
+
def giftCardCredit(options)
|
211
233
|
transaction = GiftCardCredit.new
|
212
|
-
transaction.
|
234
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
213
235
|
transaction.creditAmount = options['creditAmount']
|
214
236
|
transaction.orderId = options['orderId']
|
215
237
|
transaction.orderSource = options['orderSource']
|
@@ -219,7 +241,7 @@ module LitleOnline
|
|
219
241
|
|
220
242
|
def refund_reversal(options)
|
221
243
|
transaction = RefundReversal.new
|
222
|
-
transaction.
|
244
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
223
245
|
transaction.card = GiftCardCardType.from_hash(options,'card')
|
224
246
|
transaction.originalRefCode = options['originalRefCode']
|
225
247
|
transaction.originalAmount = options['originalAmount']
|
@@ -231,7 +253,7 @@ module LitleOnline
|
|
231
253
|
|
232
254
|
def deactivate_reversal(options)
|
233
255
|
transaction = DeactivateReversal.new
|
234
|
-
transaction.
|
256
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
235
257
|
transaction.card = GiftCardCardType.from_hash(options,'card')
|
236
258
|
transaction.originalRefCode = options['originalRefCode']
|
237
259
|
transaction.originalAmount = options['originalAmount']
|
@@ -243,7 +265,7 @@ module LitleOnline
|
|
243
265
|
|
244
266
|
def load_reversal(options)
|
245
267
|
transaction = LoadReversal.new
|
246
|
-
transaction.
|
268
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
247
269
|
transaction.card = GiftCardCardType.from_hash(options,'card')
|
248
270
|
transaction.originalRefCode = options['originalRefCode']
|
249
271
|
transaction.originalAmount = options['originalAmount']
|
@@ -255,7 +277,7 @@ module LitleOnline
|
|
255
277
|
|
256
278
|
def unload_reversal(options)
|
257
279
|
transaction = UnloadReversal.new
|
258
|
-
transaction.
|
280
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
259
281
|
transaction.card = GiftCardCardType.from_hash(options,'card')
|
260
282
|
transaction.originalRefCode = options['originalRefCode']
|
261
283
|
transaction.originalAmount = options['originalAmount']
|
@@ -274,7 +296,7 @@ module LitleOnline
|
|
274
296
|
transaction.payPalOrderComplete = options['payPalOrderComplete']
|
275
297
|
transaction.payPalNotes = options['payPalNotes']
|
276
298
|
transaction.recurringRequest = RecurringRequest.from_hash(options,'recurringRequest')
|
277
|
-
transaction.
|
299
|
+
transaction.cnpInternalRecurringRequest = CnpInternalRecurringRequest.from_hash(options,'cnpInternalRecurringRequest')
|
278
300
|
transaction.debtRepayment = options['debtRepayment']
|
279
301
|
transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options, 'advancedFraudChecks')
|
280
302
|
#SDK XML 11
|
@@ -289,8 +311,8 @@ module LitleOnline
|
|
289
311
|
|
290
312
|
def credit(options)
|
291
313
|
transaction = Credit.new
|
292
|
-
transaction.
|
293
|
-
if(transaction.
|
314
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
315
|
+
if(transaction.cnpTxnId.nil?)
|
294
316
|
transaction.orderId = options['orderId']
|
295
317
|
transaction.orderSource = options['orderSource']
|
296
318
|
transaction.taxType = options['taxType']
|
@@ -322,7 +344,7 @@ module LitleOnline
|
|
322
344
|
def auth_reversal(options)
|
323
345
|
transaction = AuthReversal.new
|
324
346
|
|
325
|
-
transaction.
|
347
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
326
348
|
transaction.amount = options['amount']
|
327
349
|
transaction.surchargeAmount = options['surchargeAmount']
|
328
350
|
transaction.payPalNotes = options['payPalNotes']
|
@@ -348,10 +370,10 @@ module LitleOnline
|
|
348
370
|
transaction = UpdateCardValidationNumOnToken.new
|
349
371
|
|
350
372
|
transaction.orderId = options['orderId']
|
351
|
-
transaction.
|
373
|
+
transaction.cnpToken = options['cnpToken']
|
352
374
|
transaction.cardValidationNum = options['cardValidationNum']
|
353
375
|
|
354
|
-
SchemaValidation.validate_length(transaction.
|
376
|
+
SchemaValidation.validate_length(transaction.cnpToken, true, 13, 25, "updateCardValidationNumOnToken", "cnpToken")
|
355
377
|
SchemaValidation.validate_length(transaction.cardValidationNum, true, 1, 4, "updateCardValidationNumOnToken", "cardValidationNum")
|
356
378
|
|
357
379
|
add_account_info(transaction, options)
|
@@ -376,7 +398,7 @@ module LitleOnline
|
|
376
398
|
transaction = Capture.new
|
377
399
|
|
378
400
|
transaction.partial = options['partial']
|
379
|
-
transaction.
|
401
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
380
402
|
transaction.amount = options['amount']
|
381
403
|
transaction.surchargeAmount = options['surchargeAmount']
|
382
404
|
transaction.enhancedData = EnhancedData.from_hash(options)
|
@@ -411,7 +433,7 @@ module LitleOnline
|
|
411
433
|
def void(options)
|
412
434
|
transaction = Void.new
|
413
435
|
|
414
|
-
transaction.
|
436
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
415
437
|
transaction.processingInstructions = ProcessingInstructions.from_hash(options)
|
416
438
|
|
417
439
|
add_account_info(transaction, options)
|
@@ -422,7 +444,7 @@ module LitleOnline
|
|
422
444
|
transaction = EcheckRedeposit.new
|
423
445
|
add_echeck(transaction, options)
|
424
446
|
|
425
|
-
transaction.
|
447
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
426
448
|
transaction.merchantData = MerchantData.from_hash(options)
|
427
449
|
transaction.customIdentifier = options['customIdentifier']
|
428
450
|
return transaction
|
@@ -516,7 +538,7 @@ module LitleOnline
|
|
516
538
|
|
517
539
|
def funding_txn_void(options)
|
518
540
|
transaction = FundingInstructionVoid.new
|
519
|
-
transaction.
|
541
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
520
542
|
add_account_info(transaction, options)
|
521
543
|
|
522
544
|
return transaction
|
@@ -527,7 +549,7 @@ module LitleOnline
|
|
527
549
|
transaction = QueryTransaction.new
|
528
550
|
transaction.origId = options['origId']
|
529
551
|
transaction.origActionType = options['origActionType']
|
530
|
-
transaction.
|
552
|
+
transaction.origCnpTxnId = options['origCnpTxnId']
|
531
553
|
# transaction.origOrderId = options['origOrderId']
|
532
554
|
# transaction.origAccountNumber = options['origAccountNumber']
|
533
555
|
add_account_info(transaction, options)
|
@@ -610,7 +632,7 @@ module LitleOnline
|
|
610
632
|
def echeck_credit(options)
|
611
633
|
transaction = EcheckCredit.new
|
612
634
|
transaction.customBilling = CustomBilling.from_hash(options)
|
613
|
-
transaction.
|
635
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
614
636
|
transaction.secondaryAmount = options['secondaryAmount']
|
615
637
|
transaction.customIdentifier = options['customIdentifier']
|
616
638
|
add_echeck_order_info(transaction, options)
|
@@ -628,7 +650,7 @@ module LitleOnline
|
|
628
650
|
|
629
651
|
def echeck_void(options)
|
630
652
|
transaction = EcheckVoid.new
|
631
|
-
transaction.
|
653
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
632
654
|
|
633
655
|
add_account_info(transaction, options)
|
634
656
|
return transaction
|
@@ -654,27 +676,6 @@ module LitleOnline
|
|
654
676
|
|
655
677
|
return transaction
|
656
678
|
end
|
657
|
-
#11.4 Begin
|
658
|
-
|
659
|
-
def fast_access_funding(options)
|
660
|
-
transaction = FastAccessFunding.new
|
661
|
-
transaction.reportGroup = get_report_group(options)
|
662
|
-
transaction.transactionId = options['id']
|
663
|
-
transaction.customerId = options['customerId']
|
664
|
-
|
665
|
-
transaction.fundingSubmerchantId = options['fundingSubmerchantId']
|
666
|
-
transaction.submerchantName = options['submerchantName']
|
667
|
-
transaction.fundsTransferId = options['fundsTransferId']
|
668
|
-
transaction.amount = options['amount']
|
669
|
-
|
670
|
-
transaction.card = Card.from_hash(options)
|
671
|
-
transaction.token = CardToken.from_hash(options,'token')
|
672
|
-
transaction.paypage = CardPaypage.from_hash(options,'paypage')
|
673
|
-
|
674
|
-
return transaction
|
675
|
-
end
|
676
|
-
|
677
|
-
# 11.4 End
|
678
679
|
|
679
680
|
private
|
680
681
|
|
@@ -685,7 +686,7 @@ module LitleOnline
|
|
685
686
|
end
|
686
687
|
|
687
688
|
def add_transaction_info(transaction, options)
|
688
|
-
transaction.
|
689
|
+
transaction.cnpTxnId = options['cnpTxnId']
|
689
690
|
transaction.customerInfo = CustomerInfo.from_hash(options)
|
690
691
|
transaction.shipToAddress = Contact.from_hash(options,'shipToAddress')
|
691
692
|
transaction.billMeLaterRequest = BillMeLaterRequest.from_hash(options)
|
@@ -725,7 +726,7 @@ module LitleOnline
|
|
725
726
|
end
|
726
727
|
|
727
728
|
def add_echeck_order_info(transaction, options)
|
728
|
-
#transaction.
|
729
|
+
#transaction.cnpTxnId = options['cnpTxnId']
|
729
730
|
transaction.orderId = options['orderId']
|
730
731
|
transaction.amount = options['amount']
|
731
732
|
transaction.orderSource = options['orderSource']
|
@@ -27,19 +27,19 @@ require 'logger'
|
|
27
27
|
|
28
28
|
#
|
29
29
|
# Handles round trip of transactions
|
30
|
-
# Maps the request to
|
30
|
+
# Maps the request to Cnp XML -> Sends XML payload to Cnp via HTTP(S) -> formats XML response into a Ruby hash and returns it
|
31
31
|
#
|
32
|
-
module
|
33
|
-
class
|
34
|
-
def
|
32
|
+
module CnpOnline
|
33
|
+
class CnpXmlMapper
|
34
|
+
def CnpXmlMapper.request(request_xml, config_hash)
|
35
35
|
logger = initialize_logger(config_hash)
|
36
36
|
|
37
37
|
logger.debug request_xml
|
38
|
-
# get the
|
38
|
+
# get the Cnp Online Response from the API server over HTTP
|
39
39
|
response_xml = Communications.http_post(request_xml,config_hash)
|
40
40
|
logger.debug response_xml
|
41
41
|
|
42
|
-
# create response object from xml returned form the
|
42
|
+
# create response object from xml returned form the Cnp API
|
43
43
|
response_object = XMLObject.new(response_xml)
|
44
44
|
|
45
45
|
# Check if the response xml is valid.
|
@@ -55,7 +55,7 @@ module LitleOnline
|
|
55
55
|
private
|
56
56
|
|
57
57
|
def self.initialize_logger(config_hash)
|
58
|
-
# Sadly, this needs to be static (the alternative would be to change the
|
58
|
+
# Sadly, this needs to be static (the alternative would be to change the CnpXmlMapper.request API
|
59
59
|
# to accept a Configuration instance instead of the config_hash)
|
60
60
|
Configuration.logger ||= default_logger config_hash['printxml'] ? Logger::DEBUG : Logger::INFO
|
61
61
|
end
|
data/lib/Communications.rb
CHANGED
@@ -24,22 +24,23 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
24
24
|
=end
|
25
25
|
|
26
26
|
#
|
27
|
-
# Used for all transmission to
|
27
|
+
# Used for all transmission to Cnp over HTTP or HTTPS
|
28
28
|
# works with or without an HTTP proxy
|
29
29
|
#
|
30
30
|
# URL and proxy server settings are derived from the configuration file
|
31
31
|
#
|
32
|
-
|
32
|
+
|
33
|
+
module CnpOnline
|
33
34
|
class Communications
|
34
35
|
##For http or https post with or without a proxy
|
35
36
|
def Communications.http_post(post_data,config_hash)
|
36
37
|
|
37
38
|
proxy_addr = config_hash['proxy_addr']
|
38
39
|
proxy_port = config_hash['proxy_port']
|
39
|
-
|
40
|
+
cnp_url = config_hash['url']
|
40
41
|
|
41
42
|
# setup https or http post
|
42
|
-
url = URI.parse(
|
43
|
+
url = URI.parse(cnp_url)
|
43
44
|
|
44
45
|
response_xml = nil
|
45
46
|
https = Net::HTTP.new(url.host, url.port, proxy_addr, proxy_port)
|
@@ -71,9 +72,9 @@ end
|
|
71
72
|
The round-trip time of an Authorization can be broken down into three parts, as follows:
|
72
73
|
1. Transmission time (across the internet) to Vantiv eCommerce and back to the merchant
|
73
74
|
2. Processing time by the authorization provider
|
74
|
-
3. Processing time by
|
75
|
-
Under normal operating circumstances, the transmission time to and from
|
76
|
-
and processing overhead by
|
75
|
+
3. Processing time by Cnp
|
76
|
+
Under normal operating circumstances, the transmission time to and from Cnp does not exceed 0.6 seconds
|
77
|
+
and processing overhead by Cnp occurs in 0.1 seconds.
|
77
78
|
Typically, the processing time by the card association or authorization provider can take between 0.5 and 3 seconds,
|
78
79
|
but some percentage of transactions may take significantly longer.
|
79
80
|
|
data/lib/Configuration.rb
CHANGED
@@ -23,10 +23,11 @@
|
|
23
23
|
|
24
24
|
require 'yaml'
|
25
25
|
require_relative 'EnvironmentVariables'
|
26
|
+
|
26
27
|
#
|
27
28
|
# Loads the configuration from a file
|
28
29
|
#
|
29
|
-
module
|
30
|
+
module CnpOnline
|
30
31
|
class Configuration
|
31
32
|
class << self
|
32
33
|
# External logger, if specified
|
@@ -34,18 +35,18 @@ module LitleOnline
|
|
34
35
|
end
|
35
36
|
|
36
37
|
def config
|
37
|
-
if !ENV['
|
38
|
-
config_file = ENV['
|
38
|
+
if !ENV['CNP_CONFIG_DIR'].nil?
|
39
|
+
config_file = ENV['CNP_CONFIG_DIR'] + '/.cnp_SDK_config.yml'
|
39
40
|
else
|
40
|
-
config_file = ENV['HOME'] + '/.
|
41
|
+
config_file = ENV['HOME'] + '/.cnp_SDK_config.yml'
|
41
42
|
end
|
43
|
+
|
42
44
|
datas = {}
|
43
45
|
# if Env variable exist, then just override the data from config file
|
44
46
|
if File.exist?(config_file)
|
45
47
|
datas = YAML.load_file(config_file)
|
46
48
|
end
|
47
49
|
|
48
|
-
# fill in fields missing in config from run time environment
|
49
50
|
environments = EnvironmentVariables.new
|
50
51
|
environments.instance_variables.each do |var|
|
51
52
|
if datas[var.to_s.delete('@')].nil?
|
@@ -59,7 +60,7 @@ module LitleOnline
|
|
59
60
|
end
|
60
61
|
|
61
62
|
def setENV(key, datas)
|
62
|
-
val = ENV['
|
63
|
+
val = ENV['cnp_' + key]
|
63
64
|
if !val.nil?
|
64
65
|
if val == 'true'
|
65
66
|
datas[key] = true
|
data/lib/EnvironmentVariables.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module CnpOnline
|
2
2
|
class EnvironmentVariables
|
3
3
|
def initialize
|
4
4
|
# load configuration data
|
@@ -16,10 +16,10 @@ module LitleOnline
|
|
16
16
|
@fast_port = ''
|
17
17
|
@printxml = false
|
18
18
|
@timeout = 65
|
19
|
+
@deleteBatchFiles = false
|
19
20
|
@useEncryption = false
|
20
21
|
@vantivPublicKeyID = ''
|
21
22
|
@passphrase = ''
|
22
|
-
@deleteBatchFies = false
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/XMLFields.rb
CHANGED
@@ -23,7 +23,7 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
23
23
|
# Contains all of the underlying XML fields and specifications needed to create the transaction set
|
24
24
|
#
|
25
25
|
|
26
|
-
module
|
26
|
+
module CnpOnline
|
27
27
|
class OptionalChoiceNode < XML::Mapping::ChoiceNode
|
28
28
|
def obj_to_xml(obj,xml)
|
29
29
|
count = 0
|
@@ -759,7 +759,7 @@ module LitleOnline
|
|
759
759
|
end
|
760
760
|
end
|
761
761
|
|
762
|
-
#XML
|
762
|
+
#XML 12.0
|
763
763
|
class SepaDirectDebit
|
764
764
|
include XML::Mapping
|
765
765
|
text_node :mandateProvider, "mandateProvider", :default_value=>nil
|
@@ -797,25 +797,22 @@ module LitleOnline
|
|
797
797
|
|
798
798
|
class CardToken
|
799
799
|
include XML::Mapping
|
800
|
-
text_node :
|
800
|
+
text_node :cnpToken, "cnpToken", :default_value=>nil
|
801
801
|
text_node :expDate, "expDate", :default_value=>nil
|
802
802
|
text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
|
803
803
|
text_node :mop, "type", :default_value=>nil
|
804
|
-
text_node :checkoutId, "checkoutId", :default_value=>nil
|
805
804
|
def self.from_hash(hash, name='cardToken')
|
806
805
|
base = hash[name]
|
807
806
|
if(base)
|
808
807
|
this = CardToken.new
|
809
|
-
this.
|
808
|
+
this.cnpToken = base['cnpToken']
|
810
809
|
this.expDate = base['expDate']
|
811
810
|
this.cardValidationNum = base['cardValidationNum']
|
812
811
|
this.mop = base['type']
|
813
|
-
this.
|
814
|
-
SchemaValidation.validate_length(this.litleToken, true, 13, 25, name, 'litleToken')
|
812
|
+
SchemaValidation.validate_length(this.cnpToken, true, 13, 25, name, 'cnpToken')
|
815
813
|
SchemaValidation.validate_length(this.expDate, false, 4, 4, name, 'expDate')
|
816
814
|
SchemaValidation.validate_length(this.cardValidationNum, false, 1, 4, name, 'cardValidationNum')
|
817
815
|
SchemaValidation.validate_enum(this.mop, false, ['','MC','VI','AX','DC','DI','PP','JC','BL','EC'], name, 'type')
|
818
|
-
SchemaValidation.validate_length(this.checkoutId, false, 18, 18, name, 'checkoutId')
|
819
816
|
this
|
820
817
|
else
|
821
818
|
nil
|
@@ -1022,7 +1019,7 @@ module LitleOnline
|
|
1022
1019
|
|
1023
1020
|
class EcheckToken
|
1024
1021
|
include XML::Mapping
|
1025
|
-
text_node :
|
1022
|
+
text_node :cnpToken, "cnpToken", :default_value=>nil
|
1026
1023
|
text_node :routingNum, "routingNum", :default_value=>nil
|
1027
1024
|
text_node :accType, "accType", :default_value=>nil
|
1028
1025
|
text_node :checkNum, "checkNum", :default_value=>nil
|
@@ -1030,11 +1027,11 @@ module LitleOnline
|
|
1030
1027
|
base = hash[name]
|
1031
1028
|
if(base)
|
1032
1029
|
this = EcheckToken.new
|
1033
|
-
this.
|
1030
|
+
this.cnpToken = base['cnpToken']
|
1034
1031
|
this.routingNum = base['routingNum']
|
1035
1032
|
this.accType = base['accType']
|
1036
1033
|
this.checkNum = base['checkNum']
|
1037
|
-
SchemaValidation.validate_length(this.
|
1034
|
+
SchemaValidation.validate_length(this.cnpToken, true, 13, 25, name, 'cnpToken')
|
1038
1035
|
SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
|
1039
1036
|
SchemaValidation.validate_enum(this.accType, true, ['Checking','Savings','Corporate','Corp Savings'], name, 'accType')
|
1040
1037
|
SchemaValidation.validate_length(this.checkNum, false, 1, 15, name, 'checkNum')
|
@@ -1055,7 +1052,7 @@ module LitleOnline
|
|
1055
1052
|
this = RecyclingRequest.new
|
1056
1053
|
this.recycleBy = base['recycleBy']
|
1057
1054
|
this.recycleId = base['recycleId']
|
1058
|
-
SchemaValidation.validate_enum(this.recycleBy, false, ['Merchant','
|
1055
|
+
SchemaValidation.validate_enum(this.recycleBy, false, ['Merchant','Cnp','None'], name, 'recycleBy')
|
1059
1056
|
SchemaValidation.validate_length(this.recycleId, false, 1, 25, name, 'recycleId')
|
1060
1057
|
this
|
1061
1058
|
else
|
@@ -1161,15 +1158,15 @@ module LitleOnline
|
|
1161
1158
|
end
|
1162
1159
|
end
|
1163
1160
|
|
1164
|
-
class
|
1161
|
+
class CnpInternalRecurringRequest
|
1165
1162
|
include XML::Mapping
|
1166
1163
|
text_node :subscriptionId, "subscriptionId", :default_value=>nil
|
1167
1164
|
text_node :recurringTxnId, "recurringTxnId", :default_value=>nil
|
1168
1165
|
text_node :finalPayment, "finalPayment", :default_value=>nil
|
1169
|
-
def self.from_hash(hash, name="
|
1166
|
+
def self.from_hash(hash, name="cnpInternalRecurringRequest")
|
1170
1167
|
base = hash[name]
|
1171
1168
|
if(base)
|
1172
|
-
this =
|
1169
|
+
this = CnpInternalRecurringRequest.new
|
1173
1170
|
this.subscriptionId = base['subscriptionId']
|
1174
1171
|
this.recurringTxnId = base['recurringTxnId']
|
1175
1172
|
this.finalPayment = base['finalPayment']
|
@@ -1432,7 +1429,7 @@ module LitleOnline
|
|
1432
1429
|
text_node :transactionId, "@id", :default_value=>nil
|
1433
1430
|
text_node :customerId, "@customerId", :default_value=>nil
|
1434
1431
|
|
1435
|
-
text_node :
|
1432
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1436
1433
|
text_node :orderId, "orderId", :default_value=>nil
|
1437
1434
|
text_node :amount, "amount", :default_value=>nil
|
1438
1435
|
text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
|
@@ -1469,8 +1466,7 @@ module LitleOnline
|
|
1469
1466
|
#SDK XML 11
|
1470
1467
|
text_node :processingType,"processingType", :default_value=>nil
|
1471
1468
|
text_node :originalNetworkTransactionId,"originalNetworkTransactionId", :default_value=>nil
|
1472
|
-
text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
|
1473
|
-
|
1469
|
+
text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
|
1474
1470
|
end
|
1475
1471
|
|
1476
1472
|
class Sale
|
@@ -1480,7 +1476,7 @@ module LitleOnline
|
|
1480
1476
|
text_node :transactionId, "@id", :default_value=>nil
|
1481
1477
|
text_node :customerId, "@customerId", :default_value=>nil
|
1482
1478
|
|
1483
|
-
text_node :
|
1479
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1484
1480
|
text_node :orderId, "orderId", :default_value=>nil
|
1485
1481
|
text_node :amount, "amount", :default_value=>nil
|
1486
1482
|
text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
|
@@ -1514,7 +1510,7 @@ module LitleOnline
|
|
1514
1510
|
object_node :recyclingRequest, "recyclingRequest", :class=>RecyclingRequest, :default_value=>nil
|
1515
1511
|
text_node :fraudFilterOverride, "fraudFilterOverride", :default_value=>nil
|
1516
1512
|
object_node :recurringRequest, "recurringRequest", :class=>RecurringRequest, :default_value=>nil
|
1517
|
-
object_node :
|
1513
|
+
object_node :cnpInternalRecurringRequest, "cnpInternalRecurringRequest", :class=>CnpInternalRecurringRequest, :default_value=>nil
|
1518
1514
|
text_node :debtRepayment,"debtRepayment", :default_value=>nil
|
1519
1515
|
object_node :advancedFraudChecks, "advancedFraudChecks",:class=>AdvancedFraudChecks, :default_value=>nil
|
1520
1516
|
#SDK XML 10
|
@@ -1522,8 +1518,10 @@ module LitleOnline
|
|
1522
1518
|
#SDK XML 11
|
1523
1519
|
text_node :processingType,"processingType", :default_value=>nil
|
1524
1520
|
text_node :originalNetworkTransactionId,"originalNetworkTransactionId", :default_value=>nil
|
1525
|
-
text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
|
1526
|
-
|
1521
|
+
text_node :originalTransactionAmount,"originalTransactionAmount", :default_value=>nil
|
1522
|
+
#SDK XML 12
|
1523
|
+
text_node :routingPreference,"routingPreference", :default_value=>nil
|
1524
|
+
|
1527
1525
|
end
|
1528
1526
|
|
1529
1527
|
class Credit
|
@@ -1533,7 +1531,7 @@ module LitleOnline
|
|
1533
1531
|
text_node :transactionId, "@id", :default_value=>nil
|
1534
1532
|
text_node :customerId, "@customerId", :default_value=>nil
|
1535
1533
|
|
1536
|
-
text_node :
|
1534
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1537
1535
|
text_node :orderId, "orderId", :default_value=>nil
|
1538
1536
|
text_node :amount, "amount", :default_value=>nil
|
1539
1537
|
text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
|
@@ -1645,7 +1643,7 @@ module LitleOnline
|
|
1645
1643
|
text_node :customerId, "@customerId", :default_value=>nil
|
1646
1644
|
text_node :partial, "@partial", :default_value=>nil
|
1647
1645
|
|
1648
|
-
text_node :
|
1646
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1649
1647
|
text_node :amount, "amount", :default_value=>nil
|
1650
1648
|
text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
|
1651
1649
|
text_node :payPalNotes, "payPalNotes", :default_value=>nil
|
@@ -1660,7 +1658,7 @@ module LitleOnline
|
|
1660
1658
|
text_node :customerId, "@customerId", :default_value=>nil
|
1661
1659
|
text_node :partial, "@partial", :default_value=>nil
|
1662
1660
|
|
1663
|
-
text_node :
|
1661
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1664
1662
|
text_node :amount, "amount", :default_value=>nil
|
1665
1663
|
text_node :surchargeAmount, "surchargeAmount", :default_value=>nil
|
1666
1664
|
object_node :enhancedData, "enhancedData", :class=>EnhancedData, :default_value=>nil
|
@@ -1679,7 +1677,7 @@ module LitleOnline
|
|
1679
1677
|
text_node :transactionId, "@id", :default_value=>nil
|
1680
1678
|
text_node :customerId, "@customerId", :default_value=>nil
|
1681
1679
|
|
1682
|
-
text_node :
|
1680
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1683
1681
|
object_node :processingInstructions, "processingInstructions", :class=>ProcessingInstructions, :default_value=>nil
|
1684
1682
|
end
|
1685
1683
|
|
@@ -1690,7 +1688,7 @@ module LitleOnline
|
|
1690
1688
|
text_node :transactionId, "@id", :default_value=>nil
|
1691
1689
|
text_node :customerId, "@customerId", :default_value=>nil
|
1692
1690
|
|
1693
|
-
text_node :
|
1691
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1694
1692
|
end
|
1695
1693
|
|
1696
1694
|
class GiftCardCardType
|
@@ -1706,14 +1704,14 @@ module LitleOnline
|
|
1706
1704
|
end
|
1707
1705
|
|
1708
1706
|
|
1709
|
-
#XML
|
1710
|
-
|
1707
|
+
#XML 12.0
|
1708
|
+
class GiftCardAuthReversal
|
1711
1709
|
include XML::Mapping
|
1712
1710
|
root_element_name "giftCardAuthReversal"
|
1713
1711
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1714
1712
|
text_node :transactionId, "@id", :default_value=>nil
|
1715
1713
|
text_node :customerId, "@customerId", :default_value=>nil
|
1716
|
-
text_node :
|
1714
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1717
1715
|
object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
|
1718
1716
|
text_node :originalRefCode, "originalRefCode", :default_value=>nil
|
1719
1717
|
text_node :originalAmount, "originalAmount", :default_value=>nil
|
@@ -1728,7 +1726,7 @@ module LitleOnline
|
|
1728
1726
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1729
1727
|
text_node :transactionId, "@id", :default_value=>nil
|
1730
1728
|
text_node :customerId, "@customerId", :default_value=>nil
|
1731
|
-
text_node :
|
1729
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1732
1730
|
text_node :captureAmount, "captureAmount", :default_value=>nil
|
1733
1731
|
object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
|
1734
1732
|
text_node :originalRefCode, "originalRefCode", :default_value=>nil
|
@@ -1738,7 +1736,7 @@ module LitleOnline
|
|
1738
1736
|
text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
|
1739
1737
|
end
|
1740
1738
|
|
1741
|
-
|
1739
|
+
class GiftCardCredit
|
1742
1740
|
include XML::Mapping
|
1743
1741
|
root_element_name "giftCardCredit"
|
1744
1742
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
@@ -1749,7 +1747,7 @@ module LitleOnline
|
|
1749
1747
|
text_node :originalTxnTime, "originalTxnTime", :default_value=>nil
|
1750
1748
|
text_node :originalSystemTraceId, "originalSystemTraceId", :default_value=>nil
|
1751
1749
|
text_node :originalSequenceNumber, "originalSequenceNumber", :default_value=>nil
|
1752
|
-
text_node :
|
1750
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1753
1751
|
text_node :creditAmount, "creditAmount", :default_value=>nil
|
1754
1752
|
object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
|
1755
1753
|
text_node :orderId, "orderId", :default_value=>nil
|
@@ -1766,8 +1764,8 @@ module LitleOnline
|
|
1766
1764
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1767
1765
|
text_node :transactionId, "@id", :default_value=>nil
|
1768
1766
|
text_node :customerId, "@customerId", :default_value=>nil
|
1769
|
-
text_node :
|
1770
|
-
#
|
1767
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1768
|
+
#12.0
|
1771
1769
|
object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
|
1772
1770
|
text_node :originalRefCode, "originalRefCode", :default_value=>nil
|
1773
1771
|
text_node :originalAmount, "originalAmount", :default_value=>nil
|
@@ -1783,8 +1781,8 @@ module LitleOnline
|
|
1783
1781
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1784
1782
|
text_node :transactionId, "@id", :default_value=>nil
|
1785
1783
|
text_node :customerId, "@customerId", :default_value=>nil
|
1786
|
-
text_node :
|
1787
|
-
#
|
1784
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1785
|
+
#12.0
|
1788
1786
|
object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
|
1789
1787
|
text_node :originalRefCode, "originalRefCode", :default_value=>nil
|
1790
1788
|
text_node :originalAmount, "originalAmount", :default_value=>nil
|
@@ -1800,8 +1798,8 @@ module LitleOnline
|
|
1800
1798
|
text_node :transactionId, "@id", :default_value=>nil
|
1801
1799
|
text_node :customerId, "@customerId", :default_value=>nil
|
1802
1800
|
|
1803
|
-
text_node :
|
1804
|
-
#
|
1801
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1802
|
+
#12.0
|
1805
1803
|
object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
|
1806
1804
|
text_node :originalRefCode, "originalRefCode", :default_value=>nil
|
1807
1805
|
text_node :originalAmount, "originalAmount", :default_value=>nil
|
@@ -1817,8 +1815,8 @@ module LitleOnline
|
|
1817
1815
|
text_node :transactionId, "@id", :default_value=>nil
|
1818
1816
|
text_node :customerId, "@customerId", :default_value=>nil
|
1819
1817
|
|
1820
|
-
text_node :
|
1821
|
-
#
|
1818
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1819
|
+
#12.0
|
1822
1820
|
object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
|
1823
1821
|
text_node :originalRefCode, "originalRefCode", :default_value=>nil
|
1824
1822
|
text_node :originalAmount, "originalAmount", :default_value=>nil
|
@@ -1834,8 +1832,8 @@ module LitleOnline
|
|
1834
1832
|
text_node :transactionId, "@id", :default_value=>nil
|
1835
1833
|
text_node :customerId, "@customerId", :default_value=>nil
|
1836
1834
|
|
1837
|
-
text_node :
|
1838
|
-
#
|
1835
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1836
|
+
#12.0
|
1839
1837
|
object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
|
1840
1838
|
text_node :originalRefCode, "originalRefCode", :default_value=>nil
|
1841
1839
|
text_node :originalAmount, "originalAmount", :default_value=>nil
|
@@ -1851,8 +1849,8 @@ module LitleOnline
|
|
1851
1849
|
text_node :transactionId, "@id", :default_value=>nil
|
1852
1850
|
text_node :customerId, "@customerId", :default_value=>nil
|
1853
1851
|
|
1854
|
-
text_node :
|
1855
|
-
#
|
1852
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1853
|
+
#12.0
|
1856
1854
|
object_node :card, "card", :class => GiftCardCardType, :default_value=>nil
|
1857
1855
|
text_node :originalRefCode, "originalRefCode", :default_value=>nil
|
1858
1856
|
text_node :originalAmount, "originalAmount", :default_value=>nil
|
@@ -1867,8 +1865,8 @@ module LitleOnline
|
|
1867
1865
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
1868
1866
|
text_node :transactionId, "@id", :default_value=>nil
|
1869
1867
|
text_node :customerId, "@customerId", :default_value=>nil
|
1870
|
-
#XML
|
1871
|
-
#text_node :
|
1868
|
+
#XML 12.0
|
1869
|
+
#text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1872
1870
|
text_node :orderId, "orderId", :default_value=>nil
|
1873
1871
|
text_node :amount, "amount", :default_value=>nil
|
1874
1872
|
text_node :orderSource, "orderSource", :default_value=>nil
|
@@ -1886,7 +1884,7 @@ module LitleOnline
|
|
1886
1884
|
text_node :transactionId, "@id", :default_value=>nil
|
1887
1885
|
text_node :customerId, "@customerId", :default_value=>nil
|
1888
1886
|
|
1889
|
-
text_node :
|
1887
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1890
1888
|
text_node :orderId, "orderId", :default_value=>nil
|
1891
1889
|
text_node :amount, "amount", :default_value=>nil
|
1892
1890
|
text_node :secondaryAmount, "secondaryAmount", :default_value=>nil
|
@@ -1906,7 +1904,7 @@ module LitleOnline
|
|
1906
1904
|
text_node :transactionId, "@id", :default_value=>nil
|
1907
1905
|
text_node :customerId, "@customerId", :default_value=>nil
|
1908
1906
|
|
1909
|
-
text_node :
|
1907
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1910
1908
|
optional_choice_node :if, 'echeck', :then, (object_node :echeck, "echeck", :class=>Echeck, :default_value=>nil),
|
1911
1909
|
:elsif, 'echeckToken', :then, (object_node :echeckToken, "echeckToken", :class=>EcheckToken, :default_value=>nil)
|
1912
1910
|
object_node :merchantData, "merchantData", :class=>MerchantData, :default_value=>nil
|
@@ -1920,7 +1918,7 @@ module LitleOnline
|
|
1920
1918
|
text_node :transactionId, "@id", :default_value=>nil
|
1921
1919
|
text_node :customerId, "@customerId", :default_value=>nil
|
1922
1920
|
|
1923
|
-
text_node :
|
1921
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
1924
1922
|
text_node :orderId, "orderId", :default_value=>nil
|
1925
1923
|
text_node :verify, "verify", :default_value=>nil
|
1926
1924
|
text_node :amount, "amount", :default_value=>nil
|
@@ -2111,7 +2109,7 @@ module LitleOnline
|
|
2111
2109
|
text_node :customerId, "@customerId", :default_value=>nil
|
2112
2110
|
|
2113
2111
|
text_node :orderId, "orderId", :default_value=>nil
|
2114
|
-
text_node :
|
2112
|
+
text_node :cnpToken, "cnpToken", :default_value=>nil
|
2115
2113
|
text_node :cardValidationNum, "cardValidationNum", :default_value=>nil
|
2116
2114
|
end
|
2117
2115
|
|
@@ -2135,15 +2133,36 @@ module LitleOnline
|
|
2135
2133
|
class FundingInstructionVoid
|
2136
2134
|
include XML::Mapping
|
2137
2135
|
root_element_name "fundingInstructionVoid"
|
2138
|
-
text_node :
|
2136
|
+
text_node :cnpTxnId, "cnpTxnId", :default_value=>nil
|
2139
2137
|
end
|
2140
|
-
|
2138
|
+
|
2139
|
+
# Adding the Funding Void Instruction Class
|
2140
|
+
# Date: 01-25-2016
|
2141
|
+
# Change Type: New
|
2142
|
+
# Desc: Change proposed as a part of XML 10 to incorporate the feature of voiding transactions
|
2143
|
+
# on request.
|
2144
|
+
class FastAccessFunding
|
2145
|
+
include XML::Mapping
|
2146
|
+
root_element_name "fastAccessFunding"
|
2147
|
+
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
2148
|
+
text_node :transactionId, "@id", :default_value=>nil
|
2149
|
+
text_node :customerId, "@customerId", :default_value=>nil
|
2150
|
+
|
2151
|
+
text_node :fundingSubmerchantId, "fundingSubmerchantId", :default_value=>nil
|
2152
|
+
text_node :submerchantName, "submerchantName", :default_value=>nil
|
2153
|
+
text_node :fundsTransferId, "fundsTransferId", :default_value=>nil
|
2154
|
+
text_node :amount, "amount", :default_value=>nil
|
2155
|
+
optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card),
|
2156
|
+
:elsif, 'token', :then, (object_node :token, "token", :class=>CardToken),
|
2157
|
+
:elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage)
|
2158
|
+
end
|
2159
|
+
|
2141
2160
|
# Adding the queryTransaction Class
|
2142
2161
|
# Date: 01-27-2016
|
2143
2162
|
# Change Type: New
|
2144
2163
|
# Desc: Change proposed as a part of XML 10 to incorporate the feature of querying transactions
|
2145
2164
|
# on request.
|
2146
|
-
|
2165
|
+
class QueryTransaction
|
2147
2166
|
include XML::Mapping
|
2148
2167
|
root_element_name "queryTransaction"
|
2149
2168
|
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
@@ -2151,7 +2170,7 @@ module LitleOnline
|
|
2151
2170
|
text_node :customerId, "@customerId", :default_value=>nil
|
2152
2171
|
text_node :origId, "origId", :default_value=>nil
|
2153
2172
|
text_node :origActionType, "origActionType", :default_value=>nil
|
2154
|
-
text_node :
|
2173
|
+
text_node :origCnpTxnId, "origCnpTxnId", :default_value=>nil
|
2155
2174
|
#text_node :origOrderId, "origOrderId", :default_value=>nil
|
2156
2175
|
#text_node :origAccountNumber, "origAccountNumber", :default_value=>nil
|
2157
2176
|
def self.from_hash(hash, name='queryTransaction')
|
@@ -2160,7 +2179,7 @@ module LitleOnline
|
|
2160
2179
|
this = QueryTransaction.new
|
2161
2180
|
this.origId = base['origId']
|
2162
2181
|
this.origActionType = base['origActionType']
|
2163
|
-
this.
|
2182
|
+
this.origCnpTxnId = base['origCnpTxnId']
|
2164
2183
|
this.origOrderId = base['origOrderId']
|
2165
2184
|
this.origAccountNumber = base['origAccountNumber']
|
2166
2185
|
SchemaValidation.validate_required(this.origId,true,name,'origId')
|
@@ -2175,7 +2194,7 @@ end
|
|
2175
2194
|
|
2176
2195
|
class OnlineRequest
|
2177
2196
|
include XML::Mapping
|
2178
|
-
root_element_name "
|
2197
|
+
root_element_name "cnpOnlineRequest"
|
2179
2198
|
text_node :merchantId, "@merchantId", :default_value=>nil
|
2180
2199
|
#SDK XML 10
|
2181
2200
|
text_node :id, "@id", :default_value=>nil
|
@@ -2183,8 +2202,6 @@ end
|
|
2183
2202
|
text_node :xmlns, "@xmlns", :default_value=>nil
|
2184
2203
|
text_node :merchantSdk, "@merchantSdk", :default_value=>nil
|
2185
2204
|
text_node :loggedInUser, "@loggedInUser", :default_value=>nil
|
2186
|
-
text_node :sameDayFunding, "@sameDayFunding", :default_value=>nil
|
2187
|
-
# text_node :fastAccessFunding, "@fastAccessFunding", :default_value=>nil
|
2188
2205
|
object_node :authentication, "authentication", :class=>Authentication
|
2189
2206
|
optional_choice_node :if, 'authorization', :then, (object_node :authorization, "authorization", :class=>Authorization),
|
2190
2207
|
:elsif, 'sale', :then, (object_node :sale, "sale", :class=>Sale),
|
@@ -2222,8 +2239,9 @@ end
|
|
2222
2239
|
:elsif, 'unloadReversal', :then, (object_node :unloadReversal,"unloadReversal", :class=>UnloadReversal),
|
2223
2240
|
:elsif, 'advancedFraudResults', :then, (object_node :advancedFraudResults,"advancedFraudResults", :class=>AdvancedFraudResults),
|
2224
2241
|
:elsif, 'queryTransaction', :then, (object_node :queryTransaction, "queryTransaction", :class=>QueryTransaction),
|
2225
|
-
:elsif, 'fraudCheck', :then, (object_node :fraudCheck, "fraudCheck", :class=>FraudCheck)
|
2226
|
-
|
2242
|
+
:elsif, 'fraudCheck', :then, (object_node :fraudCheck, "fraudCheck", :class=>FraudCheck),
|
2243
|
+
:elsif, 'fastAccessFunding', :then, (object_node :fastAccessFunding, "fastAccessFunding", :class=>FastAccessFunding)
|
2244
|
+
def post_save(xml, options={:Mapping=>:_default})
|
2227
2245
|
xml.each_element() {|el|
|
2228
2246
|
if(el.name == 'captureTxn')
|
2229
2247
|
el.name = 'capture'
|
@@ -2243,24 +2261,24 @@ end
|
|
2243
2261
|
text_node :authAmount, "@authAmount", :default_value=>"0"
|
2244
2262
|
text_node :numAuthReversals, "@numAuthReversals", :default_value=>"0"
|
2245
2263
|
text_node :authReversalAmount, "@authReversalAmount", :default_value=>"0"
|
2246
|
-
#
|
2264
|
+
#12.0 begin
|
2247
2265
|
text_node :numGiftCardAuthReversals, "@numGiftCardAuthReversals", :default_value=>"0"
|
2248
2266
|
text_node :giftCardAuthReversalOriginalAmount, "@giftCardAuthReversalOriginalAmount", :default_value=>"0"
|
2249
|
-
#
|
2267
|
+
#12.0 end
|
2250
2268
|
text_node :numCaptures, "@numCaptures", :default_value=>"0"
|
2251
2269
|
text_node :captureAmount, "@captureAmount", :default_value=>"0"
|
2252
|
-
#
|
2270
|
+
#12.0 begin
|
2253
2271
|
text_node :numGiftCardCaptures, "@numGiftCardCaptures", :default_value=>"0"
|
2254
2272
|
text_node :giftCardCaptureAmount, "@giftCardCaptureAmount", :default_value=>"0"
|
2255
|
-
#
|
2273
|
+
#12.0 end
|
2256
2274
|
#<xs:attribute name="numExtCaptures" type="xs:integer" use="optional" />
|
2257
2275
|
#<xs:attribute name="extCaptureAmount" type="xp:batchTotalAmountType" use="optional" />
|
2258
2276
|
text_node :numCredits, "@numCredits", :default_value=>"0"
|
2259
2277
|
text_node :creditAmount, "@creditAmount", :default_value=>"0"
|
2260
|
-
#
|
2278
|
+
#12.0 begin
|
2261
2279
|
text_node :numGiftCardCredits, "@numGiftCardCredits", :default_value=>"0"
|
2262
2280
|
text_node :giftCardCreditAmount, "@giftCardCreditAmount", :default_value=>"0"
|
2263
|
-
#
|
2281
|
+
#12.0 end
|
2264
2282
|
text_node :numForceCaptures, "@numForceCaptures", :default_value=>"0"
|
2265
2283
|
text_node :forceCaptureAmount, "@forceCaptureAmount", :default_value=>"0"
|
2266
2284
|
text_node :numSales, "@numSales", :default_value=>"0"
|
@@ -2301,7 +2319,8 @@ end
|
|
2301
2319
|
text_node :numVendorCredit , "@numVendorCredit", :default_value=>"0"
|
2302
2320
|
text_node :numPhysicalCheckDebit , "@numPhysicalCheckDebit", :default_value=>"0"
|
2303
2321
|
text_node :numPhysicalCheckCredit , "@numPhysicalCheckCredit", :default_value=>"0"
|
2304
|
-
text_node :numFundingInstructionVoid, "@numFundingInstructionVoid", :default_value=>"0"
|
2322
|
+
text_node :numFundingInstructionVoid, "@numFundingInstructionVoid", :default_value=>"0"
|
2323
|
+
text_node :numFastAccessFunding, "@numFastAccessFunding", :default_value=>"0"
|
2305
2324
|
text_node :payFacCreditAmount , "@payFacCreditAmount", :default_value=>"0"
|
2306
2325
|
text_node :payFacDebitAmount , "@payFacDebitAmount", :default_value=>"0"
|
2307
2326
|
text_node :submerchantCreditAmount , "@submerchantCreditAmount", :default_value=>"0"
|
@@ -2312,23 +2331,18 @@ end
|
|
2312
2331
|
text_node :vendorCreditAmount , "@vendorCreditAmount", :default_value=>"0"
|
2313
2332
|
text_node :physicalCheckDebitAmount , "@physicalCheckDebitAmount", :default_value=>"0"
|
2314
2333
|
text_node :physicalCheckCreditAmount , "@physicalCheckCreditAmount", :default_value=>"0"
|
2315
|
-
|
2316
|
-
text_node :sameDayFunding, "@sameDayFunding", :default_value=>"0"
|
2317
|
-
# text_node :numFastAccessFunding, "@numFastAccessFunding", :default_value=>"0"
|
2318
|
-
# text_node :fastAccessFundingAmount, "@fastAccessFundingAmount", :default_value=>"0"
|
2319
|
-
|
2320
|
-
#11.4 End
|
2334
|
+
text_node :fastAccessFundingAmount , "@fastAccessFundingAmount", :default_value=>"0"
|
2321
2335
|
text_node :merchantId, "@merchantId", :default_value=>nil
|
2322
2336
|
end
|
2323
2337
|
|
2324
|
-
class
|
2338
|
+
class CnpRequest
|
2325
2339
|
include XML::Mapping
|
2326
|
-
# version="6.0" xmlns="http://www.
|
2340
|
+
# version="6.0" xmlns="http://www.vantivcnp.com/schema" numBatchRequests = "1">
|
2327
2341
|
# <authentication>
|
2328
2342
|
# <user>XMLTESTV6ORG14</user>
|
2329
2343
|
# <password>password</password>
|
2330
2344
|
# </authentication>
|
2331
|
-
root_element_name "
|
2345
|
+
root_element_name "cnpRequest"
|
2332
2346
|
|
2333
2347
|
text_node :version, "@version", :default_value=>"0"
|
2334
2348
|
text_node :xmlns, "@xmlns", :default_value=>nil
|
@@ -2346,52 +2360,28 @@ end
|
|
2346
2360
|
text_node :postDay, "postDay", :default_value=>nil
|
2347
2361
|
end
|
2348
2362
|
|
2349
|
-
class
|
2363
|
+
class CnpRFRRequest
|
2350
2364
|
include XML::Mapping
|
2351
2365
|
root_element_name "RFRRequest"
|
2352
|
-
optional_choice_node :if, '
|
2366
|
+
optional_choice_node :if, 'cnpSessionId', :then, (text_node :cnpSessionId, "cnpSessionId"),
|
2353
2367
|
:elsif, 'accountUpdateFileRequestData', :then, (object_node :accountUpdateFileRequestData, "accountUpdateFileRequestData", :class=>AccountUpdateFileRequestData)
|
2354
2368
|
end
|
2355
2369
|
|
2356
|
-
class
|
2370
|
+
class CnpRequestForRFR
|
2357
2371
|
include XML::Mapping
|
2358
|
-
root_element_name "
|
2372
|
+
root_element_name "cnpRequest"
|
2359
2373
|
text_node :version, "@version", :default_value=>"0"
|
2360
2374
|
text_node :xmlns, "@xmlns", :default_value=>nil
|
2361
2375
|
text_node :numBatchRequests, "@numBatchRequests", :default_value=>nil
|
2362
2376
|
object_node :authentication, "authentication", :class=>Authentication
|
2363
|
-
object_node :rfrRequest, 'RFRRequest', :class=>
|
2377
|
+
object_node :rfrRequest, 'RFRRequest', :class=>CnpRFRRequest
|
2364
2378
|
end
|
2365
2379
|
|
2366
2380
|
|
2367
|
-
|
2368
|
-
include XML::Mapping
|
2369
|
-
root_element_name "fastAccessFunding"
|
2370
|
-
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
2371
|
-
text_node :transactionId, "@id", :default_value=>nil
|
2372
|
-
text_node :customerId, "@customerId", :default_value=>nil
|
2373
|
-
text_node :fundingSubmerchantId, "@fundingSubmerchantId", :default_value=>nil
|
2374
|
-
text_node :submerchantName, "@submerchantName", :default_value=>nil
|
2375
|
-
text_node :fundsTransferId, "@fundsTransferId", :default_value=>nil
|
2376
|
-
text_node :amount, "@amount", :default_value=>nil
|
2377
|
-
optional_choice_node :if, 'card', :then, (object_node :card, "card", :class=>Card, :default_value=>nil),
|
2378
|
-
:elsif, 'token', :then, (object_node :token, "token", :class=>CardToken, :default_value=>nil),
|
2379
|
-
:elsif, 'paypage', :then, (object_node :paypage, "paypage", :class=>CardPaypage, :default_value=>nil)
|
2380
|
-
end
|
2381
|
-
|
2382
|
-
class ServiceStatusRequest
|
2383
|
-
include XML::Mapping
|
2384
|
-
root_element_name "serviceStatusRequest"
|
2385
|
-
text_node :reportGroup, "@reportGroup", :default_value=>nil
|
2386
|
-
text_node :transactionId, "@id", :default_value=>nil
|
2387
|
-
text_node :customerId, "@customerId", :default_value=>nil
|
2388
|
-
|
2389
|
-
text_node :serviceId, "@serviceId", :default_value=>nil
|
2390
|
-
text_node :pathId, "@pathId", :default_value=>nil
|
2391
|
-
end
|
2381
|
+
|
2392
2382
|
|
2393
2383
|
# begin
|
2394
|
-
# class
|
2384
|
+
# class CnpOnlineResponse
|
2395
2385
|
# attr_accessor :message
|
2396
2386
|
# end
|
2397
2387
|
#
|