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 unloadReversal Transaction
|
29
|
-
module
|
29
|
+
module CnpOnline
|
30
30
|
class TestUnloadReversal < 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.unload_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 TestUpdateCardValidationNumOnToken < Test::Unit::TestCase
|
30
30
|
def test_simple
|
31
31
|
hash = {
|
@@ -34,10 +34,10 @@ module LitleOnline
|
|
34
34
|
'id'=>'test',
|
35
35
|
'reportGroup'=>'Planets',
|
36
36
|
'orderId'=>'12344',
|
37
|
-
'
|
37
|
+
'cnpToken'=>'1233456789103801',
|
38
38
|
'cardValidationNum'=>'123'
|
39
39
|
}
|
40
|
-
response=
|
40
|
+
response= CnpOnlineRequest.new.update_card_validation_num_on_token(hash)
|
41
41
|
assert_equal('Valid Format', response.message)
|
42
42
|
end
|
43
43
|
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 UpdatePlan Transaction
|
29
|
-
module
|
29
|
+
module CnpOnline
|
30
30
|
class TestUpdatePlan < Test::Unit::TestCase
|
31
31
|
|
32
32
|
def test_simple_happy
|
@@ -39,7 +39,7 @@ def test_simple_happy
|
|
39
39
|
'active'=>'true'
|
40
40
|
}
|
41
41
|
|
42
|
-
response=
|
42
|
+
response= CnpOnlineRequest.new.update_plan(hash)
|
43
43
|
assert_equal('Valid Format', response.message)
|
44
44
|
end
|
45
45
|
|
@@ -53,7 +53,7 @@ def test_simple_happy
|
|
53
53
|
}
|
54
54
|
|
55
55
|
#Get exceptions
|
56
|
-
exception = assert_raise(RuntimeError){
|
56
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.update_plan(hash)}
|
57
57
|
#Test
|
58
58
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
59
59
|
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 Authorization Transaction
|
29
|
-
module
|
29
|
+
module CnpOnline
|
30
30
|
class TestUpdateSubscription < Test::Unit::TestCase
|
31
31
|
|
32
32
|
def test_simple_happy
|
@@ -38,7 +38,7 @@ def test_simple_happy
|
|
38
38
|
'subscriptionId' =>'1001'
|
39
39
|
}
|
40
40
|
|
41
|
-
response=
|
41
|
+
response= CnpOnlineRequest.new.update_subscription(hash)
|
42
42
|
assert_equal('Valid Format', response.message)
|
43
43
|
end
|
44
44
|
|
@@ -60,7 +60,7 @@ def test_simple_happy
|
|
60
60
|
|
61
61
|
}
|
62
62
|
|
63
|
-
response=
|
63
|
+
response= CnpOnlineRequest.new.update_subscription(hash)
|
64
64
|
assert_equal('Valid Format', response.message)
|
65
65
|
end
|
66
66
|
|
@@ -72,7 +72,7 @@ def test_simple_happy
|
|
72
72
|
}
|
73
73
|
|
74
74
|
#Get exceptions
|
75
|
-
exception = assert_raise(RuntimeError){
|
75
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.update_subscription(hash)}
|
76
76
|
#Test
|
77
77
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
78
78
|
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 Authorization Transaction
|
29
|
-
module
|
29
|
+
module CnpOnline
|
30
30
|
class TestAuth < Test::Unit::TestCase
|
31
31
|
def test_simple_auth_with_wallet
|
32
32
|
hash = {
|
@@ -45,7 +45,7 @@ module LitleOnline
|
|
45
45
|
'walletSourceType' => 'MasterPass',
|
46
46
|
'walletSourceTypeId' => '102'
|
47
47
|
}}
|
48
|
-
response=
|
48
|
+
response= CnpOnlineRequest.new.authorization(hash)
|
49
49
|
assert_equal 'Valid Format', response.message
|
50
50
|
end
|
51
51
|
|
@@ -55,7 +55,7 @@ module LitleOnline
|
|
55
55
|
'id' => 'test',
|
56
56
|
'version'=>'8.8',
|
57
57
|
'reportGroup'=>'Planets',
|
58
|
-
'
|
58
|
+
'cnpTxnId'=>'123456',
|
59
59
|
'orderId'=>'12344',
|
60
60
|
'amount'=>'106',
|
61
61
|
'orderSource'=>'ecommerce',
|
@@ -67,7 +67,7 @@ module LitleOnline
|
|
67
67
|
'walletSourceType' => 'MasterPass',
|
68
68
|
'walletSourceTypeId' => '102'
|
69
69
|
}}
|
70
|
-
response=
|
70
|
+
response= CnpOnlineRequest.new.sale(hash)
|
71
71
|
assert_equal 'Valid Format', response.message
|
72
72
|
end
|
73
73
|
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 TestXmlfields < Test::Unit::TestCase
|
30
30
|
def test_card_no_required_type_or_track
|
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
|
'cardValidationNum'=> '123'
|
44
44
|
}}
|
45
45
|
#Get exceptions
|
46
|
-
exception = assert_raise(RuntimeError){
|
46
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.sale(hash)}
|
47
47
|
#Test
|
48
48
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
49
49
|
end
|
@@ -54,7 +54,7 @@ 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',
|
@@ -64,38 +64,17 @@ module LitleOnline
|
|
64
64
|
'number' =>'4100000000000000',
|
65
65
|
'expDate' =>'1210'
|
66
66
|
}}
|
67
|
-
response=
|
67
|
+
response= CnpOnlineRequest.new.sale(hash)
|
68
68
|
assert_equal('Valid Format', response.message)
|
69
69
|
end
|
70
|
-
|
71
|
-
def test_bill_me_later
|
72
|
-
hash = {
|
73
|
-
'merchantId' => '101',
|
74
|
-
'id' => 'test',
|
75
|
-
'version'=>'8.8',
|
76
|
-
'reportGroup'=>'Planets',
|
77
|
-
'litleTxnId'=>'123456',
|
78
|
-
'orderId'=>'12344',
|
79
|
-
'amount'=>'106',
|
80
|
-
'orderSource'=>'ecommerce',
|
81
|
-
'billMeLaterRequest'=>{'bmlMerchantId'=>'12345','preapprovalNumber'=>'12345678909023',
|
82
|
-
'customerPhoneChnaged'=>'False','itemCategoryCode'=>'2'},
|
83
|
-
'card'=>{
|
84
|
-
'type'=>'VI',
|
85
|
-
'number' =>'4100000000000000',
|
86
|
-
'expDate' =>'1210'
|
87
|
-
}}
|
88
|
-
response= LitleOnlineRequest.new.sale(hash)
|
89
|
-
assert_equal('000', response.saleResponse.response)
|
90
|
-
end
|
91
|
-
|
70
|
+
|
92
71
|
def test__customer_info
|
93
72
|
hash = {
|
94
73
|
'merchantId' => '101',
|
95
74
|
'id' => 'test',
|
96
75
|
'version'=>'8.8',
|
97
76
|
'reportGroup'=>'Planets',
|
98
|
-
'
|
77
|
+
'cnpTxnId'=>'123456',
|
99
78
|
'orderId'=>'12344',
|
100
79
|
'amount'=>'106',
|
101
80
|
'orderSource'=>'ecommerce',
|
@@ -105,7 +84,7 @@ module LitleOnline
|
|
105
84
|
'number' =>'4100000000000000',
|
106
85
|
'expDate' =>'1210'
|
107
86
|
}}
|
108
|
-
response=
|
87
|
+
response= CnpOnlineRequest.new.sale(hash)
|
109
88
|
assert_equal('Valid Format', response.message)
|
110
89
|
end
|
111
90
|
|
@@ -118,13 +97,13 @@ module LitleOnline
|
|
118
97
|
'orderId'=>'12344',
|
119
98
|
'amount'=>'106',
|
120
99
|
'orderSource'=>'ecommerce',
|
121
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
100
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
122
101
|
'card'=>{
|
123
102
|
'type'=>'VI',
|
124
103
|
'number' =>'4100000000000000',
|
125
104
|
'expDate' =>'1210'
|
126
105
|
}}
|
127
|
-
response=
|
106
|
+
response= CnpOnlineRequest.new.authorization(hash)
|
128
107
|
assert_equal('Valid Format', response.message)
|
129
108
|
end
|
130
109
|
|
@@ -143,7 +122,7 @@ module LitleOnline
|
|
143
122
|
'number' =>'4100000000000000',
|
144
123
|
'expDate' =>'1210'
|
145
124
|
}}
|
146
|
-
response=
|
125
|
+
response= CnpOnlineRequest.new.authorization(hash)
|
147
126
|
assert_equal('Valid Format', response.message)
|
148
127
|
end
|
149
128
|
|
@@ -162,26 +141,7 @@ module LitleOnline
|
|
162
141
|
'number' =>'4100000000000000',
|
163
142
|
'expDate' =>'1210'
|
164
143
|
}}
|
165
|
-
response=
|
166
|
-
assert_equal('Valid Format', response.message)
|
167
|
-
end
|
168
|
-
|
169
|
-
def test_amex_data
|
170
|
-
hash = {
|
171
|
-
'merchantId' => '101',
|
172
|
-
'id' => 'test',
|
173
|
-
'version'=>'8.8',
|
174
|
-
'reportGroup'=>'Planets',
|
175
|
-
'orderId'=>'12344',
|
176
|
-
'amount'=>'106',
|
177
|
-
'card'=>{
|
178
|
-
'type'=>'VI',
|
179
|
-
'number' =>'4100000000000000',
|
180
|
-
'expDate' =>'1210'},
|
181
|
-
'orderSource'=>'ecommerce',
|
182
|
-
'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234','sellerId'=>'1234Id'}
|
183
|
-
}
|
184
|
-
response= LitleOnlineRequest.new.credit(hash)
|
144
|
+
response= CnpOnlineRequest.new.authorization(hash)
|
185
145
|
assert_equal('Valid Format', response.message)
|
186
146
|
end
|
187
147
|
|
@@ -201,7 +161,7 @@ module LitleOnline
|
|
201
161
|
'amexAggregatorData'=>{'sellerMerchantCategoryCode'=>'1234'}
|
202
162
|
}
|
203
163
|
#Get exceptions
|
204
|
-
exception = assert_raise(RuntimeError){
|
164
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.credit(hash)}
|
205
165
|
#Test
|
206
166
|
assert(exception.message =~ /Error validating xml data against the schema/)
|
207
167
|
end
|
@@ -220,14 +180,14 @@ module LitleOnline
|
|
220
180
|
'expDate' =>'1210'},
|
221
181
|
'orderSource'=>'ecommerce',
|
222
182
|
'enhancedData'=>{
|
223
|
-
'customerReference'=>'
|
183
|
+
'customerReference'=>'Cnp',
|
224
184
|
'salesTax'=>'50',
|
225
185
|
'deliveryType'=>'TBD',
|
226
186
|
'restriction'=>'DIG',
|
227
187
|
'shipFromPostalCode'=>'01741',
|
228
188
|
'destinationPostalCode'=>'01742'}
|
229
189
|
}
|
230
|
-
response=
|
190
|
+
response= CnpOnlineRequest.new.credit(hash)
|
231
191
|
assert_equal('Valid Format', response.message)
|
232
192
|
end
|
233
193
|
|
@@ -246,14 +206,14 @@ module LitleOnline
|
|
246
206
|
'orderSource'=>'ecommerce',
|
247
207
|
'enhancedData'=>{
|
248
208
|
'detailtax'=>{'taxAmount'=>'1234','tax'=>'50'},
|
249
|
-
'customerReference'=>'
|
209
|
+
'customerReference'=>'Cnp',
|
250
210
|
'salesTax'=>'50',
|
251
211
|
'deliveryType'=>'TBD',
|
252
212
|
'restriction'=>'DIG',
|
253
213
|
'shipFromPostalCode'=>'01741',
|
254
214
|
'destinationPostalCode'=>'01742'}
|
255
215
|
}
|
256
|
-
response=
|
216
|
+
response= CnpOnlineRequest.new.credit(hash)
|
257
217
|
assert_equal('Valid Format', response.message)
|
258
218
|
end
|
259
219
|
|
@@ -278,14 +238,14 @@ module LitleOnline
|
|
278
238
|
'unitOfMeasure'=>'pounds',
|
279
239
|
'enhancedData'=>{
|
280
240
|
'detailtax'=>{'taxAmount'=>'1234','tax'=>'50'}},
|
281
|
-
'customerReference'=>'
|
241
|
+
'customerReference'=>'Cnp',
|
282
242
|
'salesTax'=>'50',
|
283
243
|
'deliveryType'=>'TBD',
|
284
244
|
'restriction'=>'DIG',
|
285
245
|
'shipFromPostalCode'=>'01741',
|
286
246
|
'destinationPostalCode'=>'01742'}
|
287
247
|
}
|
288
|
-
response=
|
248
|
+
response= CnpOnlineRequest.new.credit(hash)
|
289
249
|
assert_equal('Valid Format', response.message)
|
290
250
|
end
|
291
251
|
|
@@ -299,12 +259,12 @@ module LitleOnline
|
|
299
259
|
'amount'=>'106',
|
300
260
|
'orderSource'=>'ecommerce',
|
301
261
|
'token'=> {
|
302
|
-
'
|
262
|
+
'cnpToken'=>'123456789101112',
|
303
263
|
'expDate'=>'1210',
|
304
264
|
'cardValidationNum'=>'555',
|
305
265
|
'type'=>'VI'
|
306
266
|
}}
|
307
|
-
response=
|
267
|
+
response= CnpOnlineRequest.new.credit(hash)
|
308
268
|
assert_equal('Valid Format', response.message)
|
309
269
|
end
|
310
270
|
|
@@ -318,10 +278,10 @@ module LitleOnline
|
|
318
278
|
'amount'=>'106',
|
319
279
|
'orderSource'=>'ecommerce',
|
320
280
|
'token'=> {
|
321
|
-
'
|
281
|
+
'cnpToken'=>'123456789101112',
|
322
282
|
'type'=>'VI'
|
323
283
|
}}
|
324
|
-
response=
|
284
|
+
response= CnpOnlineRequest.new.credit(hash)
|
325
285
|
assert_equal('Valid Format', response.message)
|
326
286
|
end
|
327
287
|
|
@@ -340,7 +300,7 @@ module LitleOnline
|
|
340
300
|
'cardValidationNum'=>'555',
|
341
301
|
'type'=>'VI'
|
342
302
|
}}
|
343
|
-
response=
|
303
|
+
response= CnpOnlineRequest.new.credit(hash)
|
344
304
|
assert_equal('Valid Format', response.message)
|
345
305
|
end
|
346
306
|
|
@@ -357,7 +317,7 @@ module LitleOnline
|
|
357
317
|
'paypageRegistrationId'=>'123456789101112',
|
358
318
|
'type'=>'VI'
|
359
319
|
}}
|
360
|
-
response=
|
320
|
+
response= CnpOnlineRequest.new.credit(hash)
|
361
321
|
assert_equal('Valid Format', response.message)
|
362
322
|
end
|
363
323
|
|
@@ -383,7 +343,7 @@ module LitleOnline
|
|
383
343
|
]
|
384
344
|
}
|
385
345
|
}
|
386
|
-
response=
|
346
|
+
response= CnpOnlineRequest.new.authorization(hash)
|
387
347
|
assert_equal('Valid Format', response.message)
|
388
348
|
end
|
389
349
|
|
@@ -409,7 +369,7 @@ module LitleOnline
|
|
409
369
|
]
|
410
370
|
}
|
411
371
|
}
|
412
|
-
response=
|
372
|
+
response= CnpOnlineRequest.new.authorization(hash)
|
413
373
|
assert_equal('Valid Format', response.message)
|
414
374
|
end
|
415
375
|
|
@@ -443,7 +403,7 @@ module LitleOnline
|
|
443
403
|
{'taxAmount'=>'6'}
|
444
404
|
]}
|
445
405
|
}
|
446
|
-
response=
|
406
|
+
response= CnpOnlineRequest.new.authorization(hash)
|
447
407
|
assert_equal('Valid Format', response.message)
|
448
408
|
end
|
449
409
|
end
|
data/test/functional/ts_all.rb
CHANGED
@@ -23,7 +23,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
23
23
|
OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
=end
|
25
25
|
|
26
|
-
require File.expand_path("../../../lib/
|
26
|
+
require File.expand_path("../../../lib/CnpOnline",__FILE__)
|
27
27
|
|
28
28
|
|
29
29
|
#test driver for running all tests
|
@@ -46,7 +46,7 @@ require_relative 'test_echeckVoid'
|
|
46
46
|
require_relative 'test_updateCardValidationNumOnToken'
|
47
47
|
require_relative 'test_wallet'
|
48
48
|
require_relative 'test_queryTransaction'
|
49
|
-
require_relative '
|
49
|
+
#require_relative 'test_cnp_requests'
|
50
50
|
require_relative 'test_batch'
|
51
51
|
require_relative 'test_cancelSubscription'
|
52
52
|
require_relative 'test_updateSubscription'
|