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
data/samples/Run_all.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
p system("rake test:all")
|
2
|
-
require File.expand_path("../../samples/Auth/
|
3
|
-
require File.expand_path("../../samples/Auth/
|
4
|
-
require File.expand_path("../../samples/Auth/
|
2
|
+
require File.expand_path("../../samples/Auth/CnpPaymentFullLifeCycle",__FILE__)
|
3
|
+
require File.expand_path("../../samples/Auth/CnpAuthorizationTransaction",__FILE__)
|
4
|
+
require File.expand_path("../../samples/Auth/CnpAuthReversalTransaction",__FILE__)
|
5
5
|
require File.expand_path("../../samples/Batch/AccountUpdate",__FILE__)
|
6
6
|
require File.expand_path("../../samples/Batch/SampleBatchDriver",__FILE__)
|
7
|
-
require File.expand_path("../../samples/Capture/
|
8
|
-
require File.expand_path("../../samples/Capture/
|
9
|
-
require File.expand_path("../../samples/Capture/
|
10
|
-
require File.expand_path("../../samples/Capture/
|
11
|
-
require File.expand_path("../../samples/Credit/
|
12
|
-
require File.expand_path("../../samples/Credit/
|
13
|
-
require File.expand_path("../../samples/Other/
|
14
|
-
require File.expand_path("../../samples/Other/
|
7
|
+
require File.expand_path("../../samples/Capture/CnpCaptureTransaction",__FILE__)
|
8
|
+
require File.expand_path("../../samples/Capture/CnpPartialCapture",__FILE__)
|
9
|
+
require File.expand_path("../../samples/Capture/CnpCaptureGivenAuthTransaction",__FILE__)
|
10
|
+
require File.expand_path("../../samples/Capture/CnpForceCaptureTransaction",__FILE__)
|
11
|
+
require File.expand_path("../../samples/Credit/CnpCreditTransaction",__FILE__)
|
12
|
+
require File.expand_path("../../samples/Credit/CnpRefundTransaction",__FILE__)
|
13
|
+
require File.expand_path("../../samples/Other/CnpAvsTransaction",__FILE__)
|
14
|
+
require File.expand_path("../../samples/Other/CnpVoidTransaction",__FILE__)
|
15
15
|
require File.expand_path("../../samples/Paypage/FullPaypageLifeCycle",__FILE__)
|
16
|
-
require File.expand_path("../../samples/Sale/
|
16
|
+
require File.expand_path("../../samples/Sale/CnpSaleTransaction",__FILE__)
|
17
17
|
require File.expand_path("../../samples/Sale/SampleSaleTransaction",__FILE__)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative '../../lib/
|
1
|
+
require_relative '../../lib/CnpOnline'
|
2
2
|
#Sale
|
3
3
|
my_sale_info = {
|
4
4
|
'orderId' => '1',
|
@@ -18,13 +18,13 @@ my_sale_info = {
|
|
18
18
|
'cardValidationNum' => '349',
|
19
19
|
'type' => 'MC'}
|
20
20
|
}
|
21
|
-
sale_response =
|
21
|
+
sale_response = CnpOnline::CnpOnlineRequest.new.sale(my_sale_info)
|
22
22
|
|
23
23
|
#display results
|
24
24
|
puts "Response: " + sale_response.saleResponse.response
|
25
25
|
puts "Message: " + sale_response.saleResponse.message
|
26
|
-
puts "
|
26
|
+
puts "Cnp Transaction ID: " + sale_response.saleResponse.cnpTxnId
|
27
27
|
|
28
28
|
if (!sale_response.saleResponse.message.eql?'Transaction Received')
|
29
|
-
raise ArgumentError, "
|
29
|
+
raise ArgumentError, "CnpSaleTransaction has not been Approved", caller
|
30
30
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require_relative '../../lib/
|
1
|
+
require_relative '../../lib/CnpOnline'
|
2
2
|
# Visa $10 Sale
|
3
|
-
|
3
|
+
cnpSaleTxn = {
|
4
4
|
'merchantId' => '087900',
|
5
5
|
'id' => 'test',
|
6
6
|
'reportGroup'=>'rpt_grp',
|
@@ -13,12 +13,12 @@ litleSaleTxn = {
|
|
13
13
|
'amount'=>'1000'
|
14
14
|
}
|
15
15
|
|
16
|
-
# Peform the transaction on the
|
17
|
-
response =
|
16
|
+
# Peform the transaction on the Cnp Platform
|
17
|
+
response = CnpOnline::CnpOnlineRequest.new.sale(cnpSaleTxn)
|
18
18
|
|
19
19
|
# display results
|
20
20
|
puts "Message: "+ response.message
|
21
|
-
puts "
|
21
|
+
puts "Cnp Transaction ID: "+ response.saleResponse.cnpTxnId
|
22
22
|
|
23
23
|
if (!response.saleResponse.message.eql?'Transaction Received')
|
24
24
|
raise ArgumentError, "SampleSaleTransaction has not been Approved", caller
|
@@ -1,12 +1,13 @@
|
|
1
|
-
require File.expand_path("../../../lib/
|
2
|
-
#require '
|
1
|
+
require File.expand_path("../../../lib/CnpOnline",__FILE__)
|
2
|
+
#require 'Cnp_activemerchant'
|
3
3
|
require 'test/unit'
|
4
4
|
|
5
|
-
module
|
6
|
-
class
|
5
|
+
module CnpOnline
|
6
|
+
class Cnp_certTest < Test::Unit::TestCase
|
7
7
|
@@merchant_hash = {'reportGroup'=>'Planets',
|
8
|
-
'merchantId'=>'
|
9
|
-
'id'=>'test'
|
8
|
+
'merchantId'=>'1288791',
|
9
|
+
'id'=>'test',
|
10
|
+
'url'=> 'https://payments.vantivprelive.com/vap/communicator/online'
|
10
11
|
}
|
11
12
|
|
12
13
|
def test_1_auth
|
@@ -28,7 +29,7 @@ module LitleOnline
|
|
28
29
|
'type' => 'VI'}
|
29
30
|
}
|
30
31
|
hash = customer_hash.merge(@@merchant_hash)
|
31
|
-
auth_response =
|
32
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
32
33
|
assert_equal('000', auth_response.authorizationResponse.response)
|
33
34
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
34
35
|
assert_equal('11111 ', auth_response.authorizationResponse.authCode)
|
@@ -36,23 +37,23 @@ module LitleOnline
|
|
36
37
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
37
38
|
|
38
39
|
#test 1A
|
39
|
-
capture_hash = {'
|
40
|
+
capture_hash = {'cnpTxnId' => auth_response.authorizationResponse.cnpTxnId}
|
40
41
|
hash1a = capture_hash.merge(@@merchant_hash)
|
41
|
-
capture_response =
|
42
|
+
capture_response = CnpOnlineRequest.new.capture(hash1a)
|
42
43
|
assert_equal('000', capture_response.captureResponse.response)
|
43
44
|
|
44
45
|
|
45
46
|
#test 1B
|
46
|
-
credit_hash = {'
|
47
|
+
credit_hash = {'cnpTxnId' => capture_response.captureResponse.cnpTxnId}
|
47
48
|
hash1b = credit_hash.merge(@@merchant_hash)
|
48
|
-
credit_response =
|
49
|
+
credit_response = CnpOnlineRequest.new.credit(hash1b)
|
49
50
|
assert_equal('000', credit_response.creditResponse.response)
|
50
51
|
|
51
52
|
|
52
53
|
#test1C
|
53
|
-
void_hash = {'
|
54
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
54
55
|
hash1c = void_hash.merge(@@merchant_hash)
|
55
|
-
void_response =
|
56
|
+
void_response = CnpOnlineRequest.new.void(hash1c)
|
56
57
|
assert_equal('000', void_response.voidResponse.response)
|
57
58
|
|
58
59
|
end
|
@@ -76,7 +77,7 @@ module LitleOnline
|
|
76
77
|
'type' => 'VI'}
|
77
78
|
}
|
78
79
|
hash = customer_hash.merge(@@merchant_hash)
|
79
|
-
auth_response =
|
80
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
80
81
|
assert_equal('000', auth_response.authorizationResponse.response)
|
81
82
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
82
83
|
assert_equal('11111 ', auth_response.authorizationResponse.authCode)
|
@@ -103,7 +104,7 @@ module LitleOnline
|
|
103
104
|
'type' => 'VI'}
|
104
105
|
}
|
105
106
|
hash = customer_hash.merge(@@merchant_hash)
|
106
|
-
sale_response =
|
107
|
+
sale_response = CnpOnlineRequest.new.sale(hash)
|
107
108
|
assert_equal('000', sale_response.saleResponse.response)
|
108
109
|
assert_equal('Approved', sale_response.saleResponse.message)
|
109
110
|
assert_equal('11111 ', sale_response.saleResponse.authCode)
|
@@ -111,16 +112,16 @@ module LitleOnline
|
|
111
112
|
assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
|
112
113
|
|
113
114
|
#test 1B
|
114
|
-
credit_hash = {'
|
115
|
+
credit_hash = {'cnpTxnId' => sale_response.saleResponse.cnpTxnId}
|
115
116
|
hash1b = credit_hash.merge(@@merchant_hash)
|
116
|
-
credit_response =
|
117
|
+
credit_response = CnpOnlineRequest.new.credit(hash1b)
|
117
118
|
assert_equal('000', credit_response.creditResponse.response)
|
118
119
|
|
119
120
|
|
120
121
|
#test1C
|
121
|
-
void_hash = {'
|
122
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
122
123
|
hash1c = void_hash.merge(@@merchant_hash)
|
123
|
-
void_response =
|
124
|
+
void_response = CnpOnlineRequest.new.void(hash1c)
|
124
125
|
assert_equal('000', void_response.voidResponse.response)
|
125
126
|
|
126
127
|
end
|
@@ -147,31 +148,31 @@ module LitleOnline
|
|
147
148
|
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
148
149
|
}
|
149
150
|
hash = customer_hash.merge(@@merchant_hash)
|
150
|
-
auth_response =
|
151
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
151
152
|
assert_equal('000', auth_response.authorizationResponse.response)
|
152
153
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
153
|
-
assert_equal('22222', auth_response.authorizationResponse.authCode)
|
154
|
+
assert_equal('22222 ', auth_response.authorizationResponse.authCode)
|
154
155
|
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
155
156
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
156
157
|
|
157
158
|
#test 2A
|
158
|
-
capture_hash = {'
|
159
|
+
capture_hash = {'cnpTxnId' => auth_response.authorizationResponse.cnpTxnId}
|
159
160
|
hash2a = capture_hash.merge(@@merchant_hash)
|
160
|
-
capture_response =
|
161
|
+
capture_response = CnpOnlineRequest.new.capture(hash2a)
|
161
162
|
assert_equal('000', capture_response.captureResponse.response)
|
162
163
|
|
163
164
|
|
164
165
|
#test 2B
|
165
|
-
credit_hash = {'
|
166
|
+
credit_hash = {'cnpTxnId' => capture_response.captureResponse.cnpTxnId}
|
166
167
|
hash2b = credit_hash.merge(@@merchant_hash)
|
167
|
-
credit_response =
|
168
|
+
credit_response = CnpOnlineRequest.new.credit(hash2b)
|
168
169
|
assert_equal('000', credit_response.creditResponse.response)
|
169
170
|
|
170
171
|
|
171
172
|
#test 2C
|
172
|
-
void_hash = {'
|
173
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
173
174
|
hash2c = void_hash.merge(@@merchant_hash)
|
174
|
-
void_response =
|
175
|
+
void_response = CnpOnlineRequest.new.void(hash2c)
|
175
176
|
assert_equal('000', void_response.voidResponse.response)
|
176
177
|
|
177
178
|
end
|
@@ -198,10 +199,10 @@ module LitleOnline
|
|
198
199
|
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
199
200
|
}
|
200
201
|
hash = customer_hash.merge(@@merchant_hash)
|
201
|
-
auth_response =
|
202
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
202
203
|
assert_equal('000', auth_response.authorizationResponse.response)
|
203
204
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
204
|
-
assert_equal('22222', auth_response.authorizationResponse.authCode)
|
205
|
+
assert_equal('22222 ', auth_response.authorizationResponse.authCode)
|
205
206
|
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
206
207
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
207
208
|
end
|
@@ -228,24 +229,24 @@ module LitleOnline
|
|
228
229
|
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
229
230
|
}
|
230
231
|
hash = customer_hash.merge(@@merchant_hash)
|
231
|
-
sale_response =
|
232
|
+
sale_response = CnpOnlineRequest.new.sale(hash)
|
232
233
|
assert_equal('000', sale_response.saleResponse.response)
|
233
234
|
assert_equal('Approved', sale_response.saleResponse.message)
|
234
|
-
assert_equal('22222', sale_response.saleResponse.authCode)
|
235
|
+
assert_equal('22222 ', sale_response.saleResponse.authCode)
|
235
236
|
assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
|
236
237
|
assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
|
237
238
|
|
238
239
|
#test 2B
|
239
|
-
credit_hash = {'
|
240
|
+
credit_hash = {'cnpTxnId' => sale_response.saleResponse.cnpTxnId}
|
240
241
|
hash2b = credit_hash.merge(@@merchant_hash)
|
241
|
-
credit_response =
|
242
|
+
credit_response = CnpOnlineRequest.new.credit(hash2b)
|
242
243
|
assert_equal('000', credit_response.creditResponse.response)
|
243
244
|
|
244
245
|
|
245
246
|
#test 2C
|
246
|
-
void_hash = {'
|
247
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
247
248
|
hash2c = void_hash.merge(@@merchant_hash)
|
248
|
-
void_response =
|
249
|
+
void_response = CnpOnlineRequest.new.void(hash2c)
|
249
250
|
assert_equal('000', void_response.voidResponse.response)
|
250
251
|
|
251
252
|
end
|
@@ -269,31 +270,31 @@ module LitleOnline
|
|
269
270
|
'cardValidationNum' => '758'},
|
270
271
|
}
|
271
272
|
hash = customer_hash.merge(@@merchant_hash)
|
272
|
-
auth_response =
|
273
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
273
274
|
assert_equal('000', auth_response.authorizationResponse.response)
|
274
275
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
275
|
-
assert_equal('33333', auth_response.authorizationResponse.authCode)
|
276
|
+
assert_equal('33333 ', auth_response.authorizationResponse.authCode)
|
276
277
|
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
277
278
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
278
279
|
|
279
280
|
#test 3A
|
280
|
-
capture_hash = {'
|
281
|
+
capture_hash = {'cnpTxnId' => auth_response.authorizationResponse.cnpTxnId}
|
281
282
|
hash2a = capture_hash.merge(@@merchant_hash)
|
282
|
-
capture_response =
|
283
|
+
capture_response = CnpOnlineRequest.new.capture(hash2a)
|
283
284
|
assert_equal('000', capture_response.captureResponse.response)
|
284
285
|
|
285
286
|
|
286
287
|
#test 3B
|
287
|
-
credit_hash = {'
|
288
|
+
credit_hash = {'cnpTxnId' => capture_response.captureResponse.cnpTxnId}
|
288
289
|
hash2b = credit_hash.merge(@@merchant_hash)
|
289
|
-
credit_response =
|
290
|
+
credit_response = CnpOnlineRequest.new.credit(hash2b)
|
290
291
|
assert_equal('000', credit_response.creditResponse.response)
|
291
292
|
|
292
293
|
|
293
294
|
#test 3C
|
294
|
-
void_hash = {'
|
295
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
295
296
|
hash2c = void_hash.merge(@@merchant_hash)
|
296
|
-
void_response =
|
297
|
+
void_response = CnpOnlineRequest.new.void(hash2c)
|
297
298
|
assert_equal('000', void_response.voidResponse.response)
|
298
299
|
|
299
300
|
end
|
@@ -317,10 +318,10 @@ module LitleOnline
|
|
317
318
|
'cardValidationNum' => '758'},
|
318
319
|
}
|
319
320
|
hash = customer_hash.merge(@@merchant_hash)
|
320
|
-
auth_response =
|
321
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
321
322
|
assert_equal('000', auth_response.authorizationResponse.response)
|
322
323
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
323
|
-
assert_equal('33333', auth_response.authorizationResponse.authCode)
|
324
|
+
assert_equal('33333 ', auth_response.authorizationResponse.authCode)
|
324
325
|
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
325
326
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
326
327
|
end
|
@@ -344,24 +345,24 @@ module LitleOnline
|
|
344
345
|
'cardValidationNum' => '758'},
|
345
346
|
}
|
346
347
|
hash = customer_hash.merge(@@merchant_hash)
|
347
|
-
sale_response =
|
348
|
+
sale_response = CnpOnlineRequest.new.sale(hash)
|
348
349
|
assert_equal('000', sale_response.saleResponse.response)
|
349
350
|
assert_equal('Approved', sale_response.saleResponse.message)
|
350
|
-
assert_equal('33333', sale_response.saleResponse.authCode)
|
351
|
+
assert_equal('33333 ', sale_response.saleResponse.authCode)
|
351
352
|
assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
|
352
353
|
assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
|
353
354
|
|
354
355
|
#test 3B
|
355
|
-
credit_hash = {'
|
356
|
+
credit_hash = {'cnpTxnId' => sale_response.saleResponse.cnpTxnId}
|
356
357
|
hash2b = credit_hash.merge(@@merchant_hash)
|
357
|
-
credit_response =
|
358
|
+
credit_response = CnpOnlineRequest.new.credit(hash2b)
|
358
359
|
assert_equal('000', credit_response.creditResponse.response)
|
359
360
|
|
360
361
|
|
361
362
|
#test 3C
|
362
|
-
void_hash = {'
|
363
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
363
364
|
hash2c = void_hash.merge(@@merchant_hash)
|
364
|
-
void_response =
|
365
|
+
void_response = CnpOnlineRequest.new.void(hash2c)
|
365
366
|
assert_equal('000', void_response.voidResponse.response)
|
366
367
|
|
367
368
|
end
|
@@ -385,29 +386,29 @@ module LitleOnline
|
|
385
386
|
},
|
386
387
|
}
|
387
388
|
hash = customer_hash.merge(@@merchant_hash)
|
388
|
-
auth_response =
|
389
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
389
390
|
assert_equal('000', auth_response.authorizationResponse.response)
|
390
391
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
391
|
-
assert_equal('44444', auth_response.authorizationResponse.authCode)
|
392
|
-
assert_equal('
|
392
|
+
assert_equal('44444 ', auth_response.authorizationResponse.authCode)
|
393
|
+
assert_equal('13', auth_response.authorizationResponse.fraudResult.avsResult)
|
393
394
|
|
394
395
|
#test 4A
|
395
|
-
capture_hash = {'
|
396
|
+
capture_hash = {'cnpTxnId' => auth_response.authorizationResponse.cnpTxnId}
|
396
397
|
hash2a = capture_hash.merge(@@merchant_hash)
|
397
|
-
capture_response =
|
398
|
+
capture_response = CnpOnlineRequest.new.capture(hash2a)
|
398
399
|
assert_equal('Approved', capture_response.captureResponse.message)
|
399
400
|
|
400
401
|
#test 4B
|
401
|
-
credit_hash = {'
|
402
|
+
credit_hash = {'cnpTxnId' => capture_response.captureResponse.cnpTxnId}
|
402
403
|
hash2b = credit_hash.merge(@@merchant_hash)
|
403
|
-
credit_response =
|
404
|
+
credit_response = CnpOnlineRequest.new.credit(hash2b)
|
404
405
|
assert_equal('000', credit_response.creditResponse.response)
|
405
406
|
|
406
407
|
|
407
408
|
#test 4C
|
408
|
-
void_hash = {'
|
409
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
409
410
|
hash2c = void_hash.merge(@@merchant_hash)
|
410
|
-
void_response =
|
411
|
+
void_response = CnpOnlineRequest.new.void(hash2c)
|
411
412
|
assert_equal('000', void_response.voidResponse.response)
|
412
413
|
|
413
414
|
end
|
@@ -431,11 +432,11 @@ module LitleOnline
|
|
431
432
|
},
|
432
433
|
}
|
433
434
|
hash = customer_hash.merge(@@merchant_hash)
|
434
|
-
auth_response =
|
435
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
435
436
|
assert_equal('000', auth_response.authorizationResponse.response)
|
436
437
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
437
|
-
assert_equal('44444', auth_response.authorizationResponse.authCode)
|
438
|
-
assert_equal('
|
438
|
+
assert_equal('44444 ', auth_response.authorizationResponse.authCode)
|
439
|
+
assert_equal('13', auth_response.authorizationResponse.fraudResult.avsResult)
|
439
440
|
end
|
440
441
|
|
441
442
|
def test_4_sale
|
@@ -457,23 +458,23 @@ module LitleOnline
|
|
457
458
|
},
|
458
459
|
}
|
459
460
|
hash = customer_hash.merge(@@merchant_hash)
|
460
|
-
sale_response =
|
461
|
+
sale_response = CnpOnlineRequest.new.sale(hash)
|
461
462
|
assert_equal('000', sale_response.saleResponse.response)
|
462
463
|
assert_equal('Approved', sale_response.saleResponse.message)
|
463
|
-
assert_equal('44444', sale_response.saleResponse.authCode)
|
464
|
-
assert_equal('
|
464
|
+
assert_equal('44444 ', sale_response.saleResponse.authCode)
|
465
|
+
assert_equal('13', sale_response.saleResponse.fraudResult.avsResult)
|
465
466
|
|
466
467
|
#test 4B
|
467
|
-
credit_hash = {'
|
468
|
+
credit_hash = {'cnpTxnId' => sale_response.saleResponse.cnpTxnId}
|
468
469
|
hash2b = credit_hash.merge(@@merchant_hash)
|
469
|
-
credit_response =
|
470
|
+
credit_response = CnpOnlineRequest.new.credit(hash2b)
|
470
471
|
assert_equal('000', credit_response.creditResponse.response)
|
471
472
|
|
472
473
|
|
473
474
|
#test 4C
|
474
|
-
void_hash = {'
|
475
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
475
476
|
hash2c = void_hash.merge(@@merchant_hash)
|
476
|
-
void_response =
|
477
|
+
void_response = CnpOnlineRequest.new.void(hash2c)
|
477
478
|
assert_equal('000', void_response.voidResponse.response)
|
478
479
|
|
479
480
|
end
|
@@ -491,31 +492,31 @@ module LitleOnline
|
|
491
492
|
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
492
493
|
}
|
493
494
|
hash = customer_hash.merge(@@merchant_hash)
|
494
|
-
auth_response =
|
495
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
495
496
|
assert_equal('000', auth_response.authorizationResponse.response)
|
496
497
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
497
498
|
assert_equal('55555 ', auth_response.authorizationResponse.authCode)
|
498
499
|
assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
|
499
|
-
assert_equal('
|
500
|
+
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
500
501
|
|
501
502
|
#test 5A
|
502
|
-
capture_hash = {'
|
503
|
+
capture_hash = {'cnpTxnId' => auth_response.authorizationResponse.cnpTxnId}
|
503
504
|
hash2a = capture_hash.merge(@@merchant_hash)
|
504
|
-
capture_response =
|
505
|
+
capture_response = CnpOnlineRequest.new.capture(hash2a)
|
505
506
|
assert_equal('000', capture_response.captureResponse.response)
|
506
507
|
|
507
508
|
|
508
509
|
#test 5B
|
509
|
-
credit_hash = {'
|
510
|
+
credit_hash = {'cnpTxnId' => capture_response.captureResponse.cnpTxnId}
|
510
511
|
hash2b = credit_hash.merge(@@merchant_hash)
|
511
|
-
credit_response =
|
512
|
+
credit_response = CnpOnlineRequest.new.credit(hash2b)
|
512
513
|
assert_equal('000', credit_response.creditResponse.response)
|
513
514
|
|
514
515
|
|
515
516
|
#test 5C
|
516
|
-
void_hash = {'
|
517
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
517
518
|
hash2c = void_hash.merge(@@merchant_hash)
|
518
|
-
void_response =
|
519
|
+
void_response = CnpOnlineRequest.new.void(hash2c)
|
519
520
|
assert_equal('000', void_response.voidResponse.response)
|
520
521
|
|
521
522
|
end
|
@@ -533,12 +534,12 @@ module LitleOnline
|
|
533
534
|
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
534
535
|
}
|
535
536
|
hash = customer_hash.merge(@@merchant_hash)
|
536
|
-
auth_response =
|
537
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
537
538
|
assert_equal('000', auth_response.authorizationResponse.response)
|
538
539
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
539
540
|
assert_equal('55555 ', auth_response.authorizationResponse.authCode)
|
540
541
|
assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
|
541
|
-
assert_equal('
|
542
|
+
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
542
543
|
end
|
543
544
|
|
544
545
|
def test_5_sale
|
@@ -554,24 +555,24 @@ module LitleOnline
|
|
554
555
|
'cardholderAuthentication' => {'authenticationValue'=> 'BwABBJQ1AgAAAAAgJDUCAAAAAAA=' }
|
555
556
|
}
|
556
557
|
hash = customer_hash.merge(@@merchant_hash)
|
557
|
-
sale_response =
|
558
|
+
sale_response = CnpOnlineRequest.new.sale(hash)
|
558
559
|
assert_equal('000', sale_response.saleResponse.response)
|
559
560
|
assert_equal('Approved', sale_response.saleResponse.message)
|
560
561
|
assert_equal('55555 ', sale_response.saleResponse.authCode)
|
561
562
|
assert_equal('32', sale_response.saleResponse.fraudResult.avsResult)
|
562
|
-
assert_equal('
|
563
|
+
assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
|
563
564
|
|
564
565
|
#test 5B
|
565
|
-
credit_hash = {'
|
566
|
+
credit_hash = {'cnpTxnId' => sale_response.saleResponse.cnpTxnId}
|
566
567
|
hash2b = credit_hash.merge(@@merchant_hash)
|
567
|
-
credit_response =
|
568
|
+
credit_response = CnpOnlineRequest.new.credit(hash2b)
|
568
569
|
assert_equal('000', credit_response.creditResponse.response)
|
569
570
|
|
570
571
|
|
571
572
|
#test 5C
|
572
|
-
void_hash = {'
|
573
|
+
void_hash = {'cnpTxnId' => credit_response.creditResponse.cnpTxnId}
|
573
574
|
hash2c = void_hash.merge(@@merchant_hash)
|
574
|
-
void_response =
|
575
|
+
void_response = CnpOnlineRequest.new.void(hash2c)
|
575
576
|
assert_equal('000', void_response.voidResponse.response)
|
576
577
|
|
577
578
|
end
|
@@ -595,7 +596,7 @@ module LitleOnline
|
|
595
596
|
'cardValidationNum' => '992'}
|
596
597
|
}
|
597
598
|
hash = customer_hash.merge(@@merchant_hash)
|
598
|
-
auth_response =
|
599
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
599
600
|
assert_equal('110', auth_response.authorizationResponse.response)
|
600
601
|
assert_equal('Insufficient Funds', auth_response.authorizationResponse.message)
|
601
602
|
assert_equal('34', auth_response.authorizationResponse.fraudResult.avsResult)
|
@@ -621,16 +622,16 @@ module LitleOnline
|
|
621
622
|
'cardValidationNum' => '992'}
|
622
623
|
}
|
623
624
|
hash = customer_hash.merge(@@merchant_hash)
|
624
|
-
sale_response =
|
625
|
+
sale_response = CnpOnlineRequest.new.sale(hash)
|
625
626
|
assert_equal('110', sale_response.saleResponse.response)
|
626
627
|
assert_equal('Insufficient Funds', sale_response.saleResponse.message)
|
627
628
|
assert_equal('34', sale_response.saleResponse.fraudResult.avsResult)
|
628
629
|
assert_equal('P', sale_response.saleResponse.fraudResult.cardValidationResult)
|
629
630
|
|
630
631
|
#test 6A
|
631
|
-
void_hash = {'
|
632
|
+
void_hash = {'cnpTxnId' => '123456789000' }
|
632
633
|
hash6A = void_hash.merge(@@merchant_hash)
|
633
|
-
void_response =
|
634
|
+
void_response = CnpOnlineRequest.new.void(hash6A)
|
634
635
|
assert_equal('000', void_response.voidResponse.response)
|
635
636
|
|
636
637
|
end
|
@@ -654,7 +655,7 @@ module LitleOnline
|
|
654
655
|
'type' => 'MC'}
|
655
656
|
}
|
656
657
|
hash = customer_hash.merge(@@merchant_hash)
|
657
|
-
authorization_response =
|
658
|
+
authorization_response = CnpOnlineRequest.new.authorization(hash)
|
658
659
|
assert_equal('301', authorization_response.authorizationResponse.response)
|
659
660
|
assert_equal('Invalid Account Number', authorization_response.authorizationResponse.message)
|
660
661
|
assert_equal('34', authorization_response.authorizationResponse.fraudResult.avsResult)
|
@@ -680,7 +681,7 @@ module LitleOnline
|
|
680
681
|
'type' => 'MC'}
|
681
682
|
}
|
682
683
|
hash = customer_hash.merge(@@merchant_hash)
|
683
|
-
authorization_response =
|
684
|
+
authorization_response = CnpOnlineRequest.new.authorization(hash)
|
684
685
|
assert_equal('301', authorization_response.authorizationResponse.response)
|
685
686
|
assert_equal('Invalid Account Number', authorization_response.authorizationResponse.message)
|
686
687
|
assert_equal('34', authorization_response.authorizationResponse.fraudResult.avsResult)
|
@@ -706,7 +707,7 @@ module LitleOnline
|
|
706
707
|
'type' => 'MC'}
|
707
708
|
}
|
708
709
|
hash = customer_hash.merge(@@merchant_hash)
|
709
|
-
sale_response =
|
710
|
+
sale_response = CnpOnlineRequest.new.sale(hash)
|
710
711
|
assert_equal('301', sale_response.saleResponse.response)
|
711
712
|
assert_equal('Invalid Account Number', sale_response.saleResponse.message)
|
712
713
|
assert_equal('34', sale_response.saleResponse.fraudResult.avsResult)
|
@@ -732,7 +733,7 @@ module LitleOnline
|
|
732
733
|
'cardValidationNum' => '184'}
|
733
734
|
}
|
734
735
|
hash = customer_hash.merge(@@merchant_hash)
|
735
|
-
auth_response =
|
736
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
736
737
|
assert_equal('123', auth_response.authorizationResponse.response)
|
737
738
|
assert_equal('Call Discover', auth_response.authorizationResponse.message)
|
738
739
|
assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
@@ -758,7 +759,7 @@ module LitleOnline
|
|
758
759
|
'cardValidationNum' => '184'}
|
759
760
|
}
|
760
761
|
hash = customer_hash.merge(@@merchant_hash)
|
761
|
-
auth_response =
|
762
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
762
763
|
assert_equal('123', auth_response.authorizationResponse.response)
|
763
764
|
assert_equal('Call Discover', auth_response.authorizationResponse.message)
|
764
765
|
assert_equal('P', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
@@ -784,7 +785,7 @@ module LitleOnline
|
|
784
785
|
'cardValidationNum' => '184'}
|
785
786
|
}
|
786
787
|
hash = customer_hash.merge(@@merchant_hash)
|
787
|
-
sale_response =
|
788
|
+
sale_response = CnpOnlineRequest.new.sale(hash)
|
788
789
|
assert_equal('123', sale_response.saleResponse.response)
|
789
790
|
assert_equal('Call Discover', sale_response.saleResponse.message)
|
790
791
|
assert_equal('P', sale_response.saleResponse.fraudResult.cardValidationResult)
|
@@ -811,7 +812,7 @@ module LitleOnline
|
|
811
812
|
}
|
812
813
|
}
|
813
814
|
hash = customer_hash.merge(@@merchant_hash)
|
814
|
-
response =
|
815
|
+
response = CnpOnlineRequest.new.authorization(hash)
|
815
816
|
assert_equal('303', response.authorizationResponse.response)
|
816
817
|
assert_equal('Pick Up Card', response.authorizationResponse.message)
|
817
818
|
assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
|
@@ -837,7 +838,7 @@ module LitleOnline
|
|
837
838
|
}
|
838
839
|
}
|
839
840
|
hash = customer_hash.merge(@@merchant_hash)
|
840
|
-
response =
|
841
|
+
response = CnpOnlineRequest.new.authorization(hash)
|
841
842
|
assert_equal('303', response.authorizationResponse.response)
|
842
843
|
assert_equal('Pick Up Card', response.authorizationResponse.message)
|
843
844
|
assert_equal('34', response.authorizationResponse.fraudResult.avsResult)
|
@@ -863,7 +864,7 @@ module LitleOnline
|
|
863
864
|
}
|
864
865
|
}
|
865
866
|
hash = customer_hash.merge(@@merchant_hash)
|
866
|
-
response =
|
867
|
+
response = CnpOnlineRequest.new.sale(hash)
|
867
868
|
assert_equal('303', response.saleResponse.response)
|
868
869
|
assert_equal('Pick Up Card', response.saleResponse.message)
|
869
870
|
assert_equal('34', response.saleResponse.fraudResult.avsResult)
|
@@ -882,7 +883,7 @@ module LitleOnline
|
|
882
883
|
'allowPartialAuth' => 'true'
|
883
884
|
}
|
884
885
|
hash = customer_hash.merge(@@merchant_hash)
|
885
|
-
auth_response =
|
886
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
886
887
|
assert_equal('010', auth_response.authorizationResponse.response)
|
887
888
|
assert_equal('Partially Approved', auth_response.authorizationResponse.message)
|
888
889
|
assert_equal('32000', auth_response.authorizationResponse.approvedAmount)
|
@@ -901,7 +902,7 @@ module LitleOnline
|
|
901
902
|
'allowPartialAuth' => 'true'
|
902
903
|
}
|
903
904
|
hash = customer_hash.merge(@@merchant_hash)
|
904
|
-
auth_response =
|
905
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
905
906
|
assert_equal('010', auth_response.authorizationResponse.response)
|
906
907
|
assert_equal('Partially Approved', auth_response.authorizationResponse.message)
|
907
908
|
assert_equal('48000', auth_response.authorizationResponse.approvedAmount)
|
@@ -919,7 +920,7 @@ module LitleOnline
|
|
919
920
|
'allowPartialAuth' => 'true'
|
920
921
|
}
|
921
922
|
hash = customer_hash.merge(@@merchant_hash)
|
922
|
-
auth_response =
|
923
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
923
924
|
assert_equal('010', auth_response.authorizationResponse.response)
|
924
925
|
assert_equal('Partially Approved', auth_response.authorizationResponse.message)
|
925
926
|
assert_equal('40000', auth_response.authorizationResponse.approvedAmount)
|
@@ -937,7 +938,7 @@ module LitleOnline
|
|
937
938
|
'allowPartialAuth' => 'true'
|
938
939
|
}
|
939
940
|
hash = customer_hash.merge(@@merchant_hash)
|
940
|
-
auth_response =
|
941
|
+
auth_response = CnpOnlineRequest.new.authorization(hash)
|
941
942
|
assert_equal('010', auth_response.authorizationResponse.response)
|
942
943
|
assert_equal('Partially Approved', auth_response.authorizationResponse.message)
|
943
944
|
assert_equal('12000', auth_response.authorizationResponse.approvedAmount)
|