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,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 TestCredit < Test::Unit::TestCase
|
30
30
|
def test_simple_credit_with_card
|
31
31
|
hash = {
|
@@ -41,7 +41,7 @@ module LitleOnline
|
|
41
41
|
'number' =>'4100000000000001',
|
42
42
|
'expDate' =>'1210'
|
43
43
|
}}
|
44
|
-
response=
|
44
|
+
response= CnpOnlineRequest.new.credit(hash)
|
45
45
|
assert_equal('Valid Format', response.message)
|
46
46
|
end
|
47
47
|
|
@@ -58,7 +58,7 @@ module LitleOnline
|
|
58
58
|
'payerId'=>'1234',
|
59
59
|
'transactionId'=>'1234',
|
60
60
|
}}
|
61
|
-
response=
|
61
|
+
response= CnpOnlineRequest.new.credit(hash)
|
62
62
|
assert_equal('Valid Format', response.message)
|
63
63
|
end
|
64
64
|
|
@@ -76,7 +76,7 @@ module LitleOnline
|
|
76
76
|
'payerId'=>'1234',
|
77
77
|
'transactionId'=>'1234',
|
78
78
|
}}
|
79
|
-
response=
|
79
|
+
response= CnpOnlineRequest.new.credit(hash)
|
80
80
|
assert_equal('Valid Format', response.message)
|
81
81
|
end
|
82
82
|
|
@@ -88,9 +88,9 @@ module LitleOnline
|
|
88
88
|
'reportGroup'=>'Planets',
|
89
89
|
'amount'=>'106',
|
90
90
|
'secondaryAmount'=>'50',
|
91
|
-
'
|
91
|
+
'cnpTxnId'=>'123456'
|
92
92
|
}
|
93
|
-
response=
|
93
|
+
response= CnpOnlineRequest.new.credit(hash)
|
94
94
|
assert_equal('Valid Format', response.message)
|
95
95
|
end
|
96
96
|
|
@@ -109,7 +109,7 @@ module LitleOnline
|
|
109
109
|
'orderSource'=>'ecommerce',
|
110
110
|
'amount'=>'106'
|
111
111
|
}
|
112
|
-
response=
|
112
|
+
response= CnpOnlineRequest.new.credit(hash)
|
113
113
|
assert_equal('Valid Format', response.message)
|
114
114
|
end
|
115
115
|
|
@@ -128,7 +128,7 @@ module LitleOnline
|
|
128
128
|
'number' =>'4100000000000001',
|
129
129
|
'expDate' =>'1210'
|
130
130
|
}}
|
131
|
-
response=
|
131
|
+
response= CnpOnlineRequest.new.credit(hash)
|
132
132
|
assert_equal('Valid Format', response.message)
|
133
133
|
end
|
134
134
|
|
@@ -147,27 +147,7 @@ module LitleOnline
|
|
147
147
|
'number' =>'4100000000000001',
|
148
148
|
'expDate' =>'1210'
|
149
149
|
}}
|
150
|
-
response=
|
151
|
-
assert_equal('Valid Format', response.message)
|
152
|
-
end
|
153
|
-
|
154
|
-
def test_processing_instructions_and_amex_data
|
155
|
-
hash = {
|
156
|
-
'merchantId' => '101',
|
157
|
-
'id' => '102',
|
158
|
-
'version'=>'8.8',
|
159
|
-
'reportGroup'=>'Planets',
|
160
|
-
'amount'=>'2000',
|
161
|
-
'orderId'=>'12344',
|
162
|
-
'orderSource'=>'ecommerce',
|
163
|
-
'processingInstuctions'=>{'bypassVelocityCheck'=>'yes'},
|
164
|
-
'card'=>{
|
165
|
-
'type'=>'VI',
|
166
|
-
'number' =>'4100000000000001',
|
167
|
-
'expDate' =>'1210'},
|
168
|
-
'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234','sellerId'=>'1234Id'}
|
169
|
-
}
|
170
|
-
response= LitleOnlineRequest.new.credit(hash)
|
150
|
+
response= CnpOnlineRequest.new.credit(hash)
|
171
151
|
assert_equal('Valid Format', response.message)
|
172
152
|
end
|
173
153
|
|
@@ -189,7 +169,7 @@ module LitleOnline
|
|
189
169
|
'track2Status'=>'0'
|
190
170
|
}
|
191
171
|
}
|
192
|
-
response=
|
172
|
+
response= CnpOnlineRequest.new.credit(hash)
|
193
173
|
assert_equal('Valid Format', response.message)
|
194
174
|
end
|
195
175
|
|
@@ -200,10 +180,10 @@ module LitleOnline
|
|
200
180
|
'reportGroup'=>'Planets',
|
201
181
|
'amount'=>'106',
|
202
182
|
'secondaryAmount'=>'20',
|
203
|
-
'
|
183
|
+
'cnpTxnId'=>'123456000',
|
204
184
|
'pin'=>'1234'
|
205
185
|
}
|
206
|
-
response=
|
186
|
+
response= CnpOnlineRequest.new.credit(hash)
|
207
187
|
assert_equal('Valid Format', response.message)
|
208
188
|
assert_equal('000', response.creditResponse.response)
|
209
189
|
end
|
@@ -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 Deactivate Transaction
|
29
|
-
module
|
29
|
+
module CnpOnline
|
30
30
|
class TestDeactivate < Test::Unit::TestCase
|
31
31
|
|
32
32
|
def test_simple_happy
|
@@ -44,7 +44,7 @@ def test_simple_happy
|
|
44
44
|
}
|
45
45
|
}
|
46
46
|
|
47
|
-
response=
|
47
|
+
response= CnpOnlineRequest.new.deactivate(hash)
|
48
48
|
assert_equal('Valid Format', response.message)
|
49
49
|
end
|
50
50
|
|
@@ -63,7 +63,7 @@ def test_simple_happy
|
|
63
63
|
}
|
64
64
|
}
|
65
65
|
|
66
|
-
response=
|
66
|
+
response= CnpOnlineRequest.new.deactivate(hash)
|
67
67
|
assert_equal('Valid Format', response.message)
|
68
68
|
end
|
69
69
|
|
@@ -76,7 +76,7 @@ def test_simple_happy
|
|
76
76
|
}
|
77
77
|
|
78
78
|
#Get exceptions
|
79
|
-
exception = assert_raise(RuntimeError){
|
79
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.deactivate(hash)}
|
80
80
|
#Test
|
81
81
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
82
82
|
end
|
@@ -96,7 +96,7 @@ def test_simple_happy
|
|
96
96
|
}
|
97
97
|
}
|
98
98
|
#Get exceptions
|
99
|
-
exception = assert_raise(RuntimeError){
|
99
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.deactivate(hash)}
|
100
100
|
#Test
|
101
101
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
102
102
|
end
|
@@ -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 DeactivateReversal Transaction
|
29
|
-
module
|
29
|
+
module CnpOnline
|
30
30
|
class TestDectivateReversal < 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.deactivate_reversal(hash)}
|
67
67
|
#Test
|
68
68
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
69
69
|
end
|
@@ -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 DepositReversal Transaction
|
29
|
-
module
|
29
|
+
module CnpOnline
|
30
30
|
class TestDepositReversal < Test::Unit::TestCase
|
31
31
|
def test_simple
|
32
32
|
hash = {
|
@@ -34,7 +34,7 @@ module LitleOnline
|
|
34
34
|
'version'=>'8.8',
|
35
35
|
'id'=>'test',
|
36
36
|
'reportGroup'=>'Planets',
|
37
|
-
'
|
37
|
+
'cnpTxnId' =>'5000',
|
38
38
|
'card'=>{
|
39
39
|
'type'=>'GC',
|
40
40
|
'number' =>'400000000000000',
|
@@ -49,7 +49,7 @@ module LitleOnline
|
|
49
49
|
'originalSequenceNumber' => '111111',
|
50
50
|
}
|
51
51
|
|
52
|
-
response=
|
52
|
+
response= CnpOnlineRequest.new.deposit_reversal(hash)
|
53
53
|
assert_equal('000', response.depositReversalResponse.response)
|
54
54
|
end
|
55
55
|
|
@@ -62,7 +62,7 @@ module LitleOnline
|
|
62
62
|
}
|
63
63
|
|
64
64
|
#Get exceptions
|
65
|
-
exception = assert_raise(RuntimeError){
|
65
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.deposit_reversal(hash)}
|
66
66
|
#Test
|
67
67
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
68
68
|
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 Test_echeckCredit < Test::Unit::TestCase
|
30
30
|
def test_simple_echeckcredit
|
31
31
|
hash = {
|
@@ -33,10 +33,10 @@ module LitleOnline
|
|
33
33
|
'version'=>'8.8',
|
34
34
|
'id'=>'test',
|
35
35
|
'reportGroup'=>'Planets',
|
36
|
-
'
|
36
|
+
'cnpTxnId'=>'123456789101112',
|
37
37
|
'amount'=>'12'
|
38
38
|
}
|
39
|
-
response=
|
39
|
+
response= CnpOnlineRequest.new.echeck_credit(hash)
|
40
40
|
assert_equal('Valid Format', response.message)
|
41
41
|
end
|
42
42
|
|
@@ -48,7 +48,7 @@ module LitleOnline
|
|
48
48
|
'reportGroup'=>'Planets',
|
49
49
|
}
|
50
50
|
#Get exceptions
|
51
|
-
exception = assert_raise(RuntimeError){
|
51
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_credit(hash)}
|
52
52
|
#Test
|
53
53
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
54
54
|
end
|
@@ -64,9 +64,9 @@ module LitleOnline
|
|
64
64
|
'orderId'=>'12345',
|
65
65
|
'orderSource'=>'ecommerce',
|
66
66
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
67
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
67
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
68
68
|
}
|
69
|
-
response=
|
69
|
+
response= CnpOnlineRequest.new.echeck_credit(hash)
|
70
70
|
assert_equal('Valid Format', response.message)
|
71
71
|
end
|
72
72
|
|
@@ -80,10 +80,10 @@ module LitleOnline
|
|
80
80
|
'verify'=>'true',
|
81
81
|
'orderId'=>'12345',
|
82
82
|
'orderSource'=>'ecommerce',
|
83
|
-
'echeckToken' => {'accType'=>'Checking','
|
84
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
83
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
84
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
85
85
|
}
|
86
|
-
response=
|
86
|
+
response= CnpOnlineRequest.new.echeck_credit(hash)
|
87
87
|
assert_equal('Valid Format', response.message)
|
88
88
|
end
|
89
89
|
|
@@ -99,9 +99,9 @@ module LitleOnline
|
|
99
99
|
'verify'=>'true',
|
100
100
|
'orderId'=>'12345',
|
101
101
|
'orderSource'=>'ecommerce',
|
102
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
102
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
103
103
|
}
|
104
|
-
response=
|
104
|
+
response= CnpOnlineRequest.new.echeck_credit(hash)
|
105
105
|
assert_equal('Valid Format', response.message)
|
106
106
|
end
|
107
107
|
|
@@ -119,7 +119,7 @@ module LitleOnline
|
|
119
119
|
'orderSource'=>'ecommerce',
|
120
120
|
}
|
121
121
|
#Get exceptions
|
122
|
-
exception = assert_raise(RuntimeError){
|
122
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_credit(hash)}
|
123
123
|
#Test
|
124
124
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
125
125
|
end
|
@@ -136,9 +136,9 @@ module LitleOnline
|
|
136
136
|
'orderId'=>'12345',
|
137
137
|
'orderSource'=>'ecommerce',
|
138
138
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
139
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
139
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
140
140
|
}
|
141
|
-
response=
|
141
|
+
response= CnpOnlineRequest.new.echeck_credit(hash)
|
142
142
|
assert_equal('Valid Format', response.message)
|
143
143
|
end
|
144
144
|
|
@@ -148,11 +148,11 @@ module LitleOnline
|
|
148
148
|
'version'=>'8.8',
|
149
149
|
'id'=>'test',
|
150
150
|
'reportGroup'=>'Planets',
|
151
|
-
'
|
151
|
+
'cnpTxnId'=>'123456789101112',
|
152
152
|
'amount'=>'12',
|
153
153
|
'secondaryAmount'=>'50'
|
154
154
|
}
|
155
|
-
response=
|
155
|
+
response= CnpOnlineRequest.new.echeck_credit(hash)
|
156
156
|
assert_equal('Valid Format', response.message)
|
157
157
|
end
|
158
158
|
|
@@ -167,12 +167,12 @@ module LitleOnline
|
|
167
167
|
'orderId'=>'12345',
|
168
168
|
'orderSource'=>'ecommerce',
|
169
169
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
170
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
171
|
-
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
170
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
171
|
+
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
172
172
|
'merchantData'=>{'campaign'=>'camping'},
|
173
173
|
'customIdentifier' =>'identifier',
|
174
174
|
}
|
175
|
-
response=
|
175
|
+
response= CnpOnlineRequest.new.echeck_credit(hash)
|
176
176
|
assert_equal('Valid Format', response.message)
|
177
177
|
end
|
178
178
|
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 Test_echeckRedeposit < Test::Unit::TestCase
|
30
30
|
def test_simple_echeck_redeposit
|
31
31
|
hash = {
|
@@ -33,9 +33,9 @@ module LitleOnline
|
|
33
33
|
'version'=>'8.8',
|
34
34
|
'id'=>'test',
|
35
35
|
'reportGroup'=>'Planets',
|
36
|
-
'
|
36
|
+
'cnpTxnId'=>'123456'
|
37
37
|
}
|
38
|
-
response=
|
38
|
+
response= CnpOnlineRequest.new.echeck_redeposit(hash)
|
39
39
|
assert_equal('Valid Format', response.message)
|
40
40
|
end
|
41
41
|
|
@@ -45,10 +45,10 @@ module LitleOnline
|
|
45
45
|
'version'=>'8.8',
|
46
46
|
'id'=>'test',
|
47
47
|
'reportGroup'=>'Planets',
|
48
|
-
'
|
48
|
+
'cnpTxnId'=>'123456',
|
49
49
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
50
50
|
}
|
51
|
-
response=
|
51
|
+
response= CnpOnlineRequest.new.echeck_redeposit(hash)
|
52
52
|
assert_equal('Valid Format', response.message)
|
53
53
|
end
|
54
54
|
|
@@ -58,11 +58,11 @@ module LitleOnline
|
|
58
58
|
'version'=>'8.8',
|
59
59
|
'id'=>'test',
|
60
60
|
'reportGroup'=>'Planets',
|
61
|
-
'
|
62
|
-
'echeckToken' => {'accType'=>'Checking','
|
61
|
+
'cnpTxnId'=>'123456',
|
62
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
63
63
|
|
64
64
|
}
|
65
|
-
response=
|
65
|
+
response= CnpOnlineRequest.new.echeck_redeposit(hash)
|
66
66
|
assert_equal('Valid Format', response.message)
|
67
67
|
end
|
68
68
|
|
@@ -74,9 +74,9 @@ module LitleOnline
|
|
74
74
|
'reportGroup'=>'Planets',
|
75
75
|
'invalidfield'=>'nonexistant',
|
76
76
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
77
|
-
'
|
77
|
+
'cnpTxnId'=>'123456'
|
78
78
|
}
|
79
|
-
response=
|
79
|
+
response= CnpOnlineRequest.new.echeck_redeposit(hash)
|
80
80
|
assert_equal('Valid Format', response.message)
|
81
81
|
end
|
82
82
|
|
@@ -87,7 +87,7 @@ module LitleOnline
|
|
87
87
|
'reportGroup'=>'Planets',
|
88
88
|
}
|
89
89
|
#Get exceptions
|
90
|
-
exception = assert_raise(RuntimeError){
|
90
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_redeposit(hash)}
|
91
91
|
#Test
|
92
92
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
93
93
|
end
|
@@ -101,15 +101,15 @@ module LitleOnline
|
|
101
101
|
'amount'=>'123456',
|
102
102
|
'verify'=>'true',
|
103
103
|
'orderId'=>'12345',
|
104
|
-
'
|
104
|
+
'cnpTxnId'=>'123456',
|
105
105
|
'orderSource'=>'ecommerce',
|
106
106
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
107
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
108
|
-
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
107
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
108
|
+
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
109
109
|
'merchantData'=>{'campaign'=>'camping'},
|
110
110
|
'customIdentifier' =>'identifier',
|
111
111
|
}
|
112
|
-
response=
|
112
|
+
response= CnpOnlineRequest.new.echeck_redeposit(hash)
|
113
113
|
assert_equal('Valid Format', response.message)
|
114
114
|
end
|
115
115
|
|