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 Test_echeckSale < Test::Unit::TestCase
|
30
30
|
def test_echeck_sale_with_echeck
|
31
31
|
hash = {
|
@@ -38,9 +38,9 @@ module LitleOnline
|
|
38
38
|
'orderId'=>'12345',
|
39
39
|
'orderSource'=>'ecommerce',
|
40
40
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
41
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
41
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
42
42
|
}
|
43
|
-
response=
|
43
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
44
44
|
assert_equal('Valid Format', response.message)
|
45
45
|
end
|
46
46
|
|
@@ -52,7 +52,7 @@ module LitleOnline
|
|
52
52
|
'reportGroup'=>'Planets'
|
53
53
|
}
|
54
54
|
#Get exceptions
|
55
|
-
exception = assert_raise(RuntimeError){
|
55
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_sale(hash)}
|
56
56
|
#Test
|
57
57
|
assert(exception.message =~ /The content of element 'echeckSale' is not complete/)
|
58
58
|
end
|
@@ -68,9 +68,9 @@ module LitleOnline
|
|
68
68
|
'orderId'=>'12345',
|
69
69
|
'orderSource'=>'ecommerce',
|
70
70
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
71
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
71
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
72
72
|
}
|
73
|
-
response=
|
73
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
74
74
|
assert_equal('Valid Format', response.message)
|
75
75
|
end
|
76
76
|
|
@@ -85,10 +85,10 @@ module LitleOnline
|
|
85
85
|
'orderId'=>'12345',
|
86
86
|
'orderSource'=>'ecommerce',
|
87
87
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
88
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
89
|
-
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
88
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
89
|
+
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
90
90
|
}
|
91
|
-
response=
|
91
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
92
92
|
assert_equal('Valid Format', response.message)
|
93
93
|
end
|
94
94
|
|
@@ -102,11 +102,11 @@ module LitleOnline
|
|
102
102
|
'verify'=>'true',
|
103
103
|
'orderId'=>'12345',
|
104
104
|
'orderSource'=>'ecommerce',
|
105
|
-
'echeckToken' => {'accType'=>'Checking','
|
105
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
106
106
|
'customBilling'=>{'phone'=>'123456789','descriptor'=>'good'},
|
107
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
107
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
108
108
|
}
|
109
|
-
response=
|
109
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
110
110
|
assert_equal('Valid Format', response.message)
|
111
111
|
end
|
112
112
|
|
@@ -122,9 +122,9 @@ module LitleOnline
|
|
122
122
|
'verify'=>'true',
|
123
123
|
'orderId'=>'12345',
|
124
124
|
'orderSource'=>'ecommerce',
|
125
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
125
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
126
126
|
}
|
127
|
-
response=
|
127
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
128
128
|
assert_equal('Valid Format', response.message)
|
129
129
|
end
|
130
130
|
|
@@ -142,7 +142,7 @@ module LitleOnline
|
|
142
142
|
'orderSource'=>'ecommerce',
|
143
143
|
}
|
144
144
|
#Get exceptions
|
145
|
-
exception = assert_raise(RuntimeError){
|
145
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_sale(hash)}
|
146
146
|
#Test
|
147
147
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
148
148
|
end
|
@@ -151,15 +151,15 @@ module LitleOnline
|
|
151
151
|
hash = {
|
152
152
|
'reportGroup'=>'Planets',
|
153
153
|
'id'=>'test',
|
154
|
-
'
|
154
|
+
'cnpTxnId'=>'123456789101112',
|
155
155
|
'orderId'=>'12345',
|
156
156
|
'amount'=>'12',
|
157
157
|
'orderSource'=>'ecommerce',
|
158
|
-
'echeckToken' => {'accType'=>'Checking','
|
159
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
160
|
-
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
158
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
159
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
160
|
+
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
161
161
|
}
|
162
|
-
response=
|
162
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
163
163
|
assert_equal('Valid Format', response.message)
|
164
164
|
end
|
165
165
|
|
@@ -167,15 +167,15 @@ module LitleOnline
|
|
167
167
|
hash = {
|
168
168
|
'reportGroup'=>'Planets',
|
169
169
|
'id'=>'test',
|
170
|
-
'
|
170
|
+
'cnpTxnId'=>'123456',
|
171
171
|
'orderId'=>'12345',
|
172
172
|
'amount'=>'10',
|
173
173
|
'orderSource'=>'ecommerce',
|
174
|
-
'echeckToken' => {'accType'=>'Checking','
|
175
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
176
|
-
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
174
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
175
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
176
|
+
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
177
177
|
}
|
178
|
-
response=
|
178
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
179
179
|
assert_equal('Valid Format', response.message)
|
180
180
|
end
|
181
181
|
|
@@ -191,9 +191,9 @@ module LitleOnline
|
|
191
191
|
'orderId'=>'12345',
|
192
192
|
'orderSource'=>'ecommerce',
|
193
193
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
|
194
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
194
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
195
195
|
}
|
196
|
-
response=
|
196
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
197
197
|
assert_equal('Valid Format', response.message)
|
198
198
|
end
|
199
199
|
|
@@ -209,10 +209,10 @@ module LitleOnline
|
|
209
209
|
'orderId'=>'12345',
|
210
210
|
'orderSource'=>'ecommerce',
|
211
211
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'123456789012345678901234567890123456789012345678901234567890123456789012345678901'},
|
212
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
212
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
213
213
|
}
|
214
214
|
assert_raises RuntimeError do
|
215
|
-
response=
|
215
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
216
216
|
puts "validation for ccdPaymentInformation"
|
217
217
|
end
|
218
218
|
end
|
@@ -221,12 +221,12 @@ module LitleOnline
|
|
221
221
|
hash = {
|
222
222
|
'reportGroup'=>'Planets',
|
223
223
|
'id'=>'test',
|
224
|
-
'
|
224
|
+
'cnpTxnId'=>'123456789101112',
|
225
225
|
'amount'=>'12',
|
226
226
|
'secondaryAmount'=>'50'
|
227
227
|
}
|
228
228
|
#Get exceptions
|
229
|
-
exception = assert_raise(RuntimeError){
|
229
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_sale(hash)}
|
230
230
|
#Test
|
231
231
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
232
232
|
end
|
@@ -242,12 +242,12 @@ module LitleOnline
|
|
242
242
|
'orderId'=>'12345',
|
243
243
|
'orderSource'=>'ecommerce',
|
244
244
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
245
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
246
|
-
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
245
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
246
|
+
'shipToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
247
247
|
'merchantData'=>{'campaign'=>'camping'},
|
248
248
|
'customIdentifier' =>'identifier',
|
249
249
|
}
|
250
|
-
response=
|
250
|
+
response= CnpOnlineRequest.new.echeck_sale(hash)
|
251
251
|
assert_equal('Valid Format', response.message)
|
252
252
|
end
|
253
253
|
|
@@ -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_echeckVerification < Test::Unit::TestCase
|
30
30
|
|
31
31
|
def test_simple_echeck_verification
|
@@ -38,9 +38,9 @@ module LitleOnline
|
|
38
38
|
'orderId'=>'12345',
|
39
39
|
'orderSource'=>'ecommerce',
|
40
40
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
41
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
41
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
42
42
|
}
|
43
|
-
response=
|
43
|
+
response= CnpOnlineRequest.new.echeck_verification(hash)
|
44
44
|
assert_equal('Valid Format', response.message)
|
45
45
|
end
|
46
46
|
|
@@ -53,10 +53,10 @@ module LitleOnline
|
|
53
53
|
'amount'=>'123456',
|
54
54
|
'orderId'=>'12345',
|
55
55
|
'orderSource'=>'ecommerce',
|
56
|
-
'echeckToken' => {'accType'=>'Checking','
|
57
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
56
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
57
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
58
58
|
}
|
59
|
-
response=
|
59
|
+
response= CnpOnlineRequest.new.echeck_verification(hash)
|
60
60
|
assert_equal('Valid Format', response.message)
|
61
61
|
end
|
62
62
|
|
@@ -71,9 +71,9 @@ module LitleOnline
|
|
71
71
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
72
72
|
'orderId'=>'12345',
|
73
73
|
'orderSource'=>'ecommerce',
|
74
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
74
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
75
75
|
}
|
76
|
-
response=
|
76
|
+
response= CnpOnlineRequest.new.echeck_verification(hash)
|
77
77
|
assert_equal('Valid Format', response.message)
|
78
78
|
end
|
79
79
|
|
@@ -90,7 +90,7 @@ module LitleOnline
|
|
90
90
|
'orderSource'=>'ecommerce',
|
91
91
|
}
|
92
92
|
#Get exceptions
|
93
|
-
exception = assert_raise(RuntimeError){
|
93
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_verification(hash)}
|
94
94
|
#Test
|
95
95
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
96
96
|
end
|
@@ -104,7 +104,7 @@ module LitleOnline
|
|
104
104
|
'orderId'=>'12345'
|
105
105
|
}
|
106
106
|
#Get exceptions
|
107
|
-
exception = assert_raise(RuntimeError){
|
107
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_verification(hash)}
|
108
108
|
#Test
|
109
109
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
110
110
|
end
|
@@ -117,7 +117,7 @@ module LitleOnline
|
|
117
117
|
'reportGroup'=>'Planets',
|
118
118
|
}
|
119
119
|
#Get exceptions
|
120
|
-
exception = assert_raise(RuntimeError){
|
120
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_verification(hash)}
|
121
121
|
#Test
|
122
122
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
123
123
|
end
|
@@ -132,12 +132,12 @@ module LitleOnline
|
|
132
132
|
'orderId'=>'12345'
|
133
133
|
}
|
134
134
|
#Get exceptions
|
135
|
-
exception = assert_raise(RuntimeError){
|
135
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_verification(hash)}
|
136
136
|
#Test
|
137
137
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
138
138
|
end
|
139
139
|
|
140
|
-
def
|
140
|
+
def test_no_cnpTxnId
|
141
141
|
hash = {
|
142
142
|
'merchantId' => '101',
|
143
143
|
'version'=>'8.8',
|
@@ -145,13 +145,13 @@ module LitleOnline
|
|
145
145
|
'reportGroup'=>'Planets',
|
146
146
|
'amount'=>'123',
|
147
147
|
'invalidfield'=>'nonexistant',
|
148
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
148
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
149
149
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
|
150
150
|
'orderId'=>'12345',
|
151
151
|
'orderSource'=>'ecommerce',
|
152
|
-
#'
|
152
|
+
#'cnpTxnId'=>'123456',
|
153
153
|
}
|
154
|
-
response=
|
154
|
+
response= CnpOnlineRequest.new.echeck_verification(hash)
|
155
155
|
assert_equal('Valid Format', response.message)
|
156
156
|
end
|
157
157
|
|
@@ -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 TestAuthReversal < Test::Unit::TestCase
|
30
30
|
def test_simple_echeck_void
|
31
31
|
hash = {
|
@@ -33,9 +33,9 @@ module LitleOnline
|
|
33
33
|
'id' => 'test',
|
34
34
|
'version'=>'8.8',
|
35
35
|
'reportGroup'=>'Planets',
|
36
|
-
'
|
36
|
+
'cnpTxnId'=>'12345678000',
|
37
37
|
}
|
38
|
-
response=
|
38
|
+
response= CnpOnlineRequest.new.echeck_void(hash)
|
39
39
|
assert_equal('0', response.response)
|
40
40
|
end
|
41
41
|
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 TestForceCapture < Test::Unit::TestCase
|
30
30
|
def test_simple_force_capture_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',
|
@@ -42,7 +42,7 @@ module LitleOnline
|
|
42
42
|
'number' =>'4100000000000001',
|
43
43
|
'expDate' =>'1210'
|
44
44
|
}}
|
45
|
-
response=
|
45
|
+
response= CnpOnlineRequest.new.force_capture(hash)
|
46
46
|
|
47
47
|
assert_equal('0', response.response)
|
48
48
|
|
@@ -54,17 +54,17 @@ module LitleOnline
|
|
54
54
|
'id' => 'test',
|
55
55
|
'version'=>'8.8',
|
56
56
|
'reportGroup'=>'Planets',
|
57
|
-
'
|
57
|
+
'cnpTxnId'=>'123456',
|
58
58
|
'orderId'=>'12344',
|
59
59
|
'amount'=>'106',
|
60
60
|
'orderSource'=>'ecommerce',
|
61
61
|
'token'=> {
|
62
|
-
'
|
62
|
+
'cnpToken'=>'123456789101112',
|
63
63
|
'expDate'=>'1210',
|
64
64
|
'cardValidationNum'=>'555',
|
65
65
|
'type'=>'VI'
|
66
66
|
}}
|
67
|
-
response=
|
67
|
+
response= CnpOnlineRequest.new.force_capture(hash)
|
68
68
|
assert_equal('Valid Format', response.message)
|
69
69
|
end
|
70
70
|
|
@@ -74,7 +74,7 @@ module LitleOnline
|
|
74
74
|
'id' => 'test',
|
75
75
|
'version'=>'8.8',
|
76
76
|
'orderSource'=>'ecommerce',
|
77
|
-
'
|
77
|
+
'cnpTxnId'=>'123456',
|
78
78
|
'amount'=>'106',
|
79
79
|
'card'=>{
|
80
80
|
'type'=>'VI',
|
@@ -84,7 +84,7 @@ module LitleOnline
|
|
84
84
|
'reportGroup'=>'Planets',
|
85
85
|
'orderId'=>'12344'
|
86
86
|
}
|
87
|
-
response=
|
87
|
+
response= CnpOnlineRequest.new.force_capture(hash)
|
88
88
|
assert_equal('Valid Format', response.message)
|
89
89
|
end
|
90
90
|
|
@@ -94,7 +94,7 @@ module LitleOnline
|
|
94
94
|
'id' => 'test',
|
95
95
|
'version'=>'8.8',
|
96
96
|
'reportGroup'=>'Planets',
|
97
|
-
'
|
97
|
+
'cnpTxnId'=>'123456',
|
98
98
|
'orderId'=>'12344',
|
99
99
|
'amount'=>'106',
|
100
100
|
'orderSource'=>'ecommerce',
|
@@ -104,7 +104,7 @@ module LitleOnline
|
|
104
104
|
'number' =>'4100000000000001',
|
105
105
|
'expDate' =>'1210'
|
106
106
|
}}
|
107
|
-
response=
|
107
|
+
response= CnpOnlineRequest.new.force_capture(hash)
|
108
108
|
assert_equal('Valid Format', response.message)
|
109
109
|
end
|
110
110
|
|
@@ -114,17 +114,17 @@ module LitleOnline
|
|
114
114
|
'id' => 'test',
|
115
115
|
'version'=>'8.8',
|
116
116
|
'reportGroup'=>'Planets',
|
117
|
-
'
|
117
|
+
'cnpTxnId'=>'123456',
|
118
118
|
'amount'=>'106',
|
119
119
|
'orderSource'=>'ecommerce',
|
120
120
|
'token'=> {
|
121
|
-
'
|
121
|
+
'cnpToken'=>'123456789101112',
|
122
122
|
'expDate'=>'1210',
|
123
123
|
'cardValidationNum'=>'555',
|
124
124
|
'type'=>'VI'
|
125
125
|
}}
|
126
126
|
#Get exceptions
|
127
|
-
exception = assert_raise(RuntimeError){
|
127
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.force_capture(hash)}
|
128
128
|
#Test
|
129
129
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
130
130
|
end
|
@@ -135,7 +135,7 @@ module LitleOnline
|
|
135
135
|
'id' => 'test',
|
136
136
|
'version'=>'8.8',
|
137
137
|
'reportGroup'=>'Planets',
|
138
|
-
'
|
138
|
+
'cnpTxnId'=>'123456',
|
139
139
|
'orderId'=>'12344',
|
140
140
|
'amount'=>'106',
|
141
141
|
'card'=>{
|
@@ -144,7 +144,7 @@ module LitleOnline
|
|
144
144
|
'expDate' =>'1210'
|
145
145
|
}}
|
146
146
|
#Get exceptions
|
147
|
-
exception = assert_raise(RuntimeError){
|
147
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.force_capture(hash)}
|
148
148
|
#Test
|
149
149
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
150
150
|
end
|
@@ -155,7 +155,7 @@ module LitleOnline
|
|
155
155
|
'id' => 'test',
|
156
156
|
'version'=>'8.8',
|
157
157
|
'reportGroup'=>'Planets',
|
158
|
-
'
|
158
|
+
'cnpTxnId'=>'123456',
|
159
159
|
'orderId'=>'12344',
|
160
160
|
'amount'=>'106',
|
161
161
|
'orderSource'=>'ecommerce',
|
@@ -168,7 +168,7 @@ module LitleOnline
|
|
168
168
|
'track2Status'=>'0'
|
169
169
|
}
|
170
170
|
}
|
171
|
-
response=
|
171
|
+
response= CnpOnlineRequest.new.force_capture(hash)
|
172
172
|
assert_equal('0', response.response)
|
173
173
|
|
174
174
|
end
|
@@ -179,7 +179,7 @@ module LitleOnline
|
|
179
179
|
'id' => 'test',
|
180
180
|
'version'=>'8.8',
|
181
181
|
'reportGroup'=>'Planets',
|
182
|
-
'
|
182
|
+
'cnpTxnId'=>'123456',
|
183
183
|
'orderId'=>'12344',
|
184
184
|
'amount'=>'106',
|
185
185
|
'secondaryAmount'=>'20',
|
@@ -189,7 +189,7 @@ module LitleOnline
|
|
189
189
|
'number' =>'4100000000000001',
|
190
190
|
'expDate' =>'1210'
|
191
191
|
}}
|
192
|
-
response=
|
192
|
+
response= CnpOnlineRequest.new.force_capture(hash)
|
193
193
|
assert_equal('000', response.forceCaptureResponse.response)
|
194
194
|
end
|
195
195
|
|
@@ -208,7 +208,7 @@ module LitleOnline
|
|
208
208
|
'number' =>'4100000000000001',
|
209
209
|
'expDate' =>'1210'
|
210
210
|
}}
|
211
|
-
response=
|
211
|
+
response= CnpOnlineRequest.new.force_capture(hash)
|
212
212
|
|
213
213
|
assert_equal('0', response.response)
|
214
214
|
|