CnpOnline 11.4.0 → 12.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -164
- data/CHANGELOG~ +0 -0
- data/CONTRIBUTORS +0 -2
- data/DESCRIPTION +1 -1
- data/LICENSE +0 -0
- data/README.md +13 -15
- data/Rakefile +3 -2
- data/Rakefile~ +4 -3
- data/SETUP.md +13 -10
- data/bin/Setup.rb +26 -22
- data/bin/sample_batch_driver.rb +15 -15
- data/bin/sample_driver.rb +5 -5
- data/lib/{LitleBatchRequest.rb → CnpBatchRequest.rb} +68 -66
- data/lib/{LitleListeners.rb → CnpListeners.rb} +48 -40
- data/lib/{LitleOnline.rb → CnpOnline.rb} +8 -7
- data/lib/{LitleOnlineRequest.rb → CnpOnlineRequest.rb} +53 -53
- data/lib/{LitleRequest.rb → CnpRequest.rb} +186 -192
- data/lib/{LitleTransaction.rb → CnpTransaction.rb} +53 -52
- data/lib/{LitleXmlMapper.rb → CnpXmlMapper.rb} +7 -7
- data/lib/Communications.rb +8 -7
- data/lib/Configuration.rb +7 -6
- data/lib/EnvironmentVariables.rb +2 -2
- data/lib/XMLFields.rb +98 -108
- data/lib/cacert.pem +0 -0
- data/samples/Auth/CnpAuthReversalTransaction.rb +15 -0
- data/samples/Auth/{LitleAuthorizationTransaction.rb → CnpAuthorizationTransaction.rb} +4 -4
- data/samples/Auth/{LitlePaymentFullLifeCycle.rb → CnpPaymentFullLifeCycle.rb} +11 -11
- data/samples/Batch/AccountUpdate.rb +11 -11
- data/samples/Batch/SampleBatchDriver.rb +16 -16
- data/samples/Capture/{LitleCaptureGivenAuthTransaction.rb → CnpCaptureGivenAuthTransaction.rb} +4 -4
- data/samples/Capture/CnpCaptureTransaction.rb +14 -0
- data/samples/Capture/{LitleForceCaptureTransaction.rb → CnpForceCaptureTransaction.rb} +5 -5
- data/samples/Capture/CnpPartialCapture.rb +16 -0
- data/samples/Credit/CnpCreditTransaction.rb +16 -0
- data/samples/Credit/{LitleRefundTransaction.rb → CnpRefundTransaction.rb} +4 -4
- data/samples/Other/{LitleAvsTransaction.rb → CnpAvsTransaction.rb} +4 -4
- data/samples/Other/CnpVoidTransaction.rb +19 -0
- data/samples/Paypage/FullPaypageLifeCycle.rb +16 -16
- data/samples/Run_all.rb +12 -12
- data/samples/Sale/{LitleSaleTransaction.rb → CnpSaleTransaction.rb} +4 -4
- data/samples/Sale/SampleSaleTransaction.rb +5 -5
- data/test/certification/certTest1_base.rb +104 -103
- data/test/certification/certTest2_authenhanced.rb +90 -88
- data/test/certification/certTest3_authreversal.rb +29 -28
- data/test/certification/certTest4_echeck.rb +22 -20
- data/test/certification/certTest5_token.rb +51 -49
- data/test/certification/certTest_batchAll.rb +60 -60
- data/test/certification/ts_all.rb +1 -1
- data/test/functional/test_activate.rb +9 -8
- data/test/functional/test_activateReversal.rb +5 -5
- data/test/functional/test_auth.rb +31 -30
- data/test/functional/test_authReversal.rb +8 -8
- data/test/functional/test_balanceInquiry.rb +6 -6
- data/test/functional/test_batch.rb +32 -32
- data/test/functional/test_batchStream.rb +14 -14
- data/test/functional/test_cancelSubscription.rb +4 -4
- data/test/functional/test_capture.rb +14 -14
- data/test/functional/test_captureGivenAuth.rb +16 -16
- data/test/functional/test_configuration.rb +26 -26
- data/test/functional/test_createPlan.rb +5 -5
- data/test/functional/test_credit.rb +13 -33
- data/test/functional/test_deactivate.rb +6 -6
- data/test/functional/test_deactivateReversal.rb +5 -5
- data/test/functional/test_depositReversal.rb +5 -5
- data/test/functional/test_echeckCredit.rb +20 -20
- data/test/functional/test_echeckRedeposit.rb +16 -16
- data/test/functional/test_echeckSale.rb +35 -35
- data/test/functional/test_echeckVerification.rb +17 -17
- data/test/functional/test_echeckVoid.rb +4 -4
- data/test/functional/test_forceCapture.rb +21 -21
- data/test/functional/test_fraudCheck.rb +6 -5
- data/test/functional/test_giftCardAuthReversal.rb +5 -5
- data/test/functional/test_giftCardCapture.rb +5 -5
- data/test/functional/test_giftCardCredit.rb +5 -5
- data/test/functional/test_litle_requests.rb +101 -99
- data/test/functional/test_load.rb +6 -6
- data/test/functional/test_loadReversal.rb +5 -5
- data/test/functional/test_override.rb +9 -9
- data/test/functional/{test_pgp_litle_requests.rb → test_pgp_cnp_requests.rb} +61 -60
- data/test/functional/test_queryTransaction.rb +10 -10
- data/test/functional/test_refundReversal.rb +5 -5
- data/test/functional/test_sale.rb +36 -36
- data/test/functional/test_token.rb +10 -10
- data/test/functional/test_unload.rb +6 -6
- data/test/functional/test_unloadReversal.rb +5 -5
- data/test/functional/test_updateCardValidationNumOnToken.rb +4 -4
- data/test/functional/test_updatePlan.rb +4 -4
- data/test/functional/test_updateSubscription.rb +5 -5
- data/test/functional/test_wallet.rb +5 -5
- data/test/functional/test_xmlfields.rb +29 -69
- data/test/functional/ts_all.rb +2 -2
- data/test/unit/test_LitleAUBatch.rb +15 -15
- data/test/unit/test_LitleBatchRequest.rb +42 -76
- data/test/unit/test_LitleOnlineRequest.rb +38 -38
- data/test/unit/test_LitleRequest.rb +47 -47
- data/test/unit/test_LitleTransaction.rb +34 -34
- data/test/unit/test_LitleXmlMapper.rb +27 -27
- data/test/unit/test_activate.rb +8 -8
- data/test/unit/test_activateReversal.rb +5 -5
- data/test/unit/test_auth.rb +43 -43
- data/test/unit/test_authReversal.rb +14 -14
- data/test/unit/test_balanceInquiry.rb +4 -4
- data/test/unit/test_cancelSubscription.rb +4 -4
- data/test/unit/test_capture.rb +20 -20
- data/test/unit/test_captureGivenAuth.rb +22 -22
- data/test/unit/test_createPlan.rb +4 -4
- data/test/unit/test_credit.rb +43 -43
- data/test/unit/test_deactivate.rb +6 -6
- data/test/unit/test_deactivateReversal.rb +5 -5
- data/test/unit/test_depositReversal.rb +5 -5
- data/test/unit/test_echeckCredit.rb +16 -16
- data/test/unit/test_echeckRedeposit.rb +19 -19
- data/test/unit/test_echeckSale.rb +16 -16
- data/test/unit/test_echeckVerification.rb +11 -11
- data/test/unit/test_echeckVoid.rb +8 -8
- data/test/unit/test_forceCapture.rb +19 -19
- data/test/unit/test_fraudCheck.rb +4 -4
- data/test/unit/test_giftCardAuthReversal.rb +5 -5
- data/test/unit/test_giftCardCapture.rb +5 -5
- data/test/unit/test_giftCardCredit.rb +5 -5
- data/test/unit/test_load.rb +4 -4
- data/test/unit/test_loadReversal.rb +5 -5
- data/test/unit/{test_pgp_LitleRequest → test_pgp_CnpRequest.rb} +32 -32
- data/test/unit/test_queryTransaction.rb +8 -8
- data/test/unit/test_refundReversal.rb +5 -5
- data/test/unit/test_sale.rb +64 -64
- data/test/unit/test_token.rb +13 -13
- data/test/unit/test_unload.rb +4 -4
- data/test/unit/test_unloadReversal.rb +5 -5
- data/test/unit/test_updateCardValidationNumOnToken.rb +16 -16
- data/test/unit/test_updatePlan.rb +4 -4
- data/test/unit/test_updateSubscription.rb +11 -11
- data/test/unit/test_wallet.rb +13 -13
- data/test/unit/test_xmlfields.rb +119 -119
- data/test/unit/ts_unit.rb +6 -6
- metadata +35 -26
- data/samples/Auth/LitleAuthReversalTransaction.rb +0 -15
- data/samples/Capture/LitleCaptureTransaction.rb +0 -14
- data/samples/Capture/LitlePartialCapture.rb +0 -16
- data/samples/Credit/LitleCreditTransaction.rb +0 -16
- data/samples/Other/LitleVoidTransaction.rb +0 -19
@@ -22,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/
|
25
|
+
require File.expand_path("../../../lib/CnpOnline",__FILE__)
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
28
|
#test RefundReversal Transaction
|
29
|
-
module
|
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
|
-
'
|
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=
|
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){
|
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/
|
25
|
+
require File.expand_path("../../../lib/CnpOnline",__FILE__)
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
|
-
module
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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
|
-
'
|
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){
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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
|
-
'
|
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){
|
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
|
-
'
|
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){
|
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
|
-
'
|
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){
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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
|
-
'
|
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=
|
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/
|
25
|
+
require File.expand_path("../../../lib/CnpOnline",__FILE__)
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
|
-
module
|
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=
|
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=
|
52
|
+
response= CnpOnlineRequest.new.register_token_request(hash)
|
53
53
|
assert_equal('Valid Format', response.message)
|
54
|
-
assert_equal('1111222233334444', response.registerTokenResponse.
|
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=
|
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=
|
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=
|
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=
|
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=
|
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/
|
25
|
+
require File.expand_path("../../../lib/CnpOnline",__FILE__)
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
28
|
#test Unload Transaction
|
29
|
-
module
|
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=
|
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=
|
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){
|
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){
|
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
|