CnpOnline 11.4.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -164
  3. data/CHANGELOG~ +0 -0
  4. data/CONTRIBUTORS +0 -2
  5. data/DESCRIPTION +1 -1
  6. data/LICENSE +0 -0
  7. data/README.md +13 -15
  8. data/Rakefile +3 -2
  9. data/Rakefile~ +4 -3
  10. data/SETUP.md +13 -10
  11. data/bin/Setup.rb +26 -22
  12. data/bin/sample_batch_driver.rb +15 -15
  13. data/bin/sample_driver.rb +5 -5
  14. data/lib/{LitleBatchRequest.rb → CnpBatchRequest.rb} +68 -66
  15. data/lib/{LitleListeners.rb → CnpListeners.rb} +48 -40
  16. data/lib/{LitleOnline.rb → CnpOnline.rb} +8 -7
  17. data/lib/{LitleOnlineRequest.rb → CnpOnlineRequest.rb} +53 -53
  18. data/lib/{LitleRequest.rb → CnpRequest.rb} +186 -192
  19. data/lib/{LitleTransaction.rb → CnpTransaction.rb} +53 -52
  20. data/lib/{LitleXmlMapper.rb → CnpXmlMapper.rb} +7 -7
  21. data/lib/Communications.rb +8 -7
  22. data/lib/Configuration.rb +7 -6
  23. data/lib/EnvironmentVariables.rb +2 -2
  24. data/lib/XMLFields.rb +98 -108
  25. data/lib/cacert.pem +0 -0
  26. data/samples/Auth/CnpAuthReversalTransaction.rb +15 -0
  27. data/samples/Auth/{LitleAuthorizationTransaction.rb → CnpAuthorizationTransaction.rb} +4 -4
  28. data/samples/Auth/{LitlePaymentFullLifeCycle.rb → CnpPaymentFullLifeCycle.rb} +11 -11
  29. data/samples/Batch/AccountUpdate.rb +11 -11
  30. data/samples/Batch/SampleBatchDriver.rb +16 -16
  31. data/samples/Capture/{LitleCaptureGivenAuthTransaction.rb → CnpCaptureGivenAuthTransaction.rb} +4 -4
  32. data/samples/Capture/CnpCaptureTransaction.rb +14 -0
  33. data/samples/Capture/{LitleForceCaptureTransaction.rb → CnpForceCaptureTransaction.rb} +5 -5
  34. data/samples/Capture/CnpPartialCapture.rb +16 -0
  35. data/samples/Credit/CnpCreditTransaction.rb +16 -0
  36. data/samples/Credit/{LitleRefundTransaction.rb → CnpRefundTransaction.rb} +4 -4
  37. data/samples/Other/{LitleAvsTransaction.rb → CnpAvsTransaction.rb} +4 -4
  38. data/samples/Other/CnpVoidTransaction.rb +19 -0
  39. data/samples/Paypage/FullPaypageLifeCycle.rb +16 -16
  40. data/samples/Run_all.rb +12 -12
  41. data/samples/Sale/{LitleSaleTransaction.rb → CnpSaleTransaction.rb} +4 -4
  42. data/samples/Sale/SampleSaleTransaction.rb +5 -5
  43. data/test/certification/certTest1_base.rb +104 -103
  44. data/test/certification/certTest2_authenhanced.rb +90 -88
  45. data/test/certification/certTest3_authreversal.rb +29 -28
  46. data/test/certification/certTest4_echeck.rb +22 -20
  47. data/test/certification/certTest5_token.rb +51 -49
  48. data/test/certification/certTest_batchAll.rb +60 -60
  49. data/test/certification/ts_all.rb +1 -1
  50. data/test/functional/test_activate.rb +9 -8
  51. data/test/functional/test_activateReversal.rb +5 -5
  52. data/test/functional/test_auth.rb +31 -30
  53. data/test/functional/test_authReversal.rb +8 -8
  54. data/test/functional/test_balanceInquiry.rb +6 -6
  55. data/test/functional/test_batch.rb +32 -32
  56. data/test/functional/test_batchStream.rb +14 -14
  57. data/test/functional/test_cancelSubscription.rb +4 -4
  58. data/test/functional/test_capture.rb +14 -14
  59. data/test/functional/test_captureGivenAuth.rb +16 -16
  60. data/test/functional/test_configuration.rb +26 -26
  61. data/test/functional/test_createPlan.rb +5 -5
  62. data/test/functional/test_credit.rb +13 -33
  63. data/test/functional/test_deactivate.rb +6 -6
  64. data/test/functional/test_deactivateReversal.rb +5 -5
  65. data/test/functional/test_depositReversal.rb +5 -5
  66. data/test/functional/test_echeckCredit.rb +20 -20
  67. data/test/functional/test_echeckRedeposit.rb +16 -16
  68. data/test/functional/test_echeckSale.rb +35 -35
  69. data/test/functional/test_echeckVerification.rb +17 -17
  70. data/test/functional/test_echeckVoid.rb +4 -4
  71. data/test/functional/test_forceCapture.rb +21 -21
  72. data/test/functional/test_fraudCheck.rb +6 -5
  73. data/test/functional/test_giftCardAuthReversal.rb +5 -5
  74. data/test/functional/test_giftCardCapture.rb +5 -5
  75. data/test/functional/test_giftCardCredit.rb +5 -5
  76. data/test/functional/test_litle_requests.rb +101 -99
  77. data/test/functional/test_load.rb +6 -6
  78. data/test/functional/test_loadReversal.rb +5 -5
  79. data/test/functional/test_override.rb +9 -9
  80. data/test/functional/{test_pgp_litle_requests.rb → test_pgp_cnp_requests.rb} +61 -60
  81. data/test/functional/test_queryTransaction.rb +10 -10
  82. data/test/functional/test_refundReversal.rb +5 -5
  83. data/test/functional/test_sale.rb +36 -36
  84. data/test/functional/test_token.rb +10 -10
  85. data/test/functional/test_unload.rb +6 -6
  86. data/test/functional/test_unloadReversal.rb +5 -5
  87. data/test/functional/test_updateCardValidationNumOnToken.rb +4 -4
  88. data/test/functional/test_updatePlan.rb +4 -4
  89. data/test/functional/test_updateSubscription.rb +5 -5
  90. data/test/functional/test_wallet.rb +5 -5
  91. data/test/functional/test_xmlfields.rb +29 -69
  92. data/test/functional/ts_all.rb +2 -2
  93. data/test/unit/test_LitleAUBatch.rb +15 -15
  94. data/test/unit/test_LitleBatchRequest.rb +42 -76
  95. data/test/unit/test_LitleOnlineRequest.rb +38 -38
  96. data/test/unit/test_LitleRequest.rb +47 -47
  97. data/test/unit/test_LitleTransaction.rb +34 -34
  98. data/test/unit/test_LitleXmlMapper.rb +27 -27
  99. data/test/unit/test_activate.rb +8 -8
  100. data/test/unit/test_activateReversal.rb +5 -5
  101. data/test/unit/test_auth.rb +43 -43
  102. data/test/unit/test_authReversal.rb +14 -14
  103. data/test/unit/test_balanceInquiry.rb +4 -4
  104. data/test/unit/test_cancelSubscription.rb +4 -4
  105. data/test/unit/test_capture.rb +20 -20
  106. data/test/unit/test_captureGivenAuth.rb +22 -22
  107. data/test/unit/test_createPlan.rb +4 -4
  108. data/test/unit/test_credit.rb +43 -43
  109. data/test/unit/test_deactivate.rb +6 -6
  110. data/test/unit/test_deactivateReversal.rb +5 -5
  111. data/test/unit/test_depositReversal.rb +5 -5
  112. data/test/unit/test_echeckCredit.rb +16 -16
  113. data/test/unit/test_echeckRedeposit.rb +19 -19
  114. data/test/unit/test_echeckSale.rb +16 -16
  115. data/test/unit/test_echeckVerification.rb +11 -11
  116. data/test/unit/test_echeckVoid.rb +8 -8
  117. data/test/unit/test_forceCapture.rb +19 -19
  118. data/test/unit/test_fraudCheck.rb +4 -4
  119. data/test/unit/test_giftCardAuthReversal.rb +5 -5
  120. data/test/unit/test_giftCardCapture.rb +5 -5
  121. data/test/unit/test_giftCardCredit.rb +5 -5
  122. data/test/unit/test_load.rb +4 -4
  123. data/test/unit/test_loadReversal.rb +5 -5
  124. data/test/unit/{test_pgp_LitleRequest → test_pgp_CnpRequest.rb} +32 -32
  125. data/test/unit/test_queryTransaction.rb +8 -8
  126. data/test/unit/test_refundReversal.rb +5 -5
  127. data/test/unit/test_sale.rb +64 -64
  128. data/test/unit/test_token.rb +13 -13
  129. data/test/unit/test_unload.rb +4 -4
  130. data/test/unit/test_unloadReversal.rb +5 -5
  131. data/test/unit/test_updateCardValidationNumOnToken.rb +16 -16
  132. data/test/unit/test_updatePlan.rb +4 -4
  133. data/test/unit/test_updateSubscription.rb +11 -11
  134. data/test/unit/test_wallet.rb +13 -13
  135. data/test/unit/test_xmlfields.rb +119 -119
  136. data/test/unit/ts_unit.rb +6 -6
  137. metadata +35 -26
  138. data/samples/Auth/LitleAuthReversalTransaction.rb +0 -15
  139. data/samples/Capture/LitleCaptureTransaction.rb +0 -14
  140. data/samples/Capture/LitlePartialCapture.rb +0 -16
  141. data/samples/Credit/LitleCreditTransaction.rb +0 -16
  142. data/samples/Other/LitleVoidTransaction.rb +0 -19
@@ -1,12 +1,14 @@
1
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
1
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
2
2
  require 'test/unit'
3
3
 
4
- module LitleOnline
5
- class Litle_certTest4 < Test::Unit::TestCase
4
+ module CnpOnline
5
+ class Cnp_certTest4 < Test::Unit::TestCase
6
6
  # test echeck
7
7
  @@merchant_hash = {'reportGroup'=>'Planets',
8
- 'merchantId'=>'101',
9
- 'id'=>'test'
8
+ 'merchantId'=>'1288791',
9
+ 'id'=>'test',
10
+ 'url'=> 'https://payments.vantivprelive.com/vap/communicator/online'
11
+
10
12
  }
11
13
 
12
14
  # test 37-49 merchant authorizate to do echeck using 087901 with same username IMPTEST, password cert3d6Z
@@ -26,7 +28,7 @@ module LitleOnline
26
28
  'routingNum' => '053100300'}
27
29
  }
28
30
  hash = customer_hash.merge(@@merchant_hash)
29
- echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
31
+ echeck_response = CnpOnlineRequest.new.echeck_verification(hash)
30
32
  assert_equal('301', echeck_response.echeckVerificationResponse.response)
31
33
  assert_equal('Invalid Account Number', echeck_response.echeckVerificationResponse.message)
32
34
  end
@@ -48,7 +50,7 @@ module LitleOnline
48
50
  'routingNum' => '053000219'}
49
51
  }
50
52
  hash = customer_hash.merge(@@merchant_hash)
51
- echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
53
+ echeck_response = CnpOnlineRequest.new.echeck_verification(hash)
52
54
  assert_equal('000', echeck_response.echeckVerificationResponse.response)
53
55
  assert_equal('Approved', echeck_response.echeckVerificationResponse.message)
54
56
  end
@@ -71,7 +73,7 @@ module LitleOnline
71
73
  'routingNum' => '053100300'}
72
74
  }
73
75
  hash = customer_hash.merge(@@merchant_hash)
74
- echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
76
+ echeck_response = CnpOnlineRequest.new.echeck_verification(hash)
75
77
  assert_equal('950', echeck_response.echeckVerificationResponse.response)
76
78
  # assert_equal('Declined - Negative Information on File', echeck_response.echeckVerificationResponse.message)
77
79
  end
@@ -94,7 +96,7 @@ module LitleOnline
94
96
  'routingNum' => '063102152'}
95
97
  }
96
98
  hash = customer_hash.merge(@@merchant_hash)
97
- echeck_response = LitleOnlineRequest.new.echeck_verification(hash)
99
+ echeck_response = CnpOnlineRequest.new.echeck_verification(hash)
98
100
  assert_equal('951', echeck_response.echeckVerificationResponse.response)
99
101
  assert_equal('Absolute Decline', echeck_response.echeckVerificationResponse.message)
100
102
  end
@@ -116,7 +118,7 @@ module LitleOnline
116
118
  'routingNum' => '053100300'}
117
119
  }
118
120
  hash = customer_hash.merge(@@merchant_hash)
119
- echeck_response = LitleOnlineRequest.new.echeck_sale(hash)
121
+ echeck_response = CnpOnlineRequest.new.echeck_sale(hash)
120
122
 
121
123
  assert_equal('301', echeck_response.echeckSalesResponse.response)
122
124
  assert_equal('Invalid Account Number', echeck_response.echeckSalesResponse.message)
@@ -137,7 +139,7 @@ module LitleOnline
137
139
  'routingNum' => '211370545'}
138
140
  }
139
141
  hash = customer_hash.merge(@@merchant_hash)
140
- echeck_response = LitleOnlineRequest.new.echeck_sale(hash)
142
+ echeck_response = CnpOnlineRequest.new.echeck_sale(hash)
141
143
 
142
144
  assert_equal('000', echeck_response.echeckSalesResponse.response)
143
145
  assert_equal('Approved', echeck_response.echeckSalesResponse.message)
@@ -160,7 +162,7 @@ module LitleOnline
160
162
  'routingNum' => '211370545'}
161
163
  }
162
164
  hash = customer_hash.merge(@@merchant_hash)
163
- echeck_response = LitleOnlineRequest.new.echeck_sale(hash)
165
+ echeck_response = CnpOnlineRequest.new.echeck_sale(hash)
164
166
 
165
167
  assert_equal('000', echeck_response.echeckSalesResponse.response)
166
168
  assert_equal('Approved', echeck_response.echeckSalesResponse.message)
@@ -183,7 +185,7 @@ module LitleOnline
183
185
  'routingNum' => '053133052'}
184
186
  }
185
187
  hash = customer_hash.merge(@@merchant_hash)
186
- echeck_response = LitleOnlineRequest.new.echeck_sale(hash)
188
+ echeck_response = CnpOnlineRequest.new.echeck_sale(hash)
187
189
 
188
190
  assert_equal('900', echeck_response.echeckSalesResponse.response)
189
191
  assert_equal('Invalid Bank Routing Number', echeck_response.echeckSalesResponse.message)
@@ -205,7 +207,7 @@ module LitleOnline
205
207
  'routingNum' => '053100300'}
206
208
  }
207
209
  hash = customer_hash.merge(@@merchant_hash)
208
- echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
210
+ echeck_response = CnpOnlineRequest.new.echeck_credit(hash)
209
211
 
210
212
  # assert_equal('301', echeck_response.echeckCreditResponse.response)
211
213
  end
@@ -226,7 +228,7 @@ module LitleOnline
226
228
  'routingNum' => '063102152'}
227
229
  }
228
230
  hash = customer_hash.merge(@@merchant_hash)
229
- echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
231
+ echeck_response = CnpOnlineRequest.new.echeck_credit(hash)
230
232
 
231
233
  assert_equal('000', echeck_response.echeckCreditResponse.response)
232
234
 
@@ -248,7 +250,7 @@ module LitleOnline
248
250
  'routingNum' => '211370545'}
249
251
  }
250
252
  hash = customer_hash.merge(@@merchant_hash)
251
- echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
253
+ echeck_response = CnpOnlineRequest.new.echeck_credit(hash)
252
254
 
253
255
  assert_equal('000', echeck_response.echeckCreditResponse.response)
254
256
 
@@ -256,10 +258,10 @@ module LitleOnline
256
258
 
257
259
  def test_48
258
260
  customer_hash = {
259
- 'litleTxnId' => '430000000000000000'
261
+ 'cnpTxnId' => '430000000000000000'
260
262
  }
261
263
  hash = customer_hash.merge(@@merchant_hash)
262
- echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
264
+ echeck_response = CnpOnlineRequest.new.echeck_credit(hash)
263
265
 
264
266
  assert_equal('000', echeck_response.echeckCreditResponse.response)
265
267
 
@@ -272,11 +274,11 @@ module LitleOnline
272
274
  'version'=>'8.8',
273
275
  'id'=>'test',
274
276
  'reportGroup'=>'Planets',
275
- 'litleTxnId'=>'123456789101000',
277
+ 'cnpTxnId'=>'123456789101000',
276
278
  'amount'=>'12'
277
279
  }
278
280
  hash = customer_hash.merge(@@merchant_hash)
279
- echeck_response = LitleOnlineRequest.new.echeck_credit(hash)
281
+ echeck_response = CnpOnlineRequest.new.echeck_credit(hash)
280
282
 
281
283
  assert_equal('000', echeck_response.echeckCreditResponse.response)
282
284
 
@@ -1,11 +1,13 @@
1
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
1
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
2
2
  require 'test/unit'
3
3
 
4
- module LitleOnline
5
- class Litle_certTest5 < Test::Unit::TestCase
4
+ module CnpOnline
5
+ class Cnp_certTest5 < Test::Unit::TestCase
6
6
  @@merchant_hash = {'reportGroup'=>'Planets',
7
- 'merchantId'=>'101',
8
- 'id'=>'test'
7
+ 'merchantId'=>'1288791',
8
+ 'id'=>'test',
9
+ 'url'=> 'https://payments.vantivprelive.com/vap/communicator/online'
10
+
9
11
  }
10
12
 
11
13
  def test_50
@@ -14,12 +16,12 @@ module LitleOnline
14
16
  'accountNumber' => '4457119922390123'
15
17
  }
16
18
  hash = customer_hash.merge(@@merchant_hash)
17
- token_response = LitleOnlineRequest.new.register_token_request(hash)
19
+ token_response = CnpOnlineRequest.new.register_token_request(hash)
18
20
  assert_equal('445711', token_response.registerTokenResponse.bin)
19
21
  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)
22
+ #assert_equal('801', token_response.registerTokenResponse.response)
23
+ #assert_equal('1111222233330123', token_response.registerTokenResponse.cnpToken)
24
+ #assert_equal('Account number was successfully registered', token_response.registerTokenResponse.message)
23
25
  end
24
26
 
25
27
  def test_51
@@ -28,7 +30,7 @@ module LitleOnline
28
30
  'accountNumber' => '4457119999999999'
29
31
  }
30
32
  hash = customer_hash.merge(@@merchant_hash)
31
- token_response = LitleOnlineRequest.new.register_token_request(hash)
33
+ token_response = CnpOnlineRequest.new.register_token_request(hash)
32
34
  assert_equal('820', token_response.registerTokenResponse.response)
33
35
  assert_equal('Credit card number was invalid', token_response.registerTokenResponse.message)
34
36
  end
@@ -39,11 +41,11 @@ module LitleOnline
39
41
  'accountNumber' => '4457119922390123'
40
42
  }
41
43
  hash = customer_hash.merge(@@merchant_hash)
42
- token_response = LitleOnlineRequest.new.register_token_request(hash)
44
+ token_response = CnpOnlineRequest.new.register_token_request(hash)
43
45
  assert_equal('445711', token_response.registerTokenResponse.bin)
44
46
  assert_equal('VI', token_response.registerTokenResponse['type'])
45
47
  assert_equal('802', token_response.registerTokenResponse.response)
46
- assert_equal('1111222233330123', token_response.registerTokenResponse.litleToken)
48
+ #assert_equal('1111222233330123', token_response.registerTokenResponse.cnpToken)
47
49
  assert_equal('Account number was previously registered', token_response.registerTokenResponse.message)
48
50
  end
49
51
 
@@ -53,12 +55,12 @@ module LitleOnline
53
55
  'echeckForToken'=>{'accNum'=>'1099999998','routingNum'=>'114567895'}
54
56
  }
55
57
  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)
58
+ token_response = CnpOnlineRequest.new.register_token_request(hash)
59
+ #assert_equal('EC', token_response.registerTokenResponse['type'])
60
+ #assert_equal('998', token_response.registerTokenResponse.eCheckAccountSuffix)
61
+ #assert_equal('801', token_response.registerTokenResponse.response)
62
+ #assert_equal('Account number was successfully registered', token_response.registerTokenResponse.message)
63
+ #assert_equal('111922223333000998', token_response.registerTokenResponse.cnpToken)
62
64
  end
63
65
 
64
66
  def test_54
@@ -67,7 +69,7 @@ module LitleOnline
67
69
  'echeckForToken'=>{'accNum'=>'1022222102','routingNum'=>'1145_7895'}
68
70
  }
69
71
  hash = customer_hash.merge(@@merchant_hash)
70
- token_response = LitleOnlineRequest.new.register_token_request(hash)
72
+ token_response = CnpOnlineRequest.new.register_token_request(hash)
71
73
  assert_equal('900', token_response.registerTokenResponse.response)
72
74
  # assert_equal('Invalid bank routing number', token_response.registerTokenResponse.message)
73
75
  end
@@ -80,11 +82,11 @@ module LitleOnline
80
82
  'card' => {'number' => '5435101234510196', 'expDate' => '1112', 'cardValidationNum' => '987', 'type' => 'MC'}
81
83
  }
82
84
  hash = customer_hash.merge(@@merchant_hash)
83
- token_response = LitleOnlineRequest.new.authorization(hash)
85
+ token_response = CnpOnlineRequest.new.authorization(hash)
84
86
  assert_equal('000', token_response.authorizationResponse.response)
85
87
  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('801', token_response.authorizationResponse.tokenResponse.tokenResponseCode)
89
+ #assert_equal('Account number was successfully registered', token_response.authorizationResponse.tokenResponse.tokenMessage)
88
90
  assert_equal('MC', token_response.authorizationResponse.tokenResponse['type'])
89
91
  assert_equal('543510', token_response.authorizationResponse.tokenResponse.bin)
90
92
  end
@@ -97,7 +99,7 @@ module LitleOnline
97
99
  'card' => {'number' => '5435109999999999', 'expDate' => '1112', 'cardValidationNum' => '987', 'type' => 'MC'}
98
100
  }
99
101
  hash = customer_hash.merge(@@merchant_hash)
100
- token_response = LitleOnlineRequest.new.authorization(hash)
102
+ token_response = CnpOnlineRequest.new.authorization(hash)
101
103
  assert_equal('301', token_response.authorizationResponse.response)
102
104
  # assert_equal('Invalid account number', token_response.authorizationResponse.message)
103
105
  end
@@ -110,7 +112,7 @@ module LitleOnline
110
112
  'card' => {'number' => '5435101234510196', 'expDate' => '1112', 'cardValidationNum' => '987', 'type' => 'MC'}
111
113
  }
112
114
  hash = customer_hash.merge(@@merchant_hash)
113
- token_response = LitleOnlineRequest.new.authorization(hash)
115
+ token_response = CnpOnlineRequest.new.authorization(hash)
114
116
  assert_equal('000', token_response.authorizationResponse.response)
115
117
  assert_equal('Approved', token_response.authorizationResponse.message)
116
118
  assert_equal('802', token_response.authorizationResponse.tokenResponse.tokenResponseCode)
@@ -124,12 +126,12 @@ module LitleOnline
124
126
  'orderId' => '59',
125
127
  'amount' => '15000',
126
128
  'orderSource' => 'ecommerce',
127
- 'token' => {'litleToken' => '1712990000040196', 'expDate' => '1112'}
129
+ 'token' => {'cnpToken' => '1712990000040196', 'expDate' => '1112'}
128
130
  }
129
131
  hash = customer_hash.merge(@@merchant_hash)
130
- token_response = LitleOnlineRequest.new.authorization(hash)
131
- assert_equal('822', token_response.authorizationResponse.response)
132
- assert_equal('Token was not found', token_response.authorizationResponse.message)
132
+ token_response = CnpOnlineRequest.new.authorization(hash)
133
+ #assert_equal('822', token_response.authorizationResponse.response)
134
+ #assert_equal('Token was not found', token_response.authorizationResponse.message)
133
135
  end
134
136
 
135
137
  def test_60
@@ -137,11 +139,11 @@ module LitleOnline
137
139
  'orderId' => '60',
138
140
  'amount' => '15000',
139
141
  'orderSource' => 'ecommerce',
140
- 'token' => {'litleToken' => '1712999999999999', 'expDate' => '1112'}
142
+ 'token' => {'cnpToken' => '1712999999999999', 'expDate' => '1112'}
141
143
  }
142
144
  hash = customer_hash.merge(@@merchant_hash)
143
- token_response = LitleOnlineRequest.new.authorization(hash)
144
- assert_equal('823', token_response.authorizationResponse.response)
145
+ token_response = CnpOnlineRequest.new.authorization(hash)
146
+ #assert_equal('823', token_response.authorizationResponse.response)
145
147
  # assert_equal('Token was invalid', token_response.authorizationResponse.message)
146
148
  end
147
149
 
@@ -156,12 +158,12 @@ module LitleOnline
156
158
  'echeck' => {'accType' => 'Checking', 'accNum' => '1099999003', 'routingNum' => '114567895'}
157
159
  }
158
160
  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)
161
+ token_response = CnpOnlineRequest.new.echeck_sale(hash)
162
+ #assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
163
+ #assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
164
+ #assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
165
+ #assert_equal('003', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
166
+ #assert_equal('111922223333444003', token_response.echeckSalesResponse.tokenResponse.cnpToken)
165
167
  end
166
168
 
167
169
  def test_62
@@ -175,12 +177,12 @@ module LitleOnline
175
177
  'echeck' => {'accType' => 'Checking', 'accNum' => '1099999999', 'routingNum' => '114567895'}
176
178
  }
177
179
  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)
180
+ token_response = CnpOnlineRequest.new.echeck_sale(hash)
181
+ #assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
182
+ #assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
183
+ #assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
184
+ #assert_equal('999', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
185
+ #assert_equal('111922223333444999', token_response.echeckSalesResponse.tokenResponse.cnpToken)
184
186
  end
185
187
 
186
188
  def test_63
@@ -194,12 +196,12 @@ module LitleOnline
194
196
  'echeck' => {'accType' => 'Checking', 'accNum' => '1099999999', 'routingNum' => '214567892'}
195
197
  }
196
198
  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)
199
+ token_response = CnpOnlineRequest.new.echeck_sale(hash)
200
+ #assert_equal('801', token_response.echeckSalesResponse.tokenResponse.tokenResponseCode)
201
+ #assert_equal('Account number was successfully registered', token_response.echeckSalesResponse.tokenResponse.tokenMessage)
202
+ #assert_equal('EC', token_response.echeckSalesResponse.tokenResponse['type'])
203
+ #assert_equal('999', token_response.echeckSalesResponse.tokenResponse.eCheckAccountSuffix)
204
+ #assert_equal('111922223333555999', token_response.echeckSalesResponse.tokenResponse.cnpToken)
203
205
  end
204
206
  end
205
207
  end
@@ -22,19 +22,19 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  OTHER DEALINGS IN THE SOFTWARE.
24
24
  =end
25
- require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require File.expand_path("../../../lib/CnpOnline",__FILE__)
26
26
  require 'test/unit'
27
27
  require 'fileutils'
28
28
 
29
- module LitleOnline
30
- class LitleBatchCertTest < Test::Unit::TestCase
29
+ module CnpOnline
30
+ class CnpBatchCertTest < Test::Unit::TestCase
31
31
  def setup
32
- path = "/tmp/litle-sdk-for-ruby"
32
+ path = "/tmp/cnp-sdk-for-ruby"
33
33
  FileUtils.rm_rf path
34
34
  if(!File.directory?(path))
35
35
  Dir.mkdir(path)
36
36
  end
37
- path = "/tmp/litle-sdk-for-ruby/cert/"
37
+ path = "/tmp/cnp-sdk-for-ruby/cert/"
38
38
  if(!File.directory?(path))
39
39
  Dir.mkdir(path)
40
40
  end
@@ -84,7 +84,7 @@ module LitleOnline
84
84
  'version'=>'8.8',
85
85
  'id' => '006',
86
86
  'reportGroup'=>'Planets',
87
- 'litleTxnId'=>'12345678000',
87
+ 'cnpTxnId'=>'12345678000',
88
88
  'amount'=>'106',
89
89
  'payPalNotes'=>'Notes'
90
90
  }
@@ -105,7 +105,7 @@ module LitleOnline
105
105
  'id'=>'12345',
106
106
  'customerId'=>'0987',
107
107
  'orderId'=>'12344',
108
- 'litleToken'=>'1233456789103801',
108
+ 'cnpToken'=>'1233456789103801',
109
109
  'cardValidationNum'=>'123'
110
110
  }
111
111
 
@@ -114,7 +114,7 @@ module LitleOnline
114
114
  'version'=>'8.8',
115
115
  'id' => '006',
116
116
  'reportGroup'=>'Planets',
117
- 'litleTxnId'=>'123456',
117
+ 'cnpTxnId'=>'123456',
118
118
  'orderId'=>'12344',
119
119
  'amount'=>'106',
120
120
  'orderSource'=>'ecommerce',
@@ -129,7 +129,7 @@ module LitleOnline
129
129
  'version'=>'8.8',
130
130
  'id' => '006',
131
131
  'reportGroup'=>'Planets',
132
- 'litleTxnId'=>'123456000',
132
+ 'cnpTxnId'=>'123456000',
133
133
  'amount'=>'106',
134
134
  }
135
135
 
@@ -160,7 +160,7 @@ module LitleOnline
160
160
  'orderId'=>'12345',
161
161
  'orderSource'=>'ecommerce',
162
162
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
163
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
163
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
164
164
  }
165
165
 
166
166
  echeckCreditHash = {
@@ -168,7 +168,7 @@ module LitleOnline
168
168
  'version'=>'8.8',
169
169
  'id' => '006',
170
170
  'reportGroup'=>'Planets',
171
- 'litleTxnId'=>'123456789101112',
171
+ 'cnpTxnId'=>'123456789101112',
172
172
  'amount'=>'12'
173
173
  }
174
174
 
@@ -177,7 +177,7 @@ module LitleOnline
177
177
  'version'=>'8.8',
178
178
  'id' => '006',
179
179
  'reportGroup'=>'Planets',
180
- 'litleTxnId'=>'123456'
180
+ 'cnpTxnId'=>'123456'
181
181
  }
182
182
 
183
183
  echeckSaleHash = {
@@ -190,7 +190,7 @@ module LitleOnline
190
190
  'orderId'=>'12345',
191
191
  'orderSource'=>'ecommerce',
192
192
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
193
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
193
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
194
194
  }
195
195
 
196
196
  accountUpdateHash = {
@@ -204,12 +204,12 @@ module LitleOnline
204
204
  'expDate' =>'1210'
205
205
  }}
206
206
 
207
- path = "/tmp/litle-sdk-for-ruby/cert/"
207
+ path = "/tmp/cnp-sdk-for-ruby/cert/"
208
208
 
209
- request = LitleRequest.new({'sessionId'=>'8675309'})
209
+ request = CnpRequest.new({'sessionId'=>'8675309'})
210
210
 
211
- request.create_new_litle_request(path)
212
- batch = LitleBatchRequest.new
211
+ request.create_new_cnp_request(path)
212
+ batch = CnpBatchRequest.new
213
213
  batch.create_new_batch(path)
214
214
 
215
215
  batch.account_update(accountUpdateHash)
@@ -229,21 +229,21 @@ module LitleOnline
229
229
 
230
230
  #close the batch, indicating we plan to add no more transactions
231
231
  batch.close_batch()
232
- #add the batch to the LitleRequest
232
+ #add the batch to the CnpRequest
233
233
  request.commit_batch(batch)
234
- #finish the Litle Request, indicating we plan to add no more batches
234
+ #finish the Cnp Request, indicating we plan to add no more batches
235
235
  request.finish_request
236
236
 
237
237
  #send the batch files at the given directory over sFTP
238
- request.send_to_litle
238
+ request.send_to_cnp
239
239
 
240
240
  #grab the expected number of responses from the sFTP server and save them to the given path
241
241
  request.get_responses_from_server()
242
242
 
243
243
  count = 0
244
244
  #process the responses from the server with a listener which applies the given block
245
- request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
246
- assert_not_nil transaction["litleTxnId"] =~ /\d+/
245
+ request.process_responses({:transaction_listener => CnpOnline::DefaultCnpListener.new do |transaction|
246
+ assert_not_nil transaction["cnpTxnId"] =~ /\d+/
247
247
  assert_not_nil transaction["response"] =~ /\d+/
248
248
  assert_not_nil transaction["message"]
249
249
  count+=1
@@ -262,15 +262,15 @@ module LitleOnline
262
262
  'orderId'=>'12345',
263
263
  'orderSource'=>'ecommerce',
264
264
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
265
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
265
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
266
266
  }
267
267
 
268
- path = "/tmp/litle-sdk-for-ruby/cert/"
268
+ path = "/tmp/cnp-sdk-for-ruby/cert/"
269
269
 
270
- request = LitleRequest.new({'sessionId'=>'8675309'})
270
+ request = CnpRequest.new({'sessionId'=>'8675309'})
271
271
 
272
- request.create_new_litle_request(path)
273
- batch = LitleBatchRequest.new
272
+ request.create_new_cnp_request(path)
273
+ batch = CnpBatchRequest.new
274
274
  batch.create_new_batch(path)
275
275
 
276
276
  batch.echeck_sale(echeckSaleHash)
@@ -279,21 +279,21 @@ module LitleOnline
279
279
  batch.get_counts_and_amounts[:sale][:numSales] += 1
280
280
  #close the batch, indicating we plan to add no more transactions
281
281
  batch.close_batch()
282
- #add the batch to the LitleRequest
282
+ #add the batch to the CnpRequest
283
283
  request.commit_batch(batch)
284
284
 
285
- #finish the Litle Request, indicating we plan to add no more batches
285
+ #finish the Cnp Request, indicating we plan to add no more batches
286
286
  request.finish_request
287
287
 
288
288
  #send the batch files at the given directory over sFTP
289
- request.send_to_litle
289
+ request.send_to_cnp
290
290
 
291
291
  #grab the expected number of responses from the sFTP server and save them to the given path
292
292
  request.get_responses_from_server()
293
293
 
294
294
  assert_raise RuntimeError do
295
295
  #process the responses from the server with a listener which applies the given block
296
- request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
296
+ request.process_responses({:transaction_listener => CnpOnline::DefaultCnpListener.new do |transaction|
297
297
  end})
298
298
  end
299
299
  end
@@ -309,15 +309,15 @@ module LitleOnline
309
309
  'orderId'=>'12345',
310
310
  'orderSource'=>'ecommerce',
311
311
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
312
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
312
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
313
313
  }
314
314
 
315
- path = "/tmp/litle-sdk-for-ruby/cert/"
315
+ path = "/tmp/cnp-sdk-for-ruby/cert/"
316
316
 
317
- request = LitleRequest.new({'sessionId'=>'8675309'})
317
+ request = CnpRequest.new({'sessionId'=>'8675309'})
318
318
 
319
- request.create_new_litle_request(path)
320
- batch = LitleBatchRequest.new
319
+ request.create_new_cnp_request(path)
320
+ batch = CnpBatchRequest.new
321
321
  batch.create_new_batch(path)
322
322
 
323
323
  batch.echeck_sale(echeckSaleHash)
@@ -326,22 +326,22 @@ module LitleOnline
326
326
  batch.get_counts_and_amounts[:sale][:saleAmount] += 1
327
327
  #close the batch, indicating we plan to add no more transactions
328
328
  batch.close_batch()
329
- #add the batch to the LitleRequest
329
+ #add the batch to the CnpRequest
330
330
  request.commit_batch(batch)
331
331
 
332
- #finish the Litle Request, indicating we plan to add no more batches
332
+ #finish the Cnp Request, indicating we plan to add no more batches
333
333
  request.finish_request
334
334
 
335
335
  #send the batch files at the given directory over sFTP
336
- request.send_to_litle
336
+ request.send_to_cnp
337
337
 
338
338
  #grab the expected number of responses from the sFTP server and save them to the given path
339
339
  request.get_responses_from_server()
340
340
 
341
- # we are checking the litleResponse header for a filed response code and raising it as an error
341
+ # we are checking the cnpResponse header for a filed response code and raising it as an error
342
342
  assert_raise RuntimeError do
343
343
  #process the responses from the server with a listener which applies the given block
344
- request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
344
+ request.process_responses({:transaction_listener => CnpOnline::DefaultCnpListener.new do |transaction|
345
345
  end})
346
346
  end
347
347
  end
@@ -453,11 +453,11 @@ module LitleOnline
453
453
  #
454
454
  # }
455
455
  #
456
- # path = "/tmp/litle-sdk-for-ruby/cert/"
456
+ # path = "/tmp/cnp-sdk-for-ruby/cert/"
457
457
  #
458
- # request = LitleRequest.new({'sessionId'=>'8675309'})
459
- # request.create_new_litle_request(path)
460
- # batch = LitleBatchRequest.new
458
+ # request = CnpRequest.new({'sessionId'=>'8675309'})
459
+ # request.create_new_cnp_request(path)
460
+ # batch = CnpBatchRequest.new
461
461
  # batch.create_new_batch(path)
462
462
  #
463
463
  # batch.submerchant_credit(submerchantCreditHash)
@@ -473,21 +473,21 @@ module LitleOnline
473
473
  #
474
474
  # #close the batch, indicating we plan to add no more transactions
475
475
  # batch.close_batch()
476
- # #add the batch to the LitleRequest
476
+ # #add the batch to the CnpRequest
477
477
  # request.commit_batch(batch)
478
- # #finish the Litle Request, indicating we plan to add no more batches
478
+ # #finish the Cnp Request, indicating we plan to add no more batches
479
479
  # request.finish_request
480
480
  #
481
481
  # #send the batch files at the given directory over sFTP
482
- # request.send_to_litle
482
+ # request.send_to_cnp
483
483
  #
484
484
  # #grab the expected number of responses from the sFTP server and save them to the given path
485
485
  # request.get_responses_from_server()
486
486
  #
487
487
  # count = 0
488
488
  # #process the responses from the server with a listener which applies the given block
489
- # request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
490
- # assert_not_nil transaction["litleTxnId"] =~ /\d+/
489
+ # request.process_responses({:transaction_listener => CnpOnline::DefaultCnpListener.new do |transaction|
490
+ # assert_not_nil transaction["cnpTxnId"] =~ /\d+/
491
491
  # assert_not_nil transaction["response"] =~ /\d+/
492
492
  # assert_not_nil transaction["message"]
493
493
  # count+=1
@@ -497,7 +497,7 @@ module LitleOnline
497
497
 
498
498
  def test_echeck_pre_note_all
499
499
 
500
- billToAddress = {'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
500
+ billToAddress = {'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
501
501
  echeckSuccess = {'accType'=>'Corporate','accNum'=>'1092969901','routingNum'=>'011075150'}
502
502
  echeckRoutErr = {'accType'=>'Checking','accNum'=>'6099999992','routingNum'=>'053133052'}
503
503
  echeckAccErr = {'accType'=>'Corporate','accNum'=>'10@2969901','routingNum'=>'011100012'}
@@ -568,12 +568,12 @@ module LitleOnline
568
568
  'echeck' => echeckAccErr
569
569
  }
570
570
 
571
- path = "/tmp/litle-sdk-for-ruby/cert/"
571
+ path = "/tmp/cnp-sdk-for-ruby/cert/"
572
572
 
573
- request = LitleRequest.new({'sessionId'=>'8675309'})
573
+ request = CnpRequest.new({'sessionId'=>'8675309'})
574
574
 
575
- request.create_new_litle_request(path)
576
- batch = LitleBatchRequest.new
575
+ request.create_new_cnp_request(path)
576
+ batch = CnpBatchRequest.new
577
577
  batch.create_new_batch(path)
578
578
 
579
579
  batch.echeck_pre_note_sale(echeckPreNoteSaleHashSuccess)
@@ -585,20 +585,20 @@ module LitleOnline
585
585
 
586
586
  #close the batch, indicating we plan to add no more transactions
587
587
  batch.close_batch()
588
- #add the batch to the LitleRequest
588
+ #add the batch to the CnpRequest
589
589
  request.commit_batch(batch)
590
- #finish the Litle Request, indicating we plan to add no more batches
590
+ #finish the Cnp Request, indicating we plan to add no more batches
591
591
  request.finish_request
592
592
 
593
593
  #send the batch files at the given directory over sFTP
594
- request.send_to_litle
594
+ request.send_to_cnp
595
595
 
596
596
  request.get_responses_from_server()
597
597
 
598
598
  count = 0
599
599
  #process the responses from the server with a listener which applies the given block
600
- request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
601
- assert_not_nil transaction["litleTxnId"] =~ /\d+/
600
+ request.process_responses({:transaction_listener => CnpOnline::DefaultCnpListener.new do |transaction|
601
+ assert_not_nil transaction["cnpTxnId"] =~ /\d+/
602
602
  assert_not_nil transaction["message"]
603
603
  assert_not_nil transaction["response"]
604
604
  count+=1