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
|
require 'mocha/setup'
|
28
|
-
module
|
28
|
+
module CnpOnline
|
29
29
|
class TestDeactivate < Test::Unit::TestCase
|
30
30
|
|
31
31
|
def test_simple
|
@@ -43,8 +43,8 @@ module LitleOnline
|
|
43
43
|
}
|
44
44
|
}
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<deactivate reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/deactivate>.*/m), is_a(Hash))
|
47
|
+
CnpOnlineRequest.new.deactivate(hash)
|
48
48
|
end
|
49
49
|
|
50
50
|
def test_simple
|
@@ -62,8 +62,8 @@ module LitleOnline
|
|
62
62
|
}
|
63
63
|
}
|
64
64
|
|
65
|
-
|
66
|
-
|
65
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<deactivate reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/deactivate>.*/m), is_a(Hash))
|
66
|
+
CnpOnlineRequest.new.deactivate(hash)
|
67
67
|
end
|
68
68
|
|
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
|
require 'mocha/setup'
|
28
|
-
module
|
28
|
+
module CnpOnline
|
29
29
|
class TestDeactivateReversal < Test::Unit::TestCase
|
30
30
|
|
31
31
|
def test_simple
|
@@ -33,7 +33,7 @@ module LitleOnline
|
|
33
33
|
'merchantId' => '101',
|
34
34
|
'version'=>'8.8',
|
35
35
|
'reportGroup'=>'Planets',
|
36
|
-
'
|
36
|
+
'cnpTxnId' => '5000',
|
37
37
|
'card'=>{
|
38
38
|
'type'=>'GC',
|
39
39
|
'number' =>'400000000000001',
|
@@ -48,8 +48,8 @@ module LitleOnline
|
|
48
48
|
'originalSequenceNumber' => '111111',
|
49
49
|
}
|
50
50
|
|
51
|
-
|
52
|
-
|
51
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<cnpTxnId>5000<\/cnpTxnId><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
|
52
|
+
CnpOnlineRequest.new.deposit_reversal(hash)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -22,18 +22,18 @@ 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
|
require 'mocha/setup'
|
28
28
|
|
29
|
-
module
|
29
|
+
module CnpOnline
|
30
30
|
class TestDepositReversal < Test::Unit::TestCase
|
31
31
|
def test_simple
|
32
32
|
hash = {
|
33
33
|
'merchantId' => '101',
|
34
34
|
'version'=>'8.8',
|
35
35
|
'reportGroup'=>'Planets',
|
36
|
-
'
|
36
|
+
'cnpTxnId' => '5000',
|
37
37
|
'card'=>{
|
38
38
|
'type'=>'GC',
|
39
39
|
'number' =>'400000000000001',
|
@@ -48,8 +48,8 @@ module LitleOnline
|
|
48
48
|
'originalSequenceNumber' => '111111',
|
49
49
|
}
|
50
50
|
|
51
|
-
|
52
|
-
|
51
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<cnpTxnId>5000<\/cnpTxnId><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
|
52
|
+
CnpOnlineRequest.new.deposit_reversal(hash)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -22,22 +22,22 @@ 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
|
require 'mocha/setup'
|
28
28
|
|
29
|
-
module
|
29
|
+
module CnpOnline
|
30
30
|
class Test_echeckCredit < Test::Unit::TestCase
|
31
31
|
def test_echeck_credit_with_both
|
32
32
|
hash = {
|
33
33
|
'merchantId' => '101',
|
34
34
|
'version'=>'8.8',
|
35
35
|
'reportGroup'=>'Planets',
|
36
|
-
'
|
37
|
-
'echeckToken' => {'accType'=>'Checking','
|
36
|
+
'cnpTxnId'=>'123456',
|
37
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
38
38
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
39
39
|
}
|
40
|
-
exception = assert_raise(RuntimeError){
|
40
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_credit(hash)}
|
41
41
|
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
42
42
|
end
|
43
43
|
|
@@ -48,11 +48,11 @@ module LitleOnline
|
|
48
48
|
'merchantId' => '101',
|
49
49
|
'version'=>'8.8',
|
50
50
|
'reportGroup'=>'Planets',
|
51
|
-
'
|
51
|
+
'cnpTxnId'=>'123456',
|
52
52
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
53
53
|
}
|
54
|
-
|
55
|
-
|
54
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
|
55
|
+
CnpOnlineRequest.new.echeck_credit(hash)
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_echeck_credit_with_orderId_secondary_amount
|
@@ -63,8 +63,8 @@ module LitleOnline
|
|
63
63
|
'orderSource' => 'ecommerce',
|
64
64
|
'reportGroup' => 'Planets'
|
65
65
|
}
|
66
|
-
|
67
|
-
|
66
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
|
67
|
+
CnpOnlineRequest.new.echeck_credit(hash)
|
68
68
|
end
|
69
69
|
|
70
70
|
def test_echeck_credit_with_txnId_secondaryAmount
|
@@ -72,12 +72,12 @@ module LitleOnline
|
|
72
72
|
'merchantId' => '101',
|
73
73
|
'version'=>'8.8',
|
74
74
|
'reportGroup'=>'Planets',
|
75
|
-
'
|
75
|
+
'cnpTxnId'=>'123456789101112',
|
76
76
|
'amount'=>'12',
|
77
77
|
'secondaryAmount'=>'1'
|
78
78
|
}
|
79
|
-
|
80
|
-
|
79
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<cnpTxnId>123456789101112<\/cnpTxnId>.*?<amount>12<\/amount><secondaryAmount>1<\/secondaryAmount>.*/m), is_a(Hash))
|
80
|
+
CnpOnlineRequest.new.echeck_credit(hash)
|
81
81
|
end
|
82
82
|
|
83
83
|
def test_echeck_credit_with_customIdentifier
|
@@ -91,12 +91,12 @@ module LitleOnline
|
|
91
91
|
'orderId'=>'12345',
|
92
92
|
'orderSource'=>'ecommerce',
|
93
93
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
|
94
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
94
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
95
95
|
'merchantData'=>{'campaign'=>'camping'},
|
96
96
|
'customIdentifier' =>'identifier',
|
97
97
|
}
|
98
|
-
|
99
|
-
|
98
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
|
99
|
+
CnpOnlineRequest.new.echeck_credit(hash)
|
100
100
|
end
|
101
101
|
|
102
102
|
end
|
@@ -22,21 +22,21 @@ 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
|
require 'mocha/setup'
|
28
|
-
module
|
28
|
+
module CnpOnline
|
29
29
|
class Test_echeckRedeposit < Test::Unit::TestCase
|
30
30
|
def test_echeck_redeposit_with_both
|
31
31
|
hash = {
|
32
32
|
'merchantId' => '101',
|
33
33
|
'version'=>'8.8',
|
34
34
|
'reportGroup'=>'Planets',
|
35
|
-
'
|
36
|
-
'echeckToken' => {'accType'=>'Checking','
|
35
|
+
'cnpTxnId'=>'123456',
|
36
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
37
37
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
38
38
|
}
|
39
|
-
exception = assert_raise(RuntimeError){
|
39
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_redeposit(hash)}
|
40
40
|
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
41
41
|
end
|
42
42
|
|
@@ -45,10 +45,10 @@ module LitleOnline
|
|
45
45
|
'merchantId' => '101',
|
46
46
|
'version'=>'8.8',
|
47
47
|
'reportGroup'=>'Planets',
|
48
|
-
'
|
48
|
+
'cnpTxnId'=>'123456',
|
49
49
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','checkNum'=>'123455'}
|
50
50
|
}
|
51
|
-
exception = assert_raise(RuntimeError) {
|
51
|
+
exception = assert_raise(RuntimeError) {CnpOnlineRequest.new.echeck_redeposit(hash)}
|
52
52
|
assert_match /If echeck is specified, it must have a routingNum/, exception.message
|
53
53
|
end
|
54
54
|
|
@@ -57,10 +57,10 @@ module LitleOnline
|
|
57
57
|
'merchantId' => '101',
|
58
58
|
'version'=>'8.8',
|
59
59
|
'reportGroup'=>'Planets',
|
60
|
-
'
|
61
|
-
'echeckToken' => {'accType'=>'Checking','
|
60
|
+
'cnpTxnId'=>'123456',
|
61
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','checkNum'=>'123455'}
|
62
62
|
}
|
63
|
-
exception = assert_raise(RuntimeError) {
|
63
|
+
exception = assert_raise(RuntimeError) {CnpOnlineRequest.new.echeck_redeposit(hash)}
|
64
64
|
assert_match /If echeckToken is specified, it must have a routingNum/, exception.message
|
65
65
|
end
|
66
66
|
|
@@ -71,11 +71,11 @@ module LitleOnline
|
|
71
71
|
'merchantId' => '101',
|
72
72
|
'version'=>'8.8',
|
73
73
|
'reportGroup'=>'Planets',
|
74
|
-
'
|
74
|
+
'cnpTxnId'=>'123456',
|
75
75
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
76
76
|
}
|
77
|
-
|
78
|
-
|
77
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
|
78
|
+
CnpOnlineRequest.new.echeck_redeposit(hash)
|
79
79
|
end
|
80
80
|
|
81
81
|
def test_merchant_data
|
@@ -84,11 +84,11 @@ module LitleOnline
|
|
84
84
|
'merchantId' => '101',
|
85
85
|
'version'=>'8.8',
|
86
86
|
'reportGroup'=>'Planets',
|
87
|
-
'
|
87
|
+
'cnpTxnId'=>'123456',
|
88
88
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
89
89
|
}
|
90
|
-
|
91
|
-
|
90
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<\/echeck>.*<merchantData>.*<campaign>camping<\/campaign>.*<\/merchantData>/m), is_a(Hash))
|
91
|
+
CnpOnlineRequest.new.echeck_redeposit(hash)
|
92
92
|
end
|
93
93
|
|
94
94
|
def test_customIdentifier
|
@@ -98,11 +98,11 @@ module LitleOnline
|
|
98
98
|
'merchantId' => '101',
|
99
99
|
'version'=>'8.8',
|
100
100
|
'reportGroup'=>'Planets',
|
101
|
-
'
|
101
|
+
'cnpTxnId'=>'123456',
|
102
102
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
103
103
|
}
|
104
|
-
|
105
|
-
|
104
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
|
105
|
+
CnpOnlineRequest.new.echeck_redeposit(hash)
|
106
106
|
end
|
107
107
|
|
108
108
|
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
|
require 'mocha/setup'
|
28
|
-
module
|
28
|
+
module CnpOnline
|
29
29
|
class Test_echeckSale < Test::Unit::TestCase
|
30
30
|
|
31
31
|
def test_echeck_sale_with_both
|
@@ -33,11 +33,11 @@ module LitleOnline
|
|
33
33
|
'merchantId' => '101',
|
34
34
|
'version'=>'8.8',
|
35
35
|
'reportGroup'=>'Planets',
|
36
|
-
'
|
37
|
-
'echeckToken' => {'accType'=>'Checking','
|
36
|
+
'cnpTxnId'=>'123456',
|
37
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
38
38
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
39
39
|
}
|
40
|
-
exception = assert_raise(RuntimeError){
|
40
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_sale(hash)}
|
41
41
|
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
42
42
|
end
|
43
43
|
|
@@ -48,11 +48,11 @@ module LitleOnline
|
|
48
48
|
'merchantId' => '101',
|
49
49
|
'version'=>'8.8',
|
50
50
|
'reportGroup'=>'Planets',
|
51
|
-
'
|
51
|
+
'cnpTxnId'=>'123456',
|
52
52
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
53
53
|
}
|
54
|
-
|
55
|
-
|
54
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
|
55
|
+
CnpOnlineRequest.new.echeck_sale(hash)
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_secondary_amount
|
@@ -63,8 +63,8 @@ module LitleOnline
|
|
63
63
|
'orderSource' => 'ecommerce',
|
64
64
|
'reportGroup' => 'Planets'
|
65
65
|
}
|
66
|
-
|
67
|
-
|
66
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
|
67
|
+
CnpOnlineRequest.new.echeck_sale(hash)
|
68
68
|
end
|
69
69
|
|
70
70
|
def test_echeck_sale_with_secondaryAmount_ccd
|
@@ -78,10 +78,10 @@ module LitleOnline
|
|
78
78
|
'orderId'=>'12345',
|
79
79
|
'orderSource'=>'ecommerce',
|
80
80
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
|
81
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
81
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'}
|
82
82
|
}
|
83
|
-
|
84
|
-
|
83
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<amount>123<\/amount><secondaryAmount>1<\/secondaryAmount>.*?<echeck>.*?<ccdPaymentInformation>.*<\/ccdPaymentInformation><\/echeck>.*/m), is_a(Hash))
|
84
|
+
CnpOnlineRequest.new.echeck_sale(hash)
|
85
85
|
end
|
86
86
|
|
87
87
|
def test_echeck_sale_with_customIdentifier
|
@@ -95,12 +95,12 @@ module LitleOnline
|
|
95
95
|
'orderId'=>'12345',
|
96
96
|
'orderSource'=>'ecommerce',
|
97
97
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
|
98
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
98
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'cnp.com'},
|
99
99
|
'merchantData'=>{'campaign'=>'camping'},
|
100
100
|
'customIdentifier' =>'identifier',
|
101
101
|
}
|
102
|
-
|
103
|
-
|
102
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
|
103
|
+
CnpOnlineRequest.new.echeck_sale(hash)
|
104
104
|
end
|
105
105
|
|
106
106
|
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
|
require 'mocha/setup'
|
28
|
-
module
|
28
|
+
module CnpOnline
|
29
29
|
class Test_echeckVerification < Test::Unit::TestCase
|
30
30
|
def test_echeck_verification_with_both
|
31
31
|
hash = {
|
@@ -33,11 +33,11 @@ module LitleOnline
|
|
33
33
|
'version'=>'8.8',
|
34
34
|
'reportGroup'=>'Planets',
|
35
35
|
'id'=>'12345',
|
36
|
-
#'
|
37
|
-
'echeckToken' => {'accType'=>'Checking','
|
36
|
+
#'cnpTxnId'=>'123456',
|
37
|
+
'echeckToken' => {'accType'=>'Checking','cnpToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
38
38
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
39
39
|
}
|
40
|
-
exception = assert_raise(RuntimeError){
|
40
|
+
exception = assert_raise(RuntimeError){CnpOnlineRequest.new.echeck_verification(hash)}
|
41
41
|
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
42
42
|
end
|
43
43
|
|
@@ -49,11 +49,11 @@ module LitleOnline
|
|
49
49
|
'version'=>'8.8',
|
50
50
|
'reportGroup'=>'Planets',
|
51
51
|
'id'=>'12345',
|
52
|
-
#'
|
52
|
+
#'cnpTxnId'=>'123456',
|
53
53
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
54
54
|
}
|
55
|
-
|
56
|
-
|
55
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
|
56
|
+
CnpOnlineRequest.new.echeck_verification(hash)
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_merchant_data
|
@@ -63,11 +63,11 @@ module LitleOnline
|
|
63
63
|
'version'=>'8.8',
|
64
64
|
'reportGroup'=>'Planets',
|
65
65
|
'id'=>'12345',
|
66
|
-
#'
|
66
|
+
#'cnpTxnId'=>'123456',
|
67
67
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
68
68
|
}
|
69
|
-
|
70
|
-
|
69
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<\/echeck>.*<merchantData>.*<campaign>camping<\/campaign>.*<\/merchantData>/m), is_a(Hash))
|
70
|
+
CnpOnlineRequest.new.echeck_verification(hash)
|
71
71
|
end
|
72
72
|
|
73
73
|
end
|
@@ -22,20 +22,20 @@ 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
|
require 'mocha/setup'
|
28
|
-
module
|
28
|
+
module CnpOnline
|
29
29
|
class Test_echeckVoid < Test::Unit::TestCase
|
30
30
|
def test_echeck_void
|
31
31
|
hash = {
|
32
32
|
'merchantId' => '101',
|
33
33
|
'version'=>'8.8',
|
34
34
|
'reportGroup'=>'Planets',
|
35
|
-
'
|
35
|
+
'cnpTxnId'=>'123456',
|
36
36
|
}
|
37
|
-
|
38
|
-
|
37
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*<echeckVoid.*<cnpTxnId>123456<\/cnpTxnId>.*/m), is_a(Hash))
|
38
|
+
CnpOnlineRequest.new.echeck_void(hash)
|
39
39
|
end
|
40
40
|
def test_logged_in_user
|
41
41
|
hash = {
|
@@ -44,10 +44,10 @@ module LitleOnline
|
|
44
44
|
'merchantId' => '101',
|
45
45
|
'version'=>'8.8',
|
46
46
|
'reportGroup'=>'Planets',
|
47
|
-
'
|
47
|
+
'cnpTxnId'=>'123456',
|
48
48
|
}
|
49
|
-
|
50
|
-
|
49
|
+
CnpXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
|
50
|
+
CnpOnlineRequest.new.echeck_void(hash)
|
51
51
|
end
|
52
52
|
|
53
53
|
end
|