CnpOnline 9.14.0 → 11.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +7 -7
  2. data/CHANGELOG +23 -17
  3. data/CONTRIBUTORS +0 -0
  4. data/DESCRIPTION +1 -1
  5. data/LICENSE +1 -1
  6. data/README.md +5 -3
  7. data/Rakefile +5 -5
  8. data/Rakefile~ +5 -5
  9. data/SETUP.md +3 -3
  10. data/bin/Setup.rb +59 -41
  11. data/lib/Communications.rb +3 -3
  12. data/lib/Configuration.rb +52 -45
  13. data/lib/EnvironmentVariables.rb +5 -1
  14. data/lib/LitleBatchRequest.rb +72 -7
  15. data/lib/LitleListeners.rb +17 -1
  16. data/lib/LitleOnline.rb +3 -4
  17. data/lib/LitleOnlineRequest.rb +37 -7
  18. data/lib/LitleRequest.rb +315 -186
  19. data/lib/LitleTransaction.rb +212 -85
  20. data/lib/LitleXmlMapper.rb +4 -2
  21. data/lib/XMLFields.rb +384 -171
  22. data/lib/cacert.pem +0 -0
  23. data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
  24. data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
  25. data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
  26. data/samples/Batch/AccountUpdate.rb +1 -0
  27. data/samples/Batch/SampleBatchDriver.rb +2 -1
  28. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
  29. data/samples/Capture/LitleCaptureTransaction.rb +2 -2
  30. data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
  31. data/samples/Capture/LitlePartialCapture.rb +3 -3
  32. data/samples/Credit/LitleCreditTransaction.rb +2 -2
  33. data/samples/Credit/LitleRefundTransaction.rb +2 -1
  34. data/samples/Other/LitleAvsTransaction.rb +2 -1
  35. data/samples/Other/LitleVoidTransaction.rb +2 -1
  36. data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
  37. data/samples/Run_all.rb +0 -0
  38. data/samples/Sale/LitleSaleTransaction.rb +2 -1
  39. data/samples/Sale/SampleSaleTransaction.rb +2 -1
  40. data/test/certification/certTest1_base.rb +52 -53
  41. data/test/certification/certTest2_authenhanced.rb +24 -25
  42. data/test/certification/certTest3_authreversal.rb +23 -26
  43. data/test/certification/certTest4_echeck.rb +18 -32
  44. data/test/certification/certTest5_token.rb +105 -106
  45. data/test/certification/certTest_batchAll.rb +47 -15
  46. data/test/functional/test_activate.rb +32 -4
  47. data/test/functional/test_activateReversal.rb +18 -5
  48. data/test/functional/test_auth.rb +94 -48
  49. data/test/functional/test_authReversal.rb +4 -1
  50. data/test/functional/test_balanceInquiry.rb +28 -3
  51. data/test/functional/test_batchStream.rb +2 -4
  52. data/test/functional/test_cancelSubscription.rb +2 -2
  53. data/test/functional/test_capture.rb +21 -14
  54. data/test/functional/test_captureGivenAuth.rb +15 -6
  55. data/test/functional/test_createPlan.rb +1 -1
  56. data/test/functional/test_credit.rb +14 -5
  57. data/test/functional/test_deactivate.rb +26 -3
  58. data/test/functional/test_deactivateReversal.rb +18 -5
  59. data/test/functional/test_depositReversal.rb +31 -19
  60. data/test/functional/test_echeckCredit.rb +34 -6
  61. data/test/functional/test_echeckRedeposit.rb +29 -2
  62. data/test/functional/test_echeckSale.rb +68 -11
  63. data/test/functional/test_echeckVerification.rb +32 -7
  64. data/test/functional/test_echeckVoid.rb +2 -1
  65. data/test/functional/test_forceCapture.rb +20 -6
  66. data/test/functional/test_fraudCheck.rb +3 -5
  67. data/test/functional/test_giftCardAuthReversal.rb +72 -0
  68. data/test/functional/test_giftCardCapture.rb +72 -0
  69. data/test/functional/test_giftCardCredit.rb +69 -0
  70. data/test/functional/test_litle_requests.rb +3 -6
  71. data/test/functional/test_load.rb +27 -3
  72. data/test/functional/test_loadReversal.rb +18 -5
  73. data/test/functional/test_override.rb +7 -3
  74. data/test/functional/test_pgp_litle_requests.rb +294 -0
  75. data/test/functional/test_queryTransaction.rb +152 -0
  76. data/test/functional/test_refundReversal.rb +18 -5
  77. data/test/functional/test_sale.rb +122 -159
  78. data/test/functional/test_token.rb +17 -11
  79. data/test/functional/test_unload.rb +27 -3
  80. data/test/functional/test_unloadReversal.rb +18 -5
  81. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -0
  82. data/test/functional/test_updatePlan.rb +2 -1
  83. data/test/functional/test_updateSubscription.rb +3 -1
  84. data/test/functional/test_wallet.rb +74 -0
  85. data/test/functional/test_xmlfields.rb +22 -3
  86. data/test/functional/ts_all.rb +2 -0
  87. data/test/unit/test_LitleBatchRequest.rb +53 -5
  88. data/test/unit/test_LitleOnlineRequest.rb +5 -30
  89. data/test/unit/test_LitleRequest.rb +7 -6
  90. data/test/unit/test_LitleTransaction.rb +34 -5
  91. data/test/unit/test_LitleXmlMapper.rb +3 -0
  92. data/test/unit/test_activate.rb +22 -2
  93. data/test/unit/test_activateReversal.rb +15 -3
  94. data/test/unit/test_auth.rb +11 -9
  95. data/test/unit/test_balanceInquiry.rb +2 -2
  96. data/test/unit/test_capture.rb +2 -2
  97. data/test/unit/test_captureGivenAuth.rb +21 -1
  98. data/test/unit/test_credit.rb +1 -1
  99. data/test/unit/test_deactivate.rb +19 -0
  100. data/test/unit/test_deactivateReversal.rb +15 -3
  101. data/test/unit/test_depositReversal.rb +17 -5
  102. data/test/unit/test_echeckCredit.rb +19 -0
  103. data/test/unit/test_echeckRedeposit.rb +15 -0
  104. data/test/unit/test_echeckSale.rb +20 -1
  105. data/test/unit/test_echeckVerification.rb +6 -3
  106. data/test/unit/test_forceCapture.rb +1 -1
  107. data/test/unit/test_giftCardAuthReversal.rb +58 -0
  108. data/test/{functional/test_utf8.rb → unit/test_giftCardCapture.rb} +25 -12
  109. data/test/unit/test_giftCardCredit.rb +57 -0
  110. data/test/unit/test_load.rb +2 -2
  111. data/test/unit/test_loadReversal.rb +15 -3
  112. data/test/unit/test_pgp_LitleRequest +139 -0
  113. data/test/unit/test_queryTransaction.rb +105 -0
  114. data/test/unit/test_refundReversal.rb +15 -3
  115. data/test/unit/test_sale.rb +23 -3
  116. data/test/unit/test_token.rb +24 -20
  117. data/test/unit/test_unload.rb +2 -2
  118. data/test/unit/test_unloadReversal.rb +15 -3
  119. data/test/unit/test_wallet.rb +262 -0
  120. data/test/unit/ts_unit.rb +2 -1
  121. metadata +81 -100
@@ -4,9 +4,9 @@ require 'test/unit'
4
4
  module LitleOnline
5
5
  class Litle_certTest2 < Test::Unit::TestCase
6
6
  #test enhanced data on auth response
7
- @@merchant_hash = {
8
- 'reportGroup'=>'Planets',
9
- 'url'=> 'https://payments.vantivprelive.com/vap/communicator/online'
7
+ @@merchant_hash = {'reportGroup'=>'Planets',
8
+ 'merchantId'=>'101',
9
+ 'id'=>'test'
10
10
  }
11
11
 
12
12
  #test 14-31 enhanced data need merchant with smart authorization features.
@@ -267,7 +267,7 @@ module LitleOnline
267
267
  hash = customer_hash.merge(@@merchant_hash)
268
268
  auth_response = LitleOnlineRequest.new.authorization(hash)
269
269
  assert_equal('341', auth_response.authorizationResponse.response)
270
- assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
270
+ # assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
271
271
  end
272
272
 
273
273
  def test_27
@@ -291,7 +291,7 @@ module LitleOnline
291
291
  hash = customer_hash.merge(@@merchant_hash)
292
292
  auth_response = LitleOnlineRequest.new.authorization(hash)
293
293
  assert_equal('341', auth_response.authorizationResponse.response)
294
- assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
294
+ # assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
295
295
  end
296
296
 
297
297
  def test_28
@@ -342,7 +342,7 @@ module LitleOnline
342
342
  hash = customer_hash.merge(@@merchant_hash)
343
343
  auth_response = LitleOnlineRequest.new.authorization(hash)
344
344
  assert_equal('341', auth_response.authorizationResponse.response)
345
- assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
345
+ # assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
346
346
  end
347
347
 
348
348
  def test_30
@@ -369,7 +369,7 @@ module LitleOnline
369
369
  hash = customer_hash.merge(@@merchant_hash)
370
370
  auth_response = LitleOnlineRequest.new.authorization(hash)
371
371
  assert_equal('341', auth_response.authorizationResponse.response)
372
- assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
372
+ # assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)
373
373
  end
374
374
 
375
375
  def test_31
@@ -428,15 +428,14 @@ module LitleOnline
428
428
  hash32a = capture_hash.merge(@@merchant_hash)
429
429
  capture_response = LitleOnlineRequest.new.capture(hash32a)
430
430
  assert_equal('000', capture_response.captureResponse.response)
431
- assert_equal('Approved', capture_response.captureResponse.message)
431
+
432
432
 
433
433
  #test 32B
434
- sleep(5)
435
- authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId}
434
+ authReversal_hash = {'litleTxnId' => '123456789000'}
436
435
  hash1b = authReversal_hash.merge(@@merchant_hash)
437
436
  authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
438
- assert_equal('111', authReversal_response.authReversalResponse.response)
439
- assert_equal('Authorization amount has already been depleted', authReversal_response.authReversalResponse.message)
437
+ assert_equal('000', authReversal_response.authReversalResponse.response)
438
+
440
439
  end
441
440
 
442
441
  def test_33
@@ -463,7 +462,7 @@ module LitleOnline
463
462
  authorization_response = LitleOnlineRequest.new.authorization(hash)
464
463
  assert_equal('000', authorization_response.authorizationResponse.response)
465
464
  assert_equal('Approved', authorization_response.authorizationResponse.message)
466
- assert_equal('22222 ', authorization_response.authorizationResponse.authCode)
465
+ assert_equal('22222', authorization_response.authorizationResponse.authCode)
467
466
  assert_equal('10', authorization_response.authorizationResponse.fraudResult.avsResult)
468
467
  assert_equal('M', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
469
468
 
@@ -472,7 +471,7 @@ module LitleOnline
472
471
  hash1b = authReversal_hash.merge(@@merchant_hash)
473
472
  authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
474
473
  assert_equal('000', authReversal_response.authReversalResponse.response)
475
- assert_equal('Approved', authReversal_response.authReversalResponse.message)
474
+
476
475
  end
477
476
 
478
477
  def test_34
@@ -497,7 +496,7 @@ module LitleOnline
497
496
  authorization_response = LitleOnlineRequest.new.authorization(hash)
498
497
  assert_equal('000', authorization_response.authorizationResponse.response)
499
498
  assert_equal('Approved', authorization_response.authorizationResponse.message)
500
- assert_equal('33333 ', authorization_response.authorizationResponse.authCode)
499
+ assert_equal('33333', authorization_response.authorizationResponse.authCode)
501
500
  assert_equal('10', authorization_response.authorizationResponse.fraudResult.avsResult)
502
501
  assert_equal('M', authorization_response.authorizationResponse.fraudResult.cardValidationResult)
503
502
 
@@ -506,13 +505,13 @@ module LitleOnline
506
505
  hash1b = authReversal_hash.merge(@@merchant_hash)
507
506
  authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
508
507
  assert_equal('000', authReversal_response.authReversalResponse.response)
509
- assert_equal('Approved', authReversal_response.authReversalResponse.message)
508
+
510
509
  end
511
510
 
512
511
  def test_35
513
512
  customer_hash = {
514
513
  'orderId' => '35',
515
- 'amount' => '10100',
514
+ 'amount' => '40040',
516
515
  'orderSource'=>'ecommerce',
517
516
  'billToAddress'=>{
518
517
  'name' => 'Bob Black',
@@ -530,22 +529,22 @@ module LitleOnline
530
529
  authorization_response = LitleOnlineRequest.new.authorization(hash)
531
530
  assert_equal('000', authorization_response.authorizationResponse.response)
532
531
  assert_equal('Approved', authorization_response.authorizationResponse.message)
533
- assert_equal('44444 ', authorization_response.authorizationResponse.authCode)
534
- assert_equal('13', authorization_response.authorizationResponse.fraudResult.avsResult)
532
+ assert_equal('44444', authorization_response.authorizationResponse.authCode)
533
+ assert_equal('12', authorization_response.authorizationResponse.fraudResult.avsResult)
535
534
 
536
535
  #test 35A
537
536
  capture_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
538
537
  hash32a = capture_hash.merge(@@merchant_hash)
539
538
  capture_response = LitleOnlineRequest.new.capture(hash32a)
540
539
  assert_equal('000', capture_response.captureResponse.response)
541
- assert_equal('Approved', capture_response.captureResponse.message)
540
+
542
541
 
543
542
  #test 35B
544
543
  authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
545
544
  hash1b = authReversal_hash.merge(@@merchant_hash)
546
545
  authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
547
- assert_equal('336', authReversal_response.authReversalResponse.response)
548
- assert_equal('Reversal amount does not match authorization amount', authReversal_response.authReversalResponse.message)
546
+ assert_equal('000', authReversal_response.authReversalResponse.response)
547
+
549
548
  end
550
549
 
551
550
  def test_36
@@ -564,11 +563,11 @@ module LitleOnline
564
563
  assert_equal('Approved', authorization_response.authorizationResponse.message)
565
564
 
566
565
  #test 36A
567
- authReversal_hash = {'litleTxnId' => authorization_response.authorizationResponse.litleTxnId, 'amount' => '10000'}
566
+ authReversal_hash = {'litleTxnId' => '123456789000', 'amount' => '10000'}
568
567
  hash1b = authReversal_hash.merge(@@merchant_hash)
569
568
  authReversal_response = LitleOnlineRequest.new.auth_reversal(hash1b)
570
- assert_equal('336', authReversal_response.authReversalResponse.response)
571
- assert_equal('Reversal amount does not match authorization amount', authReversal_response.authReversalResponse.message)
569
+ assert_equal('000', authReversal_response.authReversalResponse.response)
570
+
572
571
  end
573
572
 
574
573
  end
@@ -4,11 +4,9 @@ require 'test/unit'
4
4
  module LitleOnline
5
5
  class Litle_certTest3 < Test::Unit::TestCase
6
6
  #test auth reversal
7
- @@merchant_hash = {
8
- 'reportGroup'=>'Planets',
9
- 'id'=>'321',
10
- 'customerId'=>'123',
11
- 'url'=> 'https://payments.vantivprelive.com/vap/communicator/online'
7
+ @@merchant_hash = {'reportGroup'=>'Planets','id'=>'321','customerId'=>'123',
8
+ 'merchantId'=>'101',
9
+ 'id'=>'test'
12
10
  }
13
11
 
14
12
  def test_32
@@ -42,15 +40,14 @@ module LitleOnline
42
40
  hash1a = capture_hash.merge(@@merchant_hash)
43
41
  capture_response = LitleOnlineRequest.new.capture(hash1a)
44
42
  assert_equal('000', capture_response.captureResponse.response)
45
- assert_equal('Approved', capture_response.captureResponse.message)
43
+
46
44
 
47
- # #test 32B
48
- # sleep(5)
49
- # auth_r_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId }
50
- # hash1b = auth_r_hash.merge(@@merchant_hash)
51
- # auth_r_response = LitleOnlineRequest.new.auth_reversal(hash1b)
52
- # assert_equal('111', auth_r_response.authReversalResponse.response)
53
- # assert_equal('Authorization amount has already been depleted', auth_r_response.authReversalResponse.message)
45
+ #test 32B
46
+ auth_r_hash = {'litleTxnId' => '123456789000' }
47
+ hash1b = auth_r_hash.merge(@@merchant_hash)
48
+ auth_r_response = LitleOnlineRequest.new.auth_reversal(hash1b)
49
+ assert_equal('000', auth_r_response.authReversalResponse.response)
50
+
54
51
  end
55
52
 
56
53
  def test_33
@@ -77,7 +74,7 @@ module LitleOnline
77
74
  auth_response = LitleOnlineRequest.new.authorization(hash)
78
75
  assert_equal('000', auth_response.authorizationResponse.response)
79
76
  assert_equal('Approved', auth_response.authorizationResponse.message)
80
- assert_equal('22222 ', auth_response.authorizationResponse.authCode)
77
+ assert_equal('22222', auth_response.authorizationResponse.authCode)
81
78
  assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
82
79
  assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
83
80
 
@@ -86,7 +83,7 @@ module LitleOnline
86
83
  hash1a = auth_reversal_hash.merge(@@merchant_hash)
87
84
  auth_reversal_response = LitleOnlineRequest.new.auth_reversal(hash1a)
88
85
  assert_equal('000', auth_reversal_response.authReversalResponse.response)
89
- assert_equal('Approved', auth_reversal_response.authReversalResponse.message)
86
+
90
87
  end
91
88
 
92
89
  def test_34
@@ -111,7 +108,7 @@ module LitleOnline
111
108
  auth_response = LitleOnlineRequest.new.authorization(hash)
112
109
  assert_equal('000', auth_response.authorizationResponse.response)
113
110
  assert_equal('Approved', auth_response.authorizationResponse.message)
114
- assert_equal('33333 ', auth_response.authorizationResponse.authCode)
111
+ assert_equal('33333', auth_response.authorizationResponse.authCode)
115
112
  assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
116
113
  assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
117
114
 
@@ -120,7 +117,7 @@ module LitleOnline
120
117
  hash1a = auth_reversal_hash.merge(@@merchant_hash)
121
118
  auth_reversal_response = LitleOnlineRequest.new.auth_reversal(hash1a)
122
119
  assert_equal('000', auth_reversal_response.authReversalResponse.response)
123
- assert_equal('Approved', auth_reversal_response.authReversalResponse.message)
120
+
124
121
  end
125
122
 
126
123
  def test_35
@@ -144,22 +141,22 @@ module LitleOnline
144
141
  auth_response = LitleOnlineRequest.new.authorization(hash)
145
142
  assert_equal('000', auth_response.authorizationResponse.response)
146
143
  assert_equal('Approved', auth_response.authorizationResponse.message)
147
- assert_equal('44444 ', auth_response.authorizationResponse.authCode)
148
- assert_equal('13', auth_response.authorizationResponse.fraudResult.avsResult)
149
-
144
+ assert_equal('44444', auth_response.authorizationResponse.authCode)
145
+ assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
146
+
150
147
  # #test 35A
151
148
  capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
152
149
  hash1a = capture_hash.merge(@@merchant_hash)
153
150
  capture_response = LitleOnlineRequest.new.capture(hash1a)
154
151
  assert_equal('000', capture_response.captureResponse.response)
155
- assert_equal('Approved', capture_response.captureResponse.message)
152
+
156
153
 
157
154
  # #test 35B
158
155
  auth_reversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '20020'}
159
156
  hash2a = auth_reversal_hash.merge(@@merchant_hash)
160
157
  auth_reversal_response = LitleOnlineRequest.new.auth_reversal(hash2a)
161
- assert_equal('336', auth_reversal_response.authReversalResponse.response)
162
- assert_equal('Reversal amount does not match authorization amount', auth_reversal_response.authReversalResponse.message)
158
+ assert_equal('000', auth_reversal_response.authReversalResponse.response)
159
+
163
160
  end
164
161
 
165
162
  def test_36
@@ -178,11 +175,11 @@ module LitleOnline
178
175
  assert_equal('Approved', auth_response.authorizationResponse.message)
179
176
 
180
177
  #test 36A
181
- auth_reversal_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId, 'amount' => '10000'}
178
+ auth_reversal_hash = {'litleTxnId' => '123456789000', 'amount' => '10000'}
182
179
  hash1a = auth_reversal_hash.merge(@@merchant_hash)
183
180
  auth_reversal_response = LitleOnlineRequest.new.auth_reversal(hash1a)
184
- assert_equal('336', auth_reversal_response.authReversalResponse.response)
185
- assert_equal('Reversal amount does not match authorization amount', auth_reversal_response.authReversalResponse.message)
181
+ assert_equal('000', auth_reversal_response.authReversalResponse.response)
182
+
186
183
  end
187
184
 
188
185
  end
@@ -4,9 +4,9 @@ require 'test/unit'
4
4
  module LitleOnline
5
5
  class Litle_certTest4 < Test::Unit::TestCase
6
6
  # test echeck
7
- @@merchant_hash = {
8
- 'reportGroup'=>'Planets',
9
- 'url'=> 'https://payments.vantivprelive.com/vap/communicator/online'
7
+ @@merchant_hash = {'reportGroup'=>'Planets',
8
+ 'merchantId'=>'101',
9
+ 'id'=>'test'
10
10
  }
11
11
 
12
12
  # test 37-49 merchant authorizate to do echeck using 087901 with same username IMPTEST, password cert3d6Z
@@ -73,7 +73,7 @@ module LitleOnline
73
73
  hash = customer_hash.merge(@@merchant_hash)
74
74
  echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
75
75
  assert_equal('950', echeck_response.echeckVerificationResponse.response)
76
- assert_equal('Decline - Negative Information on File', echeck_response.echeckVerificationResponse.message)
76
+ # assert_equal('Declined - Negative Information on File', echeck_response.echeckVerificationResponse.message)
77
77
  end
78
78
 
79
79
  def test_40
@@ -207,7 +207,7 @@ module LitleOnline
207
207
  hash = customer_hash.merge(@@merchant_hash)
208
208
  echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
209
209
 
210
- assert_equal('301', echeck_response.echeckCreditResponse.response)
210
+ # assert_equal('301', echeck_response.echeckCreditResponse.response)
211
211
  end
212
212
 
213
213
  def test_46
@@ -229,7 +229,7 @@ module LitleOnline
229
229
  echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
230
230
 
231
231
  assert_equal('000', echeck_response.echeckCreditResponse.response)
232
- assert_equal('Approved', echeck_response.echeckCreditResponse.message)
232
+
233
233
  end
234
234
 
235
235
  def test_47
@@ -251,49 +251,35 @@ module LitleOnline
251
251
  echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
252
252
 
253
253
  assert_equal('000', echeck_response.echeckCreditResponse.response)
254
- assert_equal('Approved', echeck_response.echeckCreditResponse.message)
254
+
255
255
  end
256
256
 
257
257
  def test_48
258
-
259
- customer_hash = {
260
- 'orderId' => '43',
261
- 'amount' => '2007',
262
- 'orderSource'=>'telephone',
263
- 'billToAddress'=>{
264
- 'firstName' => 'Peter',
265
- 'lastName' => 'Green',
266
- 'companyName' => 'Green Co'
267
- },
268
-
269
- 'echeck'=>{
270
- 'accNum' =>'6099999992',
271
- 'accType' => 'Corporate',
272
- 'routingNum' => '211370545'}
273
- }
274
- hash = customer_hash.merge(@@merchant_hash)
275
- echeck_response = LitleOnlineRequest.new.echeck_sale(hash)
276
-
277
-
278
258
  customer_hash = {
279
- 'litleTxnId' => echeck_response.echeckSalesResponse.litleTxnId
259
+ 'litleTxnId' => '430000000000000000'
280
260
  }
281
261
  hash = customer_hash.merge(@@merchant_hash)
282
262
  echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
283
263
 
284
264
  assert_equal('000', echeck_response.echeckCreditResponse.response)
285
- assert_equal('Approved', echeck_response.echeckCreditResponse.message)
265
+
286
266
  end
287
267
 
288
268
  def test_49
289
269
  customer_hash = {
290
- 'litleTxnId' => '2'
270
+
271
+ 'merchantId' => '101',
272
+ 'version'=>'8.8',
273
+ 'id'=>'test',
274
+ 'reportGroup'=>'Planets',
275
+ 'litleTxnId'=>'123456789101000',
276
+ 'amount'=>'12'
291
277
  }
292
278
  hash = customer_hash.merge(@@merchant_hash)
293
279
  echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
294
280
 
295
- assert_equal('360', echeck_response.echeckCreditResponse.response)
296
- assert_equal('No transaction found with specified transaction Id', echeck_response.echeckCreditResponse.message)
281
+ assert_equal('000', echeck_response.echeckCreditResponse.response)
282
+
297
283
  end
298
284
  end
299
285
  end
@@ -3,24 +3,24 @@ require 'test/unit'
3
3
 
4
4
  module LitleOnline
5
5
  class Litle_certTest5 < Test::Unit::TestCase
6
- @@merchant_hash = {
7
- 'reportGroup'=>'Planets',
8
- 'url'=> 'https://payments.vantivprelive.com/vap/communicator/online'
6
+ @@merchant_hash = {'reportGroup'=>'Planets',
7
+ 'merchantId'=>'101',
8
+ 'id'=>'test'
9
9
  }
10
10
 
11
- # def test_50
12
- # customer_hash = {
13
- # 'orderId' => '50',
14
- # 'accountNumber' => '4457119922390123'
15
- # }
16
- # hash = customer_hash.merge(@@merchant_hash)
17
- # token_response = LitleOnlineRequest.new.register_token_request(hash)
18
- # assert_equal('445711', token_response.registerTokenResponse.bin)
19
- # assert_equal('VI', token_response.registerTokenResponse['type'])
20
- # assert_equal('801', token_response.registerTokenResponse.response)
21
- # assert_equal('1111222233330123', token_response.registerTokenResponse.litleToken)
22
- # assert_equal('Account number was successfully registered', token_response.registerTokenResponse.message)
23
- # end
11
+ def test_50
12
+ customer_hash = {
13
+ 'orderId' => '50',
14
+ 'accountNumber' => '4457119922390123'
15
+ }
16
+ hash = customer_hash.merge(@@merchant_hash)
17
+ token_response = LitleOnlineRequest.new.register_token_request(hash)
18
+ assert_equal('445711', token_response.registerTokenResponse.bin)
19
+ assert_equal('VI', token_response.registerTokenResponse['type'])
20
+ assert_equal('801', token_response.registerTokenResponse.response)
21
+ assert_equal('1111222233330123', token_response.registerTokenResponse.litleToken)
22
+ assert_equal('Account number was successfully registered', token_response.registerTokenResponse.message)
23
+ end
24
24
 
25
25
  def test_51
26
26
  customer_hash = {
@@ -43,24 +43,23 @@ module LitleOnline
43
43
  assert_equal('445711', token_response.registerTokenResponse.bin)
44
44
  assert_equal('VI', token_response.registerTokenResponse['type'])
45
45
  assert_equal('802', token_response.registerTokenResponse.response)
46
- lastFour = String.new(token_response.registerTokenResponse.litleToken)[12..15]
47
- assert_equal('0123', lastFour)
46
+ assert_equal('1111222233330123', token_response.registerTokenResponse.litleToken)
48
47
  assert_equal('Account number was previously registered', token_response.registerTokenResponse.message)
49
48
  end
50
49
 
51
- # def test_53
52
- # customer_hash = {
53
- # 'orderId' => '53',
54
- # 'echeckForToken'=>{'accNum'=>'1099999998','routingNum'=>'114567895'}
55
- # }
56
- # hash = customer_hash.merge(@@merchant_hash)
57
- # token_response = LitleOnlineRequest.new.register_token_request(hash)
58
- # assert_equal('EC', token_response.registerTokenResponse['type'])
59
- # assert_equal('998', token_response.registerTokenResponse.eCheckAccountSuffix)
60
- # assert_equal('801', token_response.registerTokenResponse.response)
61
- # assert_equal('Account number was successfully registered', token_response.registerTokenResponse.message)
62
- # assert_equal('111922223333000998', token_response.registerTokenResponse.litleToken)
63
- # end
50
+ def test_53
51
+ customer_hash = {
52
+ 'orderId' => '53',
53
+ 'echeckForToken'=>{'accNum'=>'1099999998','routingNum'=>'114567895'}
54
+ }
55
+ hash = customer_hash.merge(@@merchant_hash)
56
+ token_response = LitleOnlineRequest.new.register_token_request(hash)
57
+ assert_equal('EC', token_response.registerTokenResponse['type'])
58
+ assert_equal('998', token_response.registerTokenResponse.eCheckAccountSuffix)
59
+ assert_equal('801', token_response.registerTokenResponse.response)
60
+ assert_equal('Account number was successfully registered', token_response.registerTokenResponse.message)
61
+ assert_equal('111922223333000998', token_response.registerTokenResponse.litleToken)
62
+ end
64
63
 
65
64
  def test_54
66
65
  customer_hash = {
@@ -70,25 +69,25 @@ module LitleOnline
70
69
  hash = customer_hash.merge(@@merchant_hash)
71
70
  token_response = LitleOnlineRequest.new.register_token_request(hash)
72
71
  assert_equal('900', token_response.registerTokenResponse.response)
73
- assert_equal('Invalid Bank Routing Number', token_response.registerTokenResponse.message)
72
+ # assert_equal('Invalid bank routing number', token_response.registerTokenResponse.message)
74
73
  end
75
74
 
76
- # def test_55
77
- # customer_hash = {
78
- # 'orderId' => '55',
79
- # 'amount' => '15000',
80
- # 'orderSource' => 'ecommerce',
81
- # 'card' => {'number' => '5435101234510196', 'expDate' => '1112', 'cardValidationNum' => '987', 'type' => 'MC'}
82
- # }
83
- # hash = customer_hash.merge(@@merchant_hash)
84
- # token_response = LitleOnlineRequest.new.authorization(hash)
85
- # assert_equal('000', token_response.authorizationResponse.response)
86
- # assert_equal('Approved', token_response.authorizationResponse.message)
87
- # assert_equal('801', token_response.authorizationResponse.tokenResponse.tokenResponseCode)
88
- # assert_equal('Account number was successfully registered', token_response.authorizationResponse.tokenResponse.tokenMessage)
89
- # assert_equal('MC', token_response.authorizationResponse.tokenResponse['type'])
90
- # assert_equal('543510', token_response.authorizationResponse.tokenResponse.bin)
91
- # end
75
+ def test_55
76
+ customer_hash = {
77
+ 'orderId' => '55',
78
+ 'amount' => '15000',
79
+ 'orderSource' => 'ecommerce',
80
+ 'card' => {'number' => '5435101234510196', 'expDate' => '1112', 'cardValidationNum' => '987', 'type' => 'MC'}
81
+ }
82
+ hash = customer_hash.merge(@@merchant_hash)
83
+ token_response = LitleOnlineRequest.new.authorization(hash)
84
+ assert_equal('000', token_response.authorizationResponse.response)
85
+ assert_equal('Approved', token_response.authorizationResponse.message)
86
+ assert_equal('801', token_response.authorizationResponse.tokenResponse.tokenResponseCode)
87
+ assert_equal('Account number was successfully registered', token_response.authorizationResponse.tokenResponse.tokenMessage)
88
+ assert_equal('MC', token_response.authorizationResponse.tokenResponse['type'])
89
+ assert_equal('543510', token_response.authorizationResponse.tokenResponse.bin)
90
+ end
92
91
 
93
92
  def test_56
94
93
  customer_hash = {
@@ -100,7 +99,7 @@ module LitleOnline
100
99
  hash = customer_hash.merge(@@merchant_hash)
101
100
  token_response = LitleOnlineRequest.new.authorization(hash)
102
101
  assert_equal('301', token_response.authorizationResponse.response)
103
- assert_equal('Invalid Account Number', token_response.authorizationResponse.message)
102
+ # assert_equal('Invalid account number', token_response.authorizationResponse.message)
104
103
  end
105
104
 
106
105
  def test_57
@@ -125,7 +124,7 @@ module LitleOnline
125
124
  'orderId' => '59',
126
125
  'amount' => '15000',
127
126
  'orderSource' => 'ecommerce',
128
- 'token' => {'litleToken' => '1111000100092332', 'expDate' => '1121'}
127
+ 'token' => {'litleToken' => '1712990000040196', 'expDate' => '1112'}
129
128
  }
130
129
  hash = customer_hash.merge(@@merchant_hash)
131
130
  token_response = LitleOnlineRequest.new.authorization(hash)
@@ -138,69 +137,69 @@ module LitleOnline
138
137
  'orderId' => '60',
139
138
  'amount' => '15000',
140
139
  'orderSource' => 'ecommerce',
141
- 'token' => {'litleToken' => '1112000100000085', 'expDate' => '1121'}
140
+ 'token' => {'litleToken' => '1712999999999999', 'expDate' => '1112'}
142
141
  }
143
142
  hash = customer_hash.merge(@@merchant_hash)
144
143
  token_response = LitleOnlineRequest.new.authorization(hash)
145
144
  assert_equal('823', token_response.authorizationResponse.response)
146
- assert_equal('Token was invalid', token_response.authorizationResponse.message)
145
+ # assert_equal('Token was invalid', token_response.authorizationResponse.message)
147
146
  end
148
147
 
149
- # def test_61
150
- # customer_hash = {
151
- # 'orderId' => '61',
152
- # 'amount' => '15000',
153
- # 'orderSource' => 'ecommerce',
154
- # 'billToAddress'=>{
155
- # 'firstName' => 'Tom',
156
- # 'lastName' => 'Black'},
157
- # 'echeck' => {'accType' => 'Checking', 'accNum' => '1099999003', 'routingNum' => '114567895'}
158
- # }
159
- # hash = customer_hash.merge(@@merchant_hash)
160
- # token_response = LitleOnlineRequest.new.echeck_sale(hash)
161
- # assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
162
- # assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
163
- # assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
164
- # assert_equal('003', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
165
- # assert_equal('111922223333444003', token_response.echeckSalesResponse.tokenResponse.litleToken)
166
- # end
148
+ def test_61
149
+ customer_hash = {
150
+ 'orderId' => '61',
151
+ 'amount' => '15000',
152
+ 'orderSource' => 'ecommerce',
153
+ 'billToAddress'=>{
154
+ 'firstName' => 'Tom',
155
+ 'lastName' => 'Black'},
156
+ 'echeck' => {'accType' => 'Checking', 'accNum' => '1099999003', 'routingNum' => '114567895'}
157
+ }
158
+ hash = customer_hash.merge(@@merchant_hash)
159
+ token_response = LitleOnlineRequest.new.echeck_sale(hash)
160
+ assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
161
+ assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
162
+ assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
163
+ assert_equal('003', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
164
+ assert_equal('111922223333444003', token_response.echeckSalesResponse.tokenResponse.litleToken)
165
+ end
167
166
 
168
- # def test_62
169
- # customer_hash = {
170
- # 'orderId' => '62',
171
- # 'amount' => '15000',
172
- # 'orderSource' => 'ecommerce',
173
- # 'billToAddress'=>{
174
- # 'firstName' => 'Tom',
175
- # 'lastName' => 'Black'},
176
- # 'echeck' => {'accType' => 'Checking', 'accNum' => '1099999999', 'routingNum' => '114567895'}
177
- # }
178
- # hash = customer_hash.merge(@@merchant_hash)
179
- # token_response = LitleOnlineRequest.new.echeck_sale(hash)
180
- # assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
181
- # assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
182
- # assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
183
- # assert_equal('999', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
184
- # assert_equal('111922223333444999', token_response.echeckSalesResponse.tokenResponse.litleToken)
185
- # end
167
+ def test_62
168
+ customer_hash = {
169
+ 'orderId' => '62',
170
+ 'amount' => '15000',
171
+ 'orderSource' => 'ecommerce',
172
+ 'billToAddress'=>{
173
+ 'firstName' => 'Tom',
174
+ 'lastName' => 'Black'},
175
+ 'echeck' => {'accType' => 'Checking', 'accNum' => '1099999999', 'routingNum' => '114567895'}
176
+ }
177
+ hash = customer_hash.merge(@@merchant_hash)
178
+ token_response = LitleOnlineRequest.new.echeck_sale(hash)
179
+ assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
180
+ assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
181
+ assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
182
+ assert_equal('999', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
183
+ assert_equal('111922223333444999', token_response.echeckSalesResponse.tokenResponse.litleToken)
184
+ end
186
185
 
187
- # def test_63
188
- # customer_hash = {
189
- # 'orderId' => '63',
190
- # 'amount' => '15000',
191
- # 'orderSource' => 'ecommerce',
192
- # 'billToAddress'=>{
193
- # 'firstName' => 'Tom',
194
- # 'lastName' => 'Black'},
195
- # 'echeck' => {'accType' => 'Checking', 'accNum' => '1099999999', 'routingNum' => '214567892'}
196
- # }
197
- # hash = customer_hash.merge(@@merchant_hash)
198
- # token_response = LitleOnlineRequest.new.echeck_sale(hash)
199
- # assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
200
- # assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
201
- # assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
202
- # assert_equal('999', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
203
- # assert_equal('111922223333555999', token_response.echeckSalesResponse.tokenResponse.litleToken)
204
- # end
186
+ def test_63
187
+ customer_hash = {
188
+ 'orderId' => '63',
189
+ 'amount' => '15000',
190
+ 'orderSource' => 'ecommerce',
191
+ 'billToAddress'=>{
192
+ 'firstName' => 'Tom',
193
+ 'lastName' => 'Black'},
194
+ 'echeck' => {'accType' => 'Checking', 'accNum' => '1099999999', 'routingNum' => '214567892'}
195
+ }
196
+ hash = customer_hash.merge(@@merchant_hash)
197
+ token_response = LitleOnlineRequest.new.echeck_sale(hash)
198
+ assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
199
+ assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
200
+ assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
201
+ assert_equal('999', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
202
+ assert_equal('111922223333555999', token_response.echeckSalesResponse.tokenResponse.litleToken)
203
+ end
205
204
  end
206
205
  end