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
@@ -22,11 +22,11 @@ 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
 
28
28
  #test RefundReversal Transaction
29
- module LitleOnline
29
+ module CnpOnline
30
30
  class TestRefundReversal < Test::Unit::TestCase
31
31
 
32
32
  def test_simple
@@ -35,7 +35,7 @@ def test_simple
35
35
  'version'=>'8.8',
36
36
  'id'=>'test',
37
37
  'reportGroup'=>'Planets',
38
- 'litleTxnId' =>'5000',
38
+ 'cnpTxnId' =>'5000',
39
39
  'card'=>{
40
40
  'type'=>'GC',
41
41
  'number' =>'400000000000001',
@@ -50,7 +50,7 @@ def test_simple
50
50
  'originalSequenceNumber' => '111111',
51
51
  }
52
52
 
53
- response= LitleOnlineRequest.new.deposit_reversal(hash)
53
+ response= CnpOnlineRequest.new.deposit_reversal(hash)
54
54
  assert_equal('000', response.depositReversalResponse.response)
55
55
  end
56
56
 
@@ -63,7 +63,7 @@ def test_simple
63
63
  }
64
64
 
65
65
  #Get exceptions
66
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.refund_reversal(hash)}
66
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.refund_reversal(hash)}
67
67
  #Test
68
68
  assert(exception.message =~ /Error validating xml data against the schema/)
69
69
  end
@@ -22,10 +22,10 @@ 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
 
28
- module LitleOnline
28
+ module CnpOnline
29
29
  class TestSale < Test::Unit::TestCase
30
30
  def test_simple_sale_with_card
31
31
  hash = {
@@ -33,7 +33,7 @@ module LitleOnline
33
33
  'id' => 'test',
34
34
  'version'=>'8.8',
35
35
  'reportGroup'=>'Planets',
36
- 'litleTxnId'=>'123456',
36
+ 'cnpTxnId'=>'123456',
37
37
  'orderId'=>'12344',
38
38
  'amount'=>'106',
39
39
  'orderSource'=>'ecommerce',
@@ -43,7 +43,7 @@ module LitleOnline
43
43
  'expDate' =>'1210'
44
44
  }}
45
45
 
46
- response= LitleOnlineRequest.new.sale(hash)
46
+ response= CnpOnlineRequest.new.sale(hash)
47
47
  assert_equal('000', response.saleResponse.response)
48
48
  end
49
49
 
@@ -53,7 +53,7 @@ module LitleOnline
53
53
  'id' => 'test',
54
54
  'version'=>'8.8',
55
55
  'reportGroup'=>'Planets',
56
- 'litleTxnId'=>'123456',
56
+ 'cnpTxnId'=>'123456',
57
57
  'orderId'=>'12344',
58
58
  'amount'=>'106',
59
59
  'orderSource'=>'ecommerce',
@@ -63,7 +63,7 @@ module LitleOnline
63
63
  'transactionId'=>'123456'
64
64
  }}
65
65
 
66
- response= LitleOnlineRequest.new.sale(hash)
66
+ response= CnpOnlineRequest.new.sale(hash)
67
67
  assert_equal 'Valid Format', response.message
68
68
  end
69
69
 
@@ -73,7 +73,7 @@ module LitleOnline
73
73
  'id' => 'test',
74
74
  'version'=>'8.8',
75
75
  'reportGroup'=>'Planets',
76
- 'litleTxnId'=>'123456',
76
+ 'cnpTxnId'=>'123456',
77
77
  'orderId'=>'12344',
78
78
  'amount'=>'110',
79
79
  'secondaryAmount'=>'50',
@@ -90,7 +90,7 @@ module LitleOnline
90
90
  #'version'=>'1'
91
91
  'version'=>'10000'
92
92
  }}
93
- response= LitleOnlineRequest.new.sale(hash)
93
+ response= CnpOnlineRequest.new.sale(hash)
94
94
  assert_equal('Insufficient Funds', response.saleResponse.message)
95
95
  assert_equal('110', response.saleResponse.applepayResponse.transactionAmount)
96
96
  end
@@ -101,7 +101,7 @@ module LitleOnline
101
101
  'id' => 'test',
102
102
  'version'=>'8.8',
103
103
  'reportGroup'=>'Planets',
104
- 'litleTxnId'=>'123456',
104
+ 'cnpTxnId'=>'123456',
105
105
  'orderId'=>'12344',
106
106
  'amount'=>'106',
107
107
  'orderSource'=>'ecomerce',
@@ -111,7 +111,7 @@ module LitleOnline
111
111
  'expDate' =>'1210'
112
112
  }}
113
113
  #Get exceptions
114
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
114
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
115
115
  #Test
116
116
  assert(exception.message =~ /Error validating xml data against the schema/)
117
117
  end
@@ -122,7 +122,7 @@ module LitleOnline
122
122
  'id' => 'test',
123
123
  'version'=>'8.8',
124
124
  'reportGroup'=>'Planets',
125
- 'litleTxnId'=>'123456',
125
+ 'cnpTxnId'=>'123456',
126
126
  'orderId'=>'12344',
127
127
  'amount'=>'106',
128
128
  'orderSource'=>'ecommerce',
@@ -131,7 +131,7 @@ module LitleOnline
131
131
  'number' =>'4100000000000000',
132
132
  'expDate' =>'1210'
133
133
  }}
134
- response= LitleOnlineRequest.new.sale(hash)
134
+ response= CnpOnlineRequest.new.sale(hash)
135
135
  assert_equal('000', response.saleResponse.response)
136
136
  end
137
137
 
@@ -141,7 +141,7 @@ module LitleOnline
141
141
  'id' => 'test',
142
142
  'version'=>'8.8',
143
143
  'orderSource'=>'ecommerce',
144
- 'litleTxnId'=>'123456',
144
+ 'cnpTxnId'=>'123456',
145
145
  'amount'=>'106',
146
146
  'card'=>{
147
147
  'type'=>'VI',
@@ -151,7 +151,7 @@ module LitleOnline
151
151
  'reportGroup'=>'Planets',
152
152
  'orderId'=>'12344'
153
153
  }
154
- response= LitleOnlineRequest.new.sale(hash)
154
+ response= CnpOnlineRequest.new.sale(hash)
155
155
  assert_equal('000', response.saleResponse.response)
156
156
  end
157
157
 
@@ -161,7 +161,7 @@ module LitleOnline
161
161
  'id' => 'test',
162
162
  'version'=>'8.8',
163
163
  'reportGroup'=>'Planets',
164
- 'litleTxnId'=>'123456',
164
+ 'cnpTxnId'=>'123456',
165
165
  'orderId'=>'12344',
166
166
  'amount'=>'106',
167
167
  'orderSource'=>'ecommerce',
@@ -171,7 +171,7 @@ module LitleOnline
171
171
  'number' =>'4100000000000000',
172
172
  'expDate' =>'1210'
173
173
  }}
174
- response= LitleOnlineRequest.new.sale(hash)
174
+ response= CnpOnlineRequest.new.sale(hash)
175
175
  assert_equal('000', response.saleResponse.response)
176
176
  end
177
177
 
@@ -181,7 +181,7 @@ module LitleOnline
181
181
  'id' => 'test',
182
182
  'version'=>'8.8',
183
183
  'reportGroup'=>'Planets',
184
- 'litleTxnId'=>'123456',
184
+ 'cnpTxnId'=>'123456',
185
185
  'orderId'=>'12344',
186
186
  'amount'=>'106',
187
187
  'orderSource'=>'ecommerce',
@@ -190,7 +190,7 @@ module LitleOnline
190
190
  'number' =>'4100000000000000',
191
191
  'expDate' =>'1210'
192
192
  }}
193
- response= LitleOnlineRequest.new.sale(hash)
193
+ response= CnpOnlineRequest.new.sale(hash)
194
194
  assert_equal('000', response.saleResponse.response)
195
195
  end
196
196
 
@@ -200,7 +200,7 @@ module LitleOnline
200
200
  'id' => 'test',
201
201
  'version'=>'8.8',
202
202
  'reportGroup'=>'Planets',
203
- 'litleTxnId'=>'123456',
203
+ 'cnpTxnId'=>'123456',
204
204
  'amount'=>'106',
205
205
  'orderSource'=>'ecommerce',
206
206
  'card'=>{
@@ -209,7 +209,7 @@ module LitleOnline
209
209
  'expDate' =>'1210'
210
210
  }}
211
211
  #Get exceptions
212
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
212
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
213
213
  #Test
214
214
  assert(exception.message =~ /Error validating xml data against the schema/)
215
215
  end
@@ -220,7 +220,7 @@ module LitleOnline
220
220
  'id' => 'test',
221
221
  'version'=>'8.8',
222
222
  'reportGroup'=>'Planets',
223
- 'litleTxnId'=>'123456',
223
+ 'cnpTxnId'=>'123456',
224
224
  'orderId'=>'12344',
225
225
  'orderSource'=>'ecommerce',
226
226
  'card'=>{
@@ -229,7 +229,7 @@ module LitleOnline
229
229
  'expDate' =>'1210'
230
230
  }}
231
231
  #Get exceptions
232
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
232
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
233
233
  #Test
234
234
  assert(exception.message =~ /Error validating xml data against the schema/)
235
235
  end
@@ -240,7 +240,7 @@ module LitleOnline
240
240
  'id' => 'test',
241
241
  'version'=>'8.8',
242
242
  'reportGroup'=>'Planets',
243
- 'litleTxnId'=>'123456',
243
+ 'cnpTxnId'=>'123456',
244
244
  'orderId'=>'12344',
245
245
  'amount'=>'106',
246
246
  'card'=>{
@@ -249,7 +249,7 @@ module LitleOnline
249
249
  'expDate' =>'1210'
250
250
  }}
251
251
  #Get exceptions
252
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
252
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
253
253
  #Test
254
254
  assert(exception.message =~ /Error validating xml data against the schema/)
255
255
  end
@@ -260,7 +260,7 @@ module LitleOnline
260
260
  'id' => 'test',
261
261
  'version'=>'8.8',
262
262
  'reportGroup'=>'Planets',
263
- 'litleTxnId'=>'123456',
263
+ 'cnpTxnId'=>'123456',
264
264
  'orderId'=>'12344',
265
265
  'amount'=>'106',
266
266
  'orderSource'=>'ecommerce',
@@ -273,7 +273,7 @@ module LitleOnline
273
273
  'track2Status'=>'0'
274
274
  }
275
275
  }
276
- response= LitleOnlineRequest.new.sale(hash)
276
+ response= CnpOnlineRequest.new.sale(hash)
277
277
  assert_equal('000', response.saleResponse.response)
278
278
  end
279
279
 
@@ -284,7 +284,7 @@ module LitleOnline
284
284
  'id' => 'test',
285
285
  'version'=>'8.8',
286
286
  'reportGroup'=>'Planets',
287
- 'litleTxnId'=>'123456',
287
+ 'cnpTxnId'=>'123456',
288
288
  'orderId'=>'12344',
289
289
  'amount'=>'110',
290
290
  'secondaryAmount'=>'50',
@@ -303,7 +303,7 @@ module LitleOnline
303
303
  'signature' =>'1',
304
304
  'version'=>'100000'
305
305
  }}
306
- response= LitleOnlineRequest.new.sale(hash)
306
+ response= CnpOnlineRequest.new.sale(hash)
307
307
  assert_equal('Insufficient Funds', response.saleResponse.message)
308
308
  assert_equal('110', response.saleResponse.applepayResponse.transactionAmount)
309
309
  end
@@ -316,7 +316,7 @@ module LitleOnline
316
316
  'id' => 'test',
317
317
  'version'=>'8.8',
318
318
  'reportGroup'=>'Planets',
319
- 'litleTxnId'=>'123456',
319
+ 'cnpTxnId'=>'123456',
320
320
  'orderId'=>'12344',
321
321
  'amount'=>'106',
322
322
  'orderSource'=>'ecommerce',
@@ -331,7 +331,7 @@ module LitleOnline
331
331
  'walletSourceType' => 'MasterPass',
332
332
  'walletSourceTypeId' => '102'
333
333
  }}
334
- response= LitleOnlineRequest.new.sale(hash)
334
+ response= CnpOnlineRequest.new.sale(hash)
335
335
  assert_equal 'Valid Format', response.message
336
336
  end
337
337
 
@@ -341,7 +341,7 @@ module LitleOnline
341
341
  'id' => 'test',
342
342
  'version'=>'8.8',
343
343
  'reportGroup'=>'Planets',
344
- 'litleTxnId'=>'123456',
344
+ 'cnpTxnId'=>'123456',
345
345
  'orderId'=>'12344',
346
346
  'amount'=>'106',
347
347
  'orderSource'=>'ecommerce',
@@ -352,7 +352,7 @@ module LitleOnline
352
352
  'expDate' =>'1210'
353
353
  }
354
354
  }
355
- response= LitleOnlineRequest.new.sale(hash)
355
+ response= CnpOnlineRequest.new.sale(hash)
356
356
  assert_equal 'Valid Format', response.message
357
357
  end
358
358
 
@@ -362,7 +362,7 @@ module LitleOnline
362
362
  'id' => 'test',
363
363
  'version'=>'8.8',
364
364
  'reportGroup'=>'Planets',
365
- 'litleTxnId'=>'123456',
365
+ 'cnpTxnId'=>'123456',
366
366
  'orderId'=>'12344',
367
367
  'amount'=>'106',
368
368
  'orderSource'=>'ecommerce',
@@ -374,7 +374,7 @@ module LitleOnline
374
374
  'originalNetworkTransactionId'=>'98765432109876543210',
375
375
  'originalTransactionAmount'=>'7001'
376
376
  }
377
- response= LitleOnlineRequest.new.sale(hash)
377
+ response= CnpOnlineRequest.new.sale(hash)
378
378
  assert_equal 'Valid Format', response.message
379
379
  assert_equal('63225578415568556365452427825', response.saleResponse.networkTransactionId)
380
380
  end
@@ -385,7 +385,7 @@ module LitleOnline
385
385
  'id' => 'test',
386
386
  'version'=>'8.8',
387
387
  'reportGroup'=>'Planets',
388
- 'litleTxnId'=>'123456',
388
+ 'cnpTxnId'=>'123456',
389
389
  'orderId'=>'12344',
390
390
  'amount'=>'106',
391
391
  'orderSource'=>'ecommerce',
@@ -394,7 +394,7 @@ module LitleOnline
394
394
  'sequenceType'=>'FirstRecurring',
395
395
  'iban'=>'123456789123456789'
396
396
  }}
397
- response= LitleOnlineRequest.new.sale(hash)
397
+ response= CnpOnlineRequest.new.sale(hash)
398
398
  assert_equal 'Valid Format', response.message
399
399
  assert_equal('http://redirect.url.vantiv.com', response.saleResponse.sepaDirectDebitResponse.redirectUrl)
400
400
  assert_equal('jj2d1d372osmmt7tb8epm0a99q', response.saleResponse.sepaDirectDebitResponse.redirectToken)
@@ -22,10 +22,10 @@ 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
 
28
- module LitleOnline
28
+ module CnpOnline
29
29
  class TestToken < Test::Unit::TestCase
30
30
  def test_simple_token
31
31
  hash = {
@@ -36,7 +36,7 @@ module LitleOnline
36
36
  'orderId'=>'12344',
37
37
  'accountNumber'=>'1233456789103801'
38
38
  }
39
- response= LitleOnlineRequest.new.register_token_request(hash)
39
+ response= CnpOnlineRequest.new.register_token_request(hash)
40
40
  assert_equal('Valid Format', response.message)
41
41
  end
42
42
 
@@ -49,9 +49,9 @@ module LitleOnline
49
49
  'orderId'=>'12344',
50
50
  'paypageRegistrationId'=>'QU1pTFZnV2NGQWZrZzRKeTNVR0lzejB1K2Q5VDdWMTVqb2J5WFJ2Snh4U0U4eTBxaFg2cEVWaDBWSlhtMVZTTw=='
51
51
  }
52
- response= LitleOnlineRequest.new.register_token_request(hash)
52
+ response= CnpOnlineRequest.new.register_token_request(hash)
53
53
  assert_equal('Valid Format', response.message)
54
- assert_equal('1111222233334444', response.registerTokenResponse.litleToken)
54
+ assert_equal('1111222233334444', response.registerTokenResponse.cnpToken)
55
55
  end
56
56
 
57
57
  def test_simple_token_with_applepay
@@ -73,7 +73,7 @@ module LitleOnline
73
73
  'version'=>'10000'
74
74
  }
75
75
  }
76
- response= LitleOnlineRequest.new.register_token_request(hash)
76
+ response= CnpOnlineRequest.new.register_token_request(hash)
77
77
  assert_equal('Valid Format', response.message)
78
78
  assert_equal('0', response.registerTokenResponse.applepayResponse.transactionAmount)
79
79
  end
@@ -87,7 +87,7 @@ module LitleOnline
87
87
  'orderId'=>'12344',
88
88
  'echeckForToken'=>{'accNum'=>'12344565','routingNum'=>'123476545'}
89
89
  }
90
- response= LitleOnlineRequest.new.register_token_request(hash)
90
+ response= CnpOnlineRequest.new.register_token_request(hash)
91
91
  assert_equal('Valid Format', response.message)
92
92
  end
93
93
 
@@ -100,7 +100,7 @@ module LitleOnline
100
100
  'accountNumber'=>'1233456789103801',
101
101
  'reportGroup'=>'Planets',
102
102
  }
103
- response= LitleOnlineRequest.new.register_token_request(hash)
103
+ response= CnpOnlineRequest.new.register_token_request(hash)
104
104
  assert_equal('Valid Format', response.message)
105
105
  end
106
106
 
@@ -114,7 +114,7 @@ module LitleOnline
114
114
  'accountNumber'=>'1233456789103801',
115
115
  'reportGroup'=>'Planets',
116
116
  }
117
- response= LitleOnlineRequest.new.register_token_request(hash)
117
+ response= CnpOnlineRequest.new.register_token_request(hash)
118
118
  assert_equal('Valid Format', response.message)
119
119
  end
120
120
 
@@ -127,7 +127,7 @@ module LitleOnline
127
127
  'orderId'=>'androidpay',
128
128
  'accountNumber'=>'1233456789103801'
129
129
  }
130
- response= LitleOnlineRequest.new.register_token_request(hash)
130
+ response= CnpOnlineRequest.new.register_token_request(hash)
131
131
  assert_equal('Account number was successfully registered', response.registerTokenResponse.message)
132
132
  assert_equal('01', response.registerTokenResponse.androidpayResponse.expMonth)
133
133
  assert_equal('2050', response.registerTokenResponse.androidpayResponse.expYear)
@@ -22,11 +22,11 @@ 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
 
28
28
  #test Unload Transaction
29
- module LitleOnline
29
+ module CnpOnline
30
30
  class TestUnload < Test::Unit::TestCase
31
31
 
32
32
  def test_simple_happy
@@ -45,7 +45,7 @@ def test_simple_happy
45
45
  }
46
46
  }
47
47
 
48
- response= LitleOnlineRequest.new.unload_request(hash)
48
+ response= CnpOnlineRequest.new.unload_request(hash)
49
49
  assert_equal('Valid Format', response.message)
50
50
  end
51
51
 
@@ -65,7 +65,7 @@ def test_simple_happy
65
65
  }
66
66
  }
67
67
 
68
- response= LitleOnlineRequest.new.unload_request(hash)
68
+ response= CnpOnlineRequest.new.unload_request(hash)
69
69
  assert_equal('Valid Format', response.message)
70
70
  end
71
71
 
@@ -78,7 +78,7 @@ def test_simple_happy
78
78
  }
79
79
 
80
80
  #Get exceptions
81
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.unload_request(hash)}
81
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.unload_request(hash)}
82
82
  #Test
83
83
  assert(exception.message =~ /Error validating xml data against the schema/)
84
84
  end
@@ -100,7 +100,7 @@ def test_simple_happy
100
100
  }
101
101
 
102
102
  #Get exceptions
103
- exception = assert_raise(RuntimeError){LitleOnlineRequest.new.unload_request(hash)}
103
+ exception = assert_raise(RuntimeError){CnpOnlineRequest.new.unload_request(hash)}
104
104
  #Test
105
105
  assert(exception.message =~ /Error validating xml data against the schema/)
106
106
  end