CnpOnline 9.14.0 → 11.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/CHANGELOG +23 -17
- data/CONTRIBUTORS +0 -0
- data/DESCRIPTION +1 -1
- data/LICENSE +1 -1
- data/README.md +5 -3
- data/Rakefile +5 -5
- data/Rakefile~ +5 -5
- data/SETUP.md +3 -3
- data/bin/Setup.rb +59 -41
- data/lib/Communications.rb +3 -3
- data/lib/Configuration.rb +52 -45
- data/lib/EnvironmentVariables.rb +5 -1
- data/lib/LitleBatchRequest.rb +72 -7
- data/lib/LitleListeners.rb +17 -1
- data/lib/LitleOnline.rb +3 -4
- data/lib/LitleOnlineRequest.rb +37 -7
- data/lib/LitleRequest.rb +315 -186
- data/lib/LitleTransaction.rb +212 -85
- data/lib/LitleXmlMapper.rb +4 -2
- data/lib/XMLFields.rb +384 -171
- data/lib/cacert.pem +0 -0
- data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
- data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
- data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
- data/samples/Batch/AccountUpdate.rb +1 -0
- data/samples/Batch/SampleBatchDriver.rb +2 -1
- data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
- data/samples/Capture/LitleCaptureTransaction.rb +2 -2
- data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
- data/samples/Capture/LitlePartialCapture.rb +3 -3
- data/samples/Credit/LitleCreditTransaction.rb +2 -2
- data/samples/Credit/LitleRefundTransaction.rb +2 -1
- data/samples/Other/LitleAvsTransaction.rb +2 -1
- data/samples/Other/LitleVoidTransaction.rb +2 -1
- data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
- data/samples/Run_all.rb +0 -0
- data/samples/Sale/LitleSaleTransaction.rb +2 -1
- data/samples/Sale/SampleSaleTransaction.rb +2 -1
- data/test/certification/certTest1_base.rb +52 -53
- data/test/certification/certTest2_authenhanced.rb +24 -25
- data/test/certification/certTest3_authreversal.rb +23 -26
- data/test/certification/certTest4_echeck.rb +18 -32
- data/test/certification/certTest5_token.rb +105 -106
- data/test/certification/certTest_batchAll.rb +47 -15
- data/test/functional/test_activate.rb +32 -4
- data/test/functional/test_activateReversal.rb +18 -5
- data/test/functional/test_auth.rb +94 -48
- data/test/functional/test_authReversal.rb +4 -1
- data/test/functional/test_balanceInquiry.rb +28 -3
- data/test/functional/test_batchStream.rb +2 -4
- data/test/functional/test_cancelSubscription.rb +2 -2
- data/test/functional/test_capture.rb +21 -14
- data/test/functional/test_captureGivenAuth.rb +15 -6
- data/test/functional/test_createPlan.rb +1 -1
- data/test/functional/test_credit.rb +14 -5
- data/test/functional/test_deactivate.rb +26 -3
- data/test/functional/test_deactivateReversal.rb +18 -5
- data/test/functional/test_depositReversal.rb +31 -19
- data/test/functional/test_echeckCredit.rb +34 -6
- data/test/functional/test_echeckRedeposit.rb +29 -2
- data/test/functional/test_echeckSale.rb +68 -11
- data/test/functional/test_echeckVerification.rb +32 -7
- data/test/functional/test_echeckVoid.rb +2 -1
- data/test/functional/test_forceCapture.rb +20 -6
- data/test/functional/test_fraudCheck.rb +3 -5
- data/test/functional/test_giftCardAuthReversal.rb +72 -0
- data/test/functional/test_giftCardCapture.rb +72 -0
- data/test/functional/test_giftCardCredit.rb +69 -0
- data/test/functional/test_litle_requests.rb +3 -6
- data/test/functional/test_load.rb +27 -3
- data/test/functional/test_loadReversal.rb +18 -5
- data/test/functional/test_override.rb +7 -3
- data/test/functional/test_pgp_litle_requests.rb +294 -0
- data/test/functional/test_queryTransaction.rb +152 -0
- data/test/functional/test_refundReversal.rb +18 -5
- data/test/functional/test_sale.rb +122 -159
- data/test/functional/test_token.rb +17 -11
- data/test/functional/test_unload.rb +27 -3
- data/test/functional/test_unloadReversal.rb +18 -5
- data/test/functional/test_updateCardValidationNumOnToken.rb +1 -0
- data/test/functional/test_updatePlan.rb +2 -1
- data/test/functional/test_updateSubscription.rb +3 -1
- data/test/functional/test_wallet.rb +74 -0
- data/test/functional/test_xmlfields.rb +22 -3
- data/test/functional/ts_all.rb +2 -0
- data/test/unit/test_LitleBatchRequest.rb +53 -5
- data/test/unit/test_LitleOnlineRequest.rb +5 -30
- data/test/unit/test_LitleRequest.rb +7 -6
- data/test/unit/test_LitleTransaction.rb +34 -5
- data/test/unit/test_LitleXmlMapper.rb +3 -0
- data/test/unit/test_activate.rb +22 -2
- data/test/unit/test_activateReversal.rb +15 -3
- data/test/unit/test_auth.rb +11 -9
- data/test/unit/test_balanceInquiry.rb +2 -2
- data/test/unit/test_capture.rb +2 -2
- data/test/unit/test_captureGivenAuth.rb +21 -1
- data/test/unit/test_credit.rb +1 -1
- data/test/unit/test_deactivate.rb +19 -0
- data/test/unit/test_deactivateReversal.rb +15 -3
- data/test/unit/test_depositReversal.rb +17 -5
- data/test/unit/test_echeckCredit.rb +19 -0
- data/test/unit/test_echeckRedeposit.rb +15 -0
- data/test/unit/test_echeckSale.rb +20 -1
- data/test/unit/test_echeckVerification.rb +6 -3
- data/test/unit/test_forceCapture.rb +1 -1
- data/test/unit/test_giftCardAuthReversal.rb +58 -0
- data/test/{functional/test_utf8.rb → unit/test_giftCardCapture.rb} +25 -12
- data/test/unit/test_giftCardCredit.rb +57 -0
- data/test/unit/test_load.rb +2 -2
- data/test/unit/test_loadReversal.rb +15 -3
- data/test/unit/test_pgp_LitleRequest +139 -0
- data/test/unit/test_queryTransaction.rb +105 -0
- data/test/unit/test_refundReversal.rb +15 -3
- data/test/unit/test_sale.rb +23 -3
- data/test/unit/test_token.rb +24 -20
- data/test/unit/test_unload.rb +2 -2
- data/test/unit/test_unloadReversal.rb +15 -3
- data/test/unit/test_wallet.rb +262 -0
- data/test/unit/ts_unit.rb +2 -1
- metadata +81 -100
data/lib/cacert.pem
CHANGED
File without changes
|
@@ -2,7 +2,7 @@ require_relative '../../lib/LitleOnline'
|
|
2
2
|
|
3
3
|
#Auth Reversal
|
4
4
|
#litleTxnId contains the Litle Transaction Id returned on the authorization
|
5
|
-
reversal_info = {'litleTxnId' => '100000000000000001'}
|
5
|
+
reversal_info = {'id'=>'test','litleTxnId' => '100000000000000001'}
|
6
6
|
reversal_response = LitleOnline::LitleOnlineRequest.new.auth_reversal(reversal_info)
|
7
7
|
|
8
8
|
#display results
|
@@ -10,6 +10,6 @@ puts "Response: " + reversal_response.authReversalResponse.response
|
|
10
10
|
puts "Message: " + reversal_response.authReversalResponse.message
|
11
11
|
puts "Litle Transaction ID: " + reversal_response .authReversalResponse.litleTxnId
|
12
12
|
|
13
|
-
if (!reversal_response.authReversalResponse.message.eql?'
|
13
|
+
if (!reversal_response.authReversalResponse.message.eql?'Transaction Received')
|
14
14
|
raise ArgumentError, "LitleAuthReversalTransaction has not been Approved", caller
|
15
15
|
end
|
@@ -4,6 +4,7 @@ require_relative '../../lib/LitleOnline'
|
|
4
4
|
#Puts a hold on the funds
|
5
5
|
auth_hash = {
|
6
6
|
'orderId' => '1',
|
7
|
+
'id'=>'test',
|
7
8
|
'amount' => '10010',
|
8
9
|
'orderSource'=>'ecommerce',
|
9
10
|
'billToAddress'=>{
|
@@ -23,25 +24,30 @@ auth_response = LitleOnline::LitleOnlineRequest.new.authorization(auth_hash)
|
|
23
24
|
|
24
25
|
#Capture
|
25
26
|
#Captures the authorization and results in money movement
|
26
|
-
capture_hash = {'
|
27
|
+
capture_hash = {'id'=>auth_response.authorizationResponse.id,
|
28
|
+
'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
27
29
|
capture_response = LitleOnline::LitleOnlineRequest.new.capture(capture_hash)
|
28
30
|
|
29
|
-
if (!capture_response.captureResponse.message.eql?'
|
31
|
+
if (!capture_response.captureResponse.message.eql?'Transaction Received')
|
30
32
|
raise ArgumentError, "LitlePaymentFullLifeCycle's Capture Transaction has not been Approved", caller
|
31
33
|
end
|
32
34
|
#Credit
|
33
35
|
#Refund the customer
|
34
|
-
credit_hash = {'
|
36
|
+
credit_hash = {'id'=>capture_response.captureResponse.id,
|
37
|
+
'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
38
|
+
|
35
39
|
credit_response = LitleOnline::LitleOnlineRequest.new.credit(credit_hash)
|
36
40
|
|
37
|
-
if (!credit_response.creditResponse.message.eql?'
|
41
|
+
if (!credit_response.creditResponse.message.eql?'Transaction Received')
|
38
42
|
raise ArgumentError, "LitlePaymentFullLifeCycle's credit Transaction has not been Approved", caller
|
39
43
|
end
|
40
44
|
#Void
|
41
45
|
#Cancel the refund, note that a deposit can be Voided as well
|
42
|
-
void_hash = {'
|
46
|
+
void_hash = {'id'=>credit_response.creditResponse.id,
|
47
|
+
'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
48
|
+
|
43
49
|
void_response = LitleOnline::LitleOnlineRequest.new.void(void_hash)
|
44
50
|
|
45
|
-
if (!void_response.voidResponse.message.eql?'
|
51
|
+
if (!void_response.voidResponse.message.eql?'Transaction Received')
|
46
52
|
raise ArgumentError, "LitlePaymentFullLifeCycle's Void Transaction has not been Approved", caller
|
47
53
|
end
|
@@ -83,7 +83,8 @@ request.process_responses({:transaction_listener => LitleOnline::DefaultLitleLis
|
|
83
83
|
|
84
84
|
#grab a child element of a child element of the transation
|
85
85
|
puts "AVS Result: " + transaction["fraudResult"]["avsResult"]
|
86
|
-
puts
|
86
|
+
puts transaction["message"]
|
87
|
+
# puts "Token Response Message: " + transaction["tokenResponse"]["tokenMessage"]
|
87
88
|
if (!transaction["message"].eql?'Approved')
|
88
89
|
raise ArgumentError, "SampleBatchDriver has not been Approved", caller
|
89
90
|
end
|
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
|
|
2
2
|
#Capture Given Auth
|
3
3
|
capture_given_auth_info = {
|
4
4
|
'merchantId' => '101',
|
5
|
+
'id'=>'test',
|
5
6
|
'version'=>'8.8',
|
6
7
|
'reportGroup'=>'Planets',
|
7
8
|
'orderId'=>'12344',
|
@@ -25,6 +26,6 @@ puts "Response: " + response.captureGivenAuthResponse.response
|
|
25
26
|
puts "Message: " + response.captureGivenAuthResponse.message
|
26
27
|
puts "Litle Transaction ID: " + response.captureGivenAuthResponse.litleTxnId
|
27
28
|
|
28
|
-
if (!response.captureGivenAuthResponse.message.eql?'
|
29
|
+
if (!response.captureGivenAuthResponse.message.eql?'Transaction Received')
|
29
30
|
raise ArgumentError, "LitleCaptureGivenAuthTransaction has not been Approved", caller
|
30
31
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../../lib/LitleOnline'
|
2
2
|
#Capture
|
3
3
|
#litleTxnId contains the Litle Transaction Id returned on the authorization
|
4
|
-
capture_info = {'litleTxnId' => '100000000000000001'}
|
4
|
+
capture_info = {'id'=>'test','litleTxnId' => '100000000000000001'}
|
5
5
|
capture_response = LitleOnline::LitleOnlineRequest.new.capture(capture_info)
|
6
6
|
|
7
7
|
#display results
|
@@ -9,6 +9,6 @@ puts "Response: " + capture_response.captureResponse.response
|
|
9
9
|
puts "Message: " + capture_response.captureResponse.message
|
10
10
|
puts "Litle Transaction ID: " + capture_response .captureResponse.litleTxnId
|
11
11
|
|
12
|
-
if (!capture_response.captureResponse.message.eql?'
|
12
|
+
if (!capture_response.captureResponse.message.eql?'Transaction Received')
|
13
13
|
raise ArgumentError, "LitleCaptureTransaction has not been Approved", caller
|
14
14
|
end
|
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
|
|
2
2
|
#Force Capture
|
3
3
|
force_capture_info = {
|
4
4
|
'merchantId' => '101',
|
5
|
+
'id'=>'test',
|
5
6
|
'version'=>'8.8',
|
6
7
|
'reportGroup'=>'Planets',
|
7
8
|
'litleTxnId'=>'123456',
|
@@ -21,6 +22,6 @@ puts "Response: " + response.forceCaptureResponse.response
|
|
21
22
|
puts "Message: " + response.forceCaptureResponse.message
|
22
23
|
puts "Litle Transaction ID: " + response.forceCaptureResponse.litleTxnId
|
23
24
|
|
24
|
-
if (!response.forceCaptureResponse.message.eql?'
|
25
|
+
if (!response.forceCaptureResponse.message.eql?'Transaction Received')
|
25
26
|
raise ArgumentError, "LitleForceCaptureTransaction has not been Approved", caller
|
26
27
|
end
|
@@ -3,7 +3,7 @@ require_relative '../../lib/LitleOnline'
|
|
3
3
|
#litleTxnId contains the Litle Transaction Id returned as part of the authorization
|
4
4
|
#submit the amount to capture which is less than the authorization amount
|
5
5
|
#to generate a partial capture
|
6
|
-
capture_info = {'litleTxnId' => '320000000000000001', 'amount' => '5005'}
|
6
|
+
capture_info = {'id'=>'test','litleTxnId' => '320000000000000001', 'amount' => '5005'}
|
7
7
|
capture_response = LitleOnline::LitleOnlineRequest.new.capture(capture_info)
|
8
8
|
|
9
9
|
#display results
|
@@ -11,6 +11,6 @@ puts "Response: " + capture_response.captureResponse.response
|
|
11
11
|
puts "Message: " + capture_response.captureResponse.message
|
12
12
|
puts "Litle Transaction ID: " + capture_response.captureResponse.litleTxnId
|
13
13
|
|
14
|
-
if (!capture_response.captureResponse.message.eql?'
|
15
|
-
raise ArgumentError, "LitlePartialCapture has not been
|
14
|
+
if (!capture_response.captureResponse.message.eql?'Transaction Received')
|
15
|
+
raise ArgumentError, "LitlePartialCapture has not been Recieved", caller
|
16
16
|
end
|
@@ -3,7 +3,7 @@ require_relative '../../lib/LitleOnline'
|
|
3
3
|
#litleTxnId contains the Litle Transaction Id returned on
|
4
4
|
#the capture or sale transaction being credited
|
5
5
|
#the amount is optional, if it isn't submitted the full amount will be credited
|
6
|
-
credit_info = {'litleTxnId' => '100000000000000002', 'amount' => '1010'}
|
6
|
+
credit_info = {'id'=>'test','litleTxnId' => '100000000000000002', 'amount' => '1010'}
|
7
7
|
credit_response = LitleOnline::LitleOnlineRequest.new.credit(credit_info)
|
8
8
|
|
9
9
|
#display results
|
@@ -11,6 +11,6 @@ puts "Response: " + credit_response.creditResponse.response
|
|
11
11
|
puts "Message: " + credit_response.creditResponse.message
|
12
12
|
puts "Litle Transaction ID: " + credit_response.creditResponse.litleTxnId
|
13
13
|
|
14
|
-
if (!credit_response.creditResponse.message.eql?'
|
14
|
+
if (!credit_response.creditResponse.message.eql?'Transaction Received')
|
15
15
|
raise ArgumentError, "LitleCreditTransaction has not been Approved", caller
|
16
16
|
end
|
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
|
|
2
2
|
#Stand alone credit
|
3
3
|
credit_info = {
|
4
4
|
'orderId' => '1',
|
5
|
+
'id'=>'test',
|
5
6
|
'amount' => '1010',
|
6
7
|
'orderSource'=>'ecommerce',
|
7
8
|
'billToAddress'=>{
|
@@ -24,6 +25,6 @@ puts "Response: " + credit_response.creditResponse.response
|
|
24
25
|
puts "Message: " + credit_response.creditResponse.response
|
25
26
|
puts "Litle Transaction ID: " + credit_response.creditResponse.litleTxnId
|
26
27
|
|
27
|
-
if (!credit_response.creditResponse.message.eql?'
|
28
|
+
if (!credit_response.creditResponse.message.eql?'Transaction Received')
|
28
29
|
raise ArgumentError, "LitleRefundTransaction has not been Approved", caller
|
29
30
|
end
|
@@ -4,6 +4,7 @@ require_relative '../../lib/LitleOnline'
|
|
4
4
|
void_info = {
|
5
5
|
#litleTxnId contains the Litle Transaction Id returned on the deposit/refund
|
6
6
|
'litleTxnId' => '100000000000000001',
|
7
|
+
'id'=>'test'
|
7
8
|
}
|
8
9
|
|
9
10
|
response = LitleOnline::LitleOnlineRequest.new.void(void_info)
|
@@ -13,6 +14,6 @@ puts "Response: " + response.voidResponse.response
|
|
13
14
|
puts "Message: " + response.voidResponse.message
|
14
15
|
puts "Litle Transaction ID: " + response.voidResponse.litleTxnId
|
15
16
|
|
16
|
-
if (!response.voidResponse.message.eql?'
|
17
|
+
if (!response.voidResponse.message.eql?'Transaction Received')
|
17
18
|
raise ArgumentError, "LitleVoidTransaction has not been Approved", caller
|
18
19
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative '../../lib/LitleOnline'
|
2
2
|
hash = {
|
3
3
|
'orderId'=>'1234',
|
4
|
+
'id'=>'test',
|
4
5
|
'amount'=>'106',
|
5
6
|
'orderSource'=>'ecommerce',
|
6
7
|
'paypage'=>{
|
@@ -22,6 +23,7 @@ puts "Litle Token: " + auth_response.authorizationResponse.tokenResponse.litleTo
|
|
22
23
|
end
|
23
24
|
#Now, we capture the authorization
|
24
25
|
hash = {
|
26
|
+
'id'=>auth_response.authorizationResponse.id,
|
25
27
|
'litleTxnId'=>auth_response.authorizationResponse.litleTxnId #Use the litleTxnId from the auth we want to capture
|
26
28
|
}
|
27
29
|
capture_response = LitleOnline::LitleOnlineRequest.new.capture(hash)
|
@@ -29,11 +31,12 @@ puts "Response: " + capture_response.captureResponse.response
|
|
29
31
|
puts "Message: " + capture_response.captureResponse.message
|
30
32
|
puts "Litle Transaction ID: " + capture_response.captureResponse.litleTxnId
|
31
33
|
|
32
|
-
if (!capture_response.captureResponse.message.eql?'
|
34
|
+
if (!capture_response.captureResponse.message.eql?'Transaction Received')
|
33
35
|
raise ArgumentError, "FullPaypageLifeCycle's capture has not been Approved", caller
|
34
36
|
end
|
35
37
|
#Now, we issue a refund against the capture
|
36
38
|
hash = {
|
39
|
+
'id'=>capture_response.captureResponse.id,
|
37
40
|
'litleTxnId'=>capture_response.captureResponse.litleTxnId #Use the litleTxnId from the capture we want to refund against
|
38
41
|
}
|
39
42
|
credit_response = LitleOnline::LitleOnlineRequest.new.credit(hash)
|
@@ -43,6 +46,7 @@ puts "Litle Transaction ID: " + credit_response.creditResponse.litleTxnId
|
|
43
46
|
|
44
47
|
#Now, we issue an auth reversal against the refund
|
45
48
|
hash = {
|
49
|
+
'id'=>credit_response.creditResponse.id,
|
46
50
|
'litleTxnId'=>credit_response.creditResponse.litleTxnId #Use the litleTxnId from the capture we want to refund against
|
47
51
|
}
|
48
52
|
reversal_response = LitleOnline::LitleOnlineRequest.new.auth_reversal(hash)
|
@@ -50,12 +54,13 @@ puts "Response: " + reversal_response.authReversalResponse.response
|
|
50
54
|
puts "Message: " + reversal_response.authReversalResponse.message
|
51
55
|
puts "Litle Transaction ID: " + reversal_response.authReversalResponse.litleTxnId
|
52
56
|
|
53
|
-
if (!reversal_response.authReversalResponse.message.eql?'
|
57
|
+
if (!reversal_response.authReversalResponse.message.eql?'Transaction Received')
|
54
58
|
raise ArgumentError, "FullPaypageLifeCycle's reversal has not been Approved", caller
|
55
59
|
end
|
56
60
|
#Let's assume next month we want to create a sale for the same card as the original authorization. The paypageRegistrationId is expired, but we have the token and can use it
|
57
61
|
hash = {
|
58
62
|
'orderId'=>'4321',
|
63
|
+
'id'=>'test',
|
59
64
|
'amount'=>'106',
|
60
65
|
'orderSource'=>'ecommerce',
|
61
66
|
'token'=>{
|
data/samples/Run_all.rb
CHANGED
File without changes
|
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
|
|
2
2
|
#Sale
|
3
3
|
my_sale_info = {
|
4
4
|
'orderId' => '1',
|
5
|
+
'id'=>'test',
|
5
6
|
'amount' => '10010',
|
6
7
|
'orderSource'=>'ecommerce',
|
7
8
|
'billToAddress'=>{
|
@@ -24,6 +25,6 @@ puts "Response: " + sale_response.saleResponse.response
|
|
24
25
|
puts "Message: " + sale_response.saleResponse.message
|
25
26
|
puts "Litle Transaction ID: " + sale_response.saleResponse.litleTxnId
|
26
27
|
|
27
|
-
if (!sale_response.saleResponse.message.eql?'
|
28
|
+
if (!sale_response.saleResponse.message.eql?'Transaction Received')
|
28
29
|
raise ArgumentError, "LitleSaleTransaction has not been Approved", caller
|
29
30
|
end
|
@@ -2,6 +2,7 @@ require_relative '../../lib/LitleOnline'
|
|
2
2
|
# Visa $10 Sale
|
3
3
|
litleSaleTxn = {
|
4
4
|
'merchantId' => '087900',
|
5
|
+
'id' => 'test',
|
5
6
|
'reportGroup'=>'rpt_grp',
|
6
7
|
'orderId'=>'1234567',
|
7
8
|
'card'=>{
|
@@ -19,6 +20,6 @@ response = LitleOnline::LitleOnlineRequest.new.sale(litleSaleTxn)
|
|
19
20
|
puts "Message: "+ response.message
|
20
21
|
puts "Litle Transaction ID: "+ response.saleResponse.litleTxnId
|
21
22
|
|
22
|
-
if (!response.saleResponse.message.eql?'
|
23
|
+
if (!response.saleResponse.message.eql?'Transaction Received')
|
23
24
|
raise ArgumentError, "SampleSaleTransaction has not been Approved", caller
|
24
25
|
end
|
@@ -4,9 +4,9 @@ require 'test/unit'
|
|
4
4
|
|
5
5
|
module LitleOnline
|
6
6
|
class Litle_certTest < Test::Unit::TestCase
|
7
|
-
@@merchant_hash = {
|
8
|
-
|
9
|
-
|
7
|
+
@@merchant_hash = {'reportGroup'=>'Planets',
|
8
|
+
'merchantId'=>'101',
|
9
|
+
'id'=>'test'
|
10
10
|
}
|
11
11
|
|
12
12
|
def test_1_auth
|
@@ -34,27 +34,27 @@ module LitleOnline
|
|
34
34
|
assert_equal('11111 ', auth_response.authorizationResponse.authCode)
|
35
35
|
assert_equal('01', auth_response.authorizationResponse.fraudResult.avsResult)
|
36
36
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
37
|
-
|
37
|
+
|
38
38
|
#test 1A
|
39
39
|
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
40
40
|
hash1a = capture_hash.merge(@@merchant_hash)
|
41
41
|
capture_response = LitleOnlineRequest.new.capture(hash1a)
|
42
42
|
assert_equal('000', capture_response.captureResponse.response)
|
43
|
-
|
43
|
+
|
44
44
|
|
45
45
|
#test 1B
|
46
46
|
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
47
47
|
hash1b = credit_hash.merge(@@merchant_hash)
|
48
48
|
credit_response = LitleOnlineRequest.new.credit(hash1b)
|
49
49
|
assert_equal('000', credit_response.creditResponse.response)
|
50
|
-
|
50
|
+
|
51
51
|
|
52
52
|
#test1C
|
53
53
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
54
54
|
hash1c = void_hash.merge(@@merchant_hash)
|
55
55
|
void_response = LitleOnlineRequest.new.void(hash1c)
|
56
56
|
assert_equal('000', void_response.voidResponse.response)
|
57
|
-
|
57
|
+
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_1_AVS
|
@@ -115,20 +115,20 @@ module LitleOnline
|
|
115
115
|
hash1b = credit_hash.merge(@@merchant_hash)
|
116
116
|
credit_response = LitleOnlineRequest.new.credit(hash1b)
|
117
117
|
assert_equal('000', credit_response.creditResponse.response)
|
118
|
-
|
118
|
+
|
119
119
|
|
120
120
|
#test1C
|
121
121
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
122
122
|
hash1c = void_hash.merge(@@merchant_hash)
|
123
123
|
void_response = LitleOnlineRequest.new.void(hash1c)
|
124
124
|
assert_equal('000', void_response.voidResponse.response)
|
125
|
-
|
125
|
+
|
126
126
|
end
|
127
127
|
|
128
128
|
def test_2_auth
|
129
129
|
customer_hash = {
|
130
130
|
'orderId' => '2',
|
131
|
-
'amount' => '
|
131
|
+
'amount' => '20020',
|
132
132
|
'orderSource'=>'ecommerce',
|
133
133
|
'billToAddress'=>{
|
134
134
|
'name' => 'Mike J. Hammer',
|
@@ -150,7 +150,7 @@ module LitleOnline
|
|
150
150
|
auth_response = LitleOnlineRequest.new.authorization(hash)
|
151
151
|
assert_equal('000', auth_response.authorizationResponse.response)
|
152
152
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
153
|
-
assert_equal('22222
|
153
|
+
assert_equal('22222', auth_response.authorizationResponse.authCode)
|
154
154
|
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
155
155
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
156
156
|
|
@@ -159,21 +159,21 @@ module LitleOnline
|
|
159
159
|
hash2a = capture_hash.merge(@@merchant_hash)
|
160
160
|
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
161
161
|
assert_equal('000', capture_response.captureResponse.response)
|
162
|
-
|
162
|
+
|
163
163
|
|
164
164
|
#test 2B
|
165
165
|
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
166
166
|
hash2b = credit_hash.merge(@@merchant_hash)
|
167
167
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
168
168
|
assert_equal('000', credit_response.creditResponse.response)
|
169
|
-
|
169
|
+
|
170
170
|
|
171
171
|
#test 2C
|
172
172
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
173
173
|
hash2c = void_hash.merge(@@merchant_hash)
|
174
174
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
175
175
|
assert_equal('000', void_response.voidResponse.response)
|
176
|
-
|
176
|
+
|
177
177
|
end
|
178
178
|
|
179
179
|
def test_2_avs
|
@@ -201,7 +201,7 @@ module LitleOnline
|
|
201
201
|
auth_response = LitleOnlineRequest.new.authorization(hash)
|
202
202
|
assert_equal('000', auth_response.authorizationResponse.response)
|
203
203
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
204
|
-
assert_equal('22222
|
204
|
+
assert_equal('22222', auth_response.authorizationResponse.authCode)
|
205
205
|
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
206
206
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
207
207
|
end
|
@@ -209,7 +209,7 @@ module LitleOnline
|
|
209
209
|
def test_2_sale
|
210
210
|
customer_hash = {
|
211
211
|
'orderId' => '2',
|
212
|
-
'amount' => '
|
212
|
+
'amount' => '20020',
|
213
213
|
'orderSource'=>'ecommerce',
|
214
214
|
'billToAddress'=>{
|
215
215
|
'name' => 'Mike J. Hammer',
|
@@ -231,24 +231,23 @@ module LitleOnline
|
|
231
231
|
sale_response = LitleOnlineRequest.new.sale(hash)
|
232
232
|
assert_equal('000', sale_response.saleResponse.response)
|
233
233
|
assert_equal('Approved', sale_response.saleResponse.message)
|
234
|
-
assert_equal('22222
|
234
|
+
assert_equal('22222', sale_response.saleResponse.authCode)
|
235
235
|
assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
|
236
236
|
assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
|
237
237
|
|
238
238
|
#test 2B
|
239
|
-
sleep(5)
|
240
239
|
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
241
240
|
hash2b = credit_hash.merge(@@merchant_hash)
|
242
241
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
243
242
|
assert_equal('000', credit_response.creditResponse.response)
|
244
|
-
|
243
|
+
|
245
244
|
|
246
245
|
#test 2C
|
247
246
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
248
247
|
hash2c = void_hash.merge(@@merchant_hash)
|
249
248
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
250
249
|
assert_equal('000', void_response.voidResponse.response)
|
251
|
-
|
250
|
+
|
252
251
|
end
|
253
252
|
|
254
253
|
def test_3_auth
|
@@ -273,7 +272,7 @@ module LitleOnline
|
|
273
272
|
auth_response = LitleOnlineRequest.new.authorization(hash)
|
274
273
|
assert_equal('000', auth_response.authorizationResponse.response)
|
275
274
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
276
|
-
assert_equal('33333
|
275
|
+
assert_equal('33333', auth_response.authorizationResponse.authCode)
|
277
276
|
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
278
277
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
279
278
|
|
@@ -282,21 +281,21 @@ module LitleOnline
|
|
282
281
|
hash2a = capture_hash.merge(@@merchant_hash)
|
283
282
|
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
284
283
|
assert_equal('000', capture_response.captureResponse.response)
|
285
|
-
|
284
|
+
|
286
285
|
|
287
286
|
#test 3B
|
288
287
|
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
289
288
|
hash2b = credit_hash.merge(@@merchant_hash)
|
290
289
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
291
290
|
assert_equal('000', credit_response.creditResponse.response)
|
292
|
-
|
291
|
+
|
293
292
|
|
294
293
|
#test 3C
|
295
294
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
296
295
|
hash2c = void_hash.merge(@@merchant_hash)
|
297
296
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
298
297
|
assert_equal('000', void_response.voidResponse.response)
|
299
|
-
|
298
|
+
|
300
299
|
end
|
301
300
|
|
302
301
|
def test_3_avs
|
@@ -321,7 +320,7 @@ module LitleOnline
|
|
321
320
|
auth_response = LitleOnlineRequest.new.authorization(hash)
|
322
321
|
assert_equal('000', auth_response.authorizationResponse.response)
|
323
322
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
324
|
-
assert_equal('33333
|
323
|
+
assert_equal('33333', auth_response.authorizationResponse.authCode)
|
325
324
|
assert_equal('10', auth_response.authorizationResponse.fraudResult.avsResult)
|
326
325
|
assert_equal('M', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
327
326
|
end
|
@@ -348,7 +347,7 @@ module LitleOnline
|
|
348
347
|
sale_response = LitleOnlineRequest.new.sale(hash)
|
349
348
|
assert_equal('000', sale_response.saleResponse.response)
|
350
349
|
assert_equal('Approved', sale_response.saleResponse.message)
|
351
|
-
assert_equal('33333
|
350
|
+
assert_equal('33333', sale_response.saleResponse.authCode)
|
352
351
|
assert_equal('10', sale_response.saleResponse.fraudResult.avsResult)
|
353
352
|
assert_equal('M', sale_response.saleResponse.fraudResult.cardValidationResult)
|
354
353
|
|
@@ -357,14 +356,14 @@ module LitleOnline
|
|
357
356
|
hash2b = credit_hash.merge(@@merchant_hash)
|
358
357
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
359
358
|
assert_equal('000', credit_response.creditResponse.response)
|
360
|
-
|
359
|
+
|
361
360
|
|
362
361
|
#test 3C
|
363
362
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
364
363
|
hash2c = void_hash.merge(@@merchant_hash)
|
365
364
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
366
365
|
assert_equal('000', void_response.voidResponse.response)
|
367
|
-
|
366
|
+
|
368
367
|
end
|
369
368
|
|
370
369
|
def test_4_auth
|
@@ -389,8 +388,8 @@ module LitleOnline
|
|
389
388
|
auth_response = LitleOnlineRequest.new.authorization(hash)
|
390
389
|
assert_equal('000', auth_response.authorizationResponse.response)
|
391
390
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
392
|
-
assert_equal('44444
|
393
|
-
assert_equal('
|
391
|
+
assert_equal('44444', auth_response.authorizationResponse.authCode)
|
392
|
+
assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
|
394
393
|
|
395
394
|
#test 4A
|
396
395
|
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
@@ -403,20 +402,20 @@ module LitleOnline
|
|
403
402
|
hash2b = credit_hash.merge(@@merchant_hash)
|
404
403
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
405
404
|
assert_equal('000', credit_response.creditResponse.response)
|
406
|
-
|
405
|
+
|
407
406
|
|
408
407
|
#test 4C
|
409
408
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
410
409
|
hash2c = void_hash.merge(@@merchant_hash)
|
411
410
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
412
411
|
assert_equal('000', void_response.voidResponse.response)
|
413
|
-
|
412
|
+
|
414
413
|
end
|
415
414
|
|
416
415
|
def test_4_avs
|
417
416
|
customer_hash = {
|
418
417
|
'orderId' => '4',
|
419
|
-
'amount' => '
|
418
|
+
'amount' => '0',
|
420
419
|
'orderSource'=>'ecommerce',
|
421
420
|
'billToAddress'=>{
|
422
421
|
'name' => 'Bob Black',
|
@@ -435,8 +434,8 @@ module LitleOnline
|
|
435
434
|
auth_response = LitleOnlineRequest.new.authorization(hash)
|
436
435
|
assert_equal('000', auth_response.authorizationResponse.response)
|
437
436
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
438
|
-
assert_equal('44444
|
439
|
-
assert_equal('
|
437
|
+
assert_equal('44444', auth_response.authorizationResponse.authCode)
|
438
|
+
assert_equal('12', auth_response.authorizationResponse.fraudResult.avsResult)
|
440
439
|
end
|
441
440
|
|
442
441
|
def test_4_sale
|
@@ -461,31 +460,31 @@ module LitleOnline
|
|
461
460
|
sale_response = LitleOnlineRequest.new.sale(hash)
|
462
461
|
assert_equal('000', sale_response.saleResponse.response)
|
463
462
|
assert_equal('Approved', sale_response.saleResponse.message)
|
464
|
-
assert_equal('44444
|
465
|
-
assert_equal('
|
463
|
+
assert_equal('44444', sale_response.saleResponse.authCode)
|
464
|
+
assert_equal('12', sale_response.saleResponse.fraudResult.avsResult)
|
466
465
|
|
467
466
|
#test 4B
|
468
467
|
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
469
468
|
hash2b = credit_hash.merge(@@merchant_hash)
|
470
469
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
471
470
|
assert_equal('000', credit_response.creditResponse.response)
|
472
|
-
|
471
|
+
|
473
472
|
|
474
473
|
#test 4C
|
475
474
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
476
475
|
hash2c = void_hash.merge(@@merchant_hash)
|
477
476
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
478
477
|
assert_equal('000', void_response.voidResponse.response)
|
479
|
-
|
478
|
+
|
480
479
|
end
|
481
480
|
|
482
481
|
def test_5_auth
|
483
482
|
customer_hash = {
|
484
483
|
'orderId' => '5',
|
485
|
-
'amount' => '
|
484
|
+
'amount' => '50050',
|
486
485
|
'orderSource'=>'ecommerce',
|
487
486
|
'card'=>{
|
488
|
-
'number' =>'
|
487
|
+
'number' =>'4457010200000007',
|
489
488
|
'expDate' => '0512',
|
490
489
|
'cardValidationNum' => '463',
|
491
490
|
'type' => 'VI'},
|
@@ -497,28 +496,28 @@ module LitleOnline
|
|
497
496
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
498
497
|
assert_equal('55555 ', auth_response.authorizationResponse.authCode)
|
499
498
|
assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
|
500
|
-
assert_equal('
|
499
|
+
assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
501
500
|
|
502
501
|
#test 5A
|
503
502
|
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
504
503
|
hash2a = capture_hash.merge(@@merchant_hash)
|
505
504
|
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
506
505
|
assert_equal('000', capture_response.captureResponse.response)
|
507
|
-
|
506
|
+
|
508
507
|
|
509
508
|
#test 5B
|
510
509
|
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
511
510
|
hash2b = credit_hash.merge(@@merchant_hash)
|
512
511
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
513
512
|
assert_equal('000', credit_response.creditResponse.response)
|
514
|
-
|
513
|
+
|
515
514
|
|
516
515
|
#test 5C
|
517
516
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
518
517
|
hash2c = void_hash.merge(@@merchant_hash)
|
519
518
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
520
519
|
assert_equal('000', void_response.voidResponse.response)
|
521
|
-
|
520
|
+
|
522
521
|
end
|
523
522
|
|
524
523
|
def test_5_avs
|
@@ -527,7 +526,7 @@ module LitleOnline
|
|
527
526
|
'amount' => '0',
|
528
527
|
'orderSource'=>'ecommerce',
|
529
528
|
'card'=>{
|
530
|
-
'number' =>'
|
529
|
+
'number' =>'4457010200000007',
|
531
530
|
'expDate' => '0512',
|
532
531
|
'cardValidationNum' => '463',
|
533
532
|
'type' => 'VI'},
|
@@ -539,7 +538,7 @@ module LitleOnline
|
|
539
538
|
assert_equal('Approved', auth_response.authorizationResponse.message)
|
540
539
|
assert_equal('55555 ', auth_response.authorizationResponse.authCode)
|
541
540
|
assert_equal('32', auth_response.authorizationResponse.fraudResult.avsResult)
|
542
|
-
assert_equal('
|
541
|
+
assert_equal('N', auth_response.authorizationResponse.fraudResult.cardValidationResult)
|
543
542
|
end
|
544
543
|
|
545
544
|
def test_5_sale
|
@@ -560,21 +559,21 @@ module LitleOnline
|
|
560
559
|
assert_equal('Approved', sale_response.saleResponse.message)
|
561
560
|
assert_equal('55555 ', sale_response.saleResponse.authCode)
|
562
561
|
assert_equal('32', sale_response.saleResponse.fraudResult.avsResult)
|
563
|
-
assert_equal('
|
562
|
+
assert_equal('N', sale_response.saleResponse.fraudResult.cardValidationResult)
|
564
563
|
|
565
564
|
#test 5B
|
566
565
|
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
567
566
|
hash2b = credit_hash.merge(@@merchant_hash)
|
568
567
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
569
568
|
assert_equal('000', credit_response.creditResponse.response)
|
570
|
-
|
569
|
+
|
571
570
|
|
572
571
|
#test 5C
|
573
572
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
574
573
|
hash2c = void_hash.merge(@@merchant_hash)
|
575
574
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
576
575
|
assert_equal('000', void_response.voidResponse.response)
|
577
|
-
|
576
|
+
|
578
577
|
end
|
579
578
|
|
580
579
|
def test_6_auth
|
@@ -629,11 +628,11 @@ module LitleOnline
|
|
629
628
|
assert_equal('P', sale_response.saleResponse.fraudResult.cardValidationResult)
|
630
629
|
|
631
630
|
#test 6A
|
632
|
-
void_hash = {'litleTxnId' =>
|
631
|
+
void_hash = {'litleTxnId' => '123456789000' }
|
633
632
|
hash6A = void_hash.merge(@@merchant_hash)
|
634
633
|
void_response = LitleOnlineRequest.new.void(hash6A)
|
635
|
-
assert_equal('
|
636
|
-
|
634
|
+
assert_equal('000', void_response.voidResponse.response)
|
635
|
+
|
637
636
|
end
|
638
637
|
|
639
638
|
def test_7_auth
|