LitleOnline 9.12.0 → 10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +7 -16
- data/CONTRIBUTORS +0 -0
- data/DESCRIPTION +2 -2
- data/LICENSE +1 -1
- data/README.md +9 -9
- data/Rakefile +9 -8
- data/SETUP.md +3 -3
- data/bin/Setup.rb +4 -4
- data/bin/sample_batch_driver.rb +1 -1
- data/bin/sample_driver.rb +1 -1
- data/lib/Communications.rb +7 -7
- data/lib/Configuration.rb +1 -1
- data/lib/EnvironmentVariables.rb +0 -0
- data/lib/LitleBatchRequest.rb +22 -8
- data/lib/LitleListeners.rb +9 -9
- data/lib/LitleOnline.rb +2 -2
- data/lib/LitleOnlineRequest.rb +16 -10
- data/lib/LitleRequest.rb +10 -10
- data/lib/LitleTransaction.rb +66 -64
- data/lib/LitleXmlMapper.rb +4 -9
- data/lib/XMLFields.rb +129 -116
- 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 +53 -52
- data/test/certification/certTest2_authenhanced.rb +16 -15
- data/test/certification/certTest3_authreversal.rb +16 -15
- data/test/certification/certTest4_echeck.rb +11 -10
- data/test/certification/certTest5_token.rb +2 -1
- data/test/certification/certTest_batchAll.rb +40 -16
- data/test/certification/ts_all.rb +1 -1
- data/test/functional/test_activate.rb +8 -9
- data/test/functional/test_activateReversal.rb +4 -7
- data/test/functional/test_auth.rb +50 -113
- data/test/functional/test_authReversal.rb +6 -5
- data/test/functional/test_balanceInquiry.rb +5 -5
- data/test/functional/test_batch.rb +1 -1
- data/test/functional/test_batchStream.rb +3 -5
- data/test/functional/test_cancelSubscription.rb +3 -5
- data/test/functional/test_capture.rb +6 -34
- data/test/functional/test_captureGivenAuth.rb +13 -55
- data/test/functional/test_configuration.rb +1 -1
- data/test/functional/test_createPlan.rb +3 -5
- data/test/functional/test_credit.rb +10 -17
- data/test/functional/test_deactivate.rb +5 -5
- data/test/functional/test_deactivateReversal.rb +4 -5
- data/test/functional/test_depositReversal.rb +5 -5
- data/test/functional/test_echeckCredit.rb +17 -13
- data/test/functional/test_echeckRedeposit.rb +7 -5
- data/test/functional/test_echeckSale.rb +42 -21
- data/test/functional/test_echeckVerification.rb +19 -20
- data/test/functional/test_echeckVoid.rb +3 -2
- data/test/functional/test_forceCapture.rb +16 -30
- data/test/functional/test_litle_requests.rb +5 -9
- data/test/functional/test_load.rb +5 -5
- data/test/functional/test_loadReversal.rb +4 -5
- data/test/functional/test_override.rb +3 -0
- data/test/functional/test_queryTransaction.rb +146 -0
- data/test/functional/test_refundReversal.rb +4 -5
- data/test/functional/test_sale.rb +94 -170
- data/test/functional/test_token.rb +9 -18
- data/test/functional/test_unload.rb +5 -5
- data/test/functional/test_unloadReversal.rb +5 -6
- data/test/functional/test_updateCardValidationNumOnToken.rb +2 -1
- data/test/functional/test_updatePlan.rb +4 -5
- data/test/functional/test_updateSubscription.rb +5 -5
- data/test/functional/test_wallet.rb +74 -0
- data/test/functional/test_xmlfields.rb +25 -10
- data/test/functional/ts_all.rb +4 -2
- data/test/unit/test_LitleAUBatch.rb +1 -1
- data/test/unit/test_LitleBatchRequest.rb +4 -4
- data/test/unit/test_LitleOnlineRequest.rb +54 -37
- data/test/unit/test_LitleRequest.rb +3 -4
- data/test/unit/test_LitleTransaction.rb +35 -6
- data/test/unit/test_activate.rb +21 -1
- data/test/unit/test_activateReversal.rb +1 -1
- data/test/unit/test_auth.rb +16 -55
- data/test/unit/test_authReversal.rb +1 -1
- data/test/unit/test_balanceInquiry.rb +1 -1
- data/test/unit/test_cancelSubscription.rb +1 -1
- data/test/unit/test_capture.rb +1 -27
- data/test/unit/test_captureGivenAuth.rb +18 -44
- data/test/unit/test_createPlan.rb +1 -1
- data/test/unit/test_credit.rb +3 -16
- data/test/unit/test_deactivate.rb +1 -1
- data/test/unit/test_deactivateReversal.rb +1 -1
- data/test/unit/test_depositReversal.rb +1 -1
- data/test/unit/test_echeckCredit.rb +1 -1
- data/test/unit/test_echeckRedeposit.rb +1 -1
- data/test/unit/test_echeckSale.rb +2 -2
- data/test/unit/test_echeckVerification.rb +1 -1
- data/test/unit/test_echeckVoid.rb +1 -1
- data/test/unit/test_forceCapture.rb +2 -20
- data/test/unit/test_load.rb +1 -1
- data/test/unit/test_loadReversal.rb +1 -1
- data/test/unit/test_queryTransaction.rb +122 -0
- data/test/unit/test_refundReversal.rb +1 -1
- data/test/unit/test_sale.rb +8 -73
- data/test/unit/test_token.rb +8 -15
- data/test/unit/test_unload.rb +1 -1
- data/test/unit/test_unloadReversal.rb +1 -1
- data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/unit/test_updatePlan.rb +1 -1
- data/test/unit/test_updateSubscription.rb +1 -1
- data/test/unit/test_wallet.rb +262 -0
- data/test/unit/test_xmlfields.rb +1 -1
- data/test/unit/ts_unit.rb +3 -3
- metadata +15 -16
- data/temp.xml +0 -21
- data/test/functional/test_fraudCheck.rb +0 -77
- data/test/functional/test_utf8.rb +0 -44
- data/test/unit/test_LitleXmlMapper.rb +0 -136
- data/test/unit/test_fraudCheck.rb +0 -45
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
|
@@ -5,7 +5,8 @@ require 'test/unit'
|
|
5
5
|
module LitleOnline
|
6
6
|
class Litle_certTest < Test::Unit::TestCase
|
7
7
|
@@merchant_hash = {'reportGroup'=>'Planets',
|
8
|
-
'merchantId'=>'101'
|
8
|
+
'merchantId'=>'101',
|
9
|
+
'id'=>'test'
|
9
10
|
}
|
10
11
|
|
11
12
|
def test_1_auth
|
@@ -38,22 +39,22 @@ module LitleOnline
|
|
38
39
|
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
39
40
|
hash1a = capture_hash.merge(@@merchant_hash)
|
40
41
|
capture_response = LitleOnlineRequest.new.capture(hash1a)
|
41
|
-
assert_equal('
|
42
|
-
assert_equal('
|
42
|
+
assert_equal('001', capture_response.captureResponse.response)
|
43
|
+
assert_equal('Transaction Received', capture_response.captureResponse.message)
|
43
44
|
|
44
45
|
#test 1B
|
45
46
|
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
46
47
|
hash1b = credit_hash.merge(@@merchant_hash)
|
47
48
|
credit_response = LitleOnlineRequest.new.credit(hash1b)
|
48
|
-
assert_equal('
|
49
|
-
assert_equal('
|
49
|
+
assert_equal('001', credit_response.creditResponse.response)
|
50
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
50
51
|
|
51
52
|
#test1C
|
52
53
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
53
54
|
hash1c = void_hash.merge(@@merchant_hash)
|
54
55
|
void_response = LitleOnlineRequest.new.void(hash1c)
|
55
|
-
assert_equal('
|
56
|
-
assert_equal('
|
56
|
+
assert_equal('001', void_response.voidResponse.response)
|
57
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
57
58
|
end
|
58
59
|
|
59
60
|
def test_1_AVS
|
@@ -113,15 +114,15 @@ module LitleOnline
|
|
113
114
|
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
114
115
|
hash1b = credit_hash.merge(@@merchant_hash)
|
115
116
|
credit_response = LitleOnlineRequest.new.credit(hash1b)
|
116
|
-
assert_equal('
|
117
|
-
assert_equal('
|
117
|
+
assert_equal('001', credit_response.creditResponse.response)
|
118
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
118
119
|
|
119
120
|
#test1C
|
120
121
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
121
122
|
hash1c = void_hash.merge(@@merchant_hash)
|
122
123
|
void_response = LitleOnlineRequest.new.void(hash1c)
|
123
|
-
assert_equal('
|
124
|
-
assert_equal('
|
124
|
+
assert_equal('001', void_response.voidResponse.response)
|
125
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
125
126
|
end
|
126
127
|
|
127
128
|
def test_2_auth
|
@@ -157,22 +158,22 @@ module LitleOnline
|
|
157
158
|
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
158
159
|
hash2a = capture_hash.merge(@@merchant_hash)
|
159
160
|
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
160
|
-
assert_equal('
|
161
|
-
assert_equal('
|
161
|
+
assert_equal('001', capture_response.captureResponse.response)
|
162
|
+
assert_equal('Transaction Received', capture_response.captureResponse.message)
|
162
163
|
|
163
164
|
#test 2B
|
164
165
|
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
165
166
|
hash2b = credit_hash.merge(@@merchant_hash)
|
166
167
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
167
|
-
assert_equal('
|
168
|
-
assert_equal('
|
168
|
+
assert_equal('001', credit_response.creditResponse.response)
|
169
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
169
170
|
|
170
171
|
#test 2C
|
171
172
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
172
173
|
hash2c = void_hash.merge(@@merchant_hash)
|
173
174
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
174
|
-
assert_equal('
|
175
|
-
assert_equal('
|
175
|
+
assert_equal('001', void_response.voidResponse.response)
|
176
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
176
177
|
end
|
177
178
|
|
178
179
|
def test_2_avs
|
@@ -238,15 +239,15 @@ module LitleOnline
|
|
238
239
|
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
239
240
|
hash2b = credit_hash.merge(@@merchant_hash)
|
240
241
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
241
|
-
assert_equal('
|
242
|
-
assert_equal('
|
242
|
+
assert_equal('001', credit_response.creditResponse.response)
|
243
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
243
244
|
|
244
245
|
#test 2C
|
245
246
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
246
247
|
hash2c = void_hash.merge(@@merchant_hash)
|
247
248
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
248
|
-
assert_equal('
|
249
|
-
assert_equal('
|
249
|
+
assert_equal('001', void_response.voidResponse.response)
|
250
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
250
251
|
end
|
251
252
|
|
252
253
|
def test_3_auth
|
@@ -279,22 +280,22 @@ module LitleOnline
|
|
279
280
|
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
280
281
|
hash2a = capture_hash.merge(@@merchant_hash)
|
281
282
|
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
282
|
-
assert_equal('
|
283
|
-
assert_equal('
|
283
|
+
assert_equal('001', capture_response.captureResponse.response)
|
284
|
+
assert_equal('Transaction Received', capture_response.captureResponse.message)
|
284
285
|
|
285
286
|
#test 3B
|
286
287
|
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
287
288
|
hash2b = credit_hash.merge(@@merchant_hash)
|
288
289
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
289
|
-
assert_equal('
|
290
|
-
assert_equal('
|
290
|
+
assert_equal('001', credit_response.creditResponse.response)
|
291
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
291
292
|
|
292
293
|
#test 3C
|
293
294
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
294
295
|
hash2c = void_hash.merge(@@merchant_hash)
|
295
296
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
296
|
-
assert_equal('
|
297
|
-
assert_equal('
|
297
|
+
assert_equal('001', void_response.voidResponse.response)
|
298
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
298
299
|
end
|
299
300
|
|
300
301
|
def test_3_avs
|
@@ -354,15 +355,15 @@ module LitleOnline
|
|
354
355
|
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
355
356
|
hash2b = credit_hash.merge(@@merchant_hash)
|
356
357
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
357
|
-
assert_equal('
|
358
|
-
assert_equal('
|
358
|
+
assert_equal('001', credit_response.creditResponse.response)
|
359
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
359
360
|
|
360
361
|
#test 3C
|
361
362
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
362
363
|
hash2c = void_hash.merge(@@merchant_hash)
|
363
364
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
364
|
-
assert_equal('
|
365
|
-
assert_equal('
|
365
|
+
assert_equal('001', void_response.voidResponse.response)
|
366
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
366
367
|
end
|
367
368
|
|
368
369
|
def test_4_auth
|
@@ -394,21 +395,21 @@ module LitleOnline
|
|
394
395
|
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
395
396
|
hash2a = capture_hash.merge(@@merchant_hash)
|
396
397
|
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
397
|
-
assert_equal('
|
398
|
+
assert_equal('Transaction Received', capture_response.captureResponse.message)
|
398
399
|
|
399
400
|
#test 4B
|
400
401
|
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
401
402
|
hash2b = credit_hash.merge(@@merchant_hash)
|
402
403
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
403
|
-
assert_equal('
|
404
|
-
assert_equal('
|
404
|
+
assert_equal('001', credit_response.creditResponse.response)
|
405
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
405
406
|
|
406
407
|
#test 4C
|
407
408
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
408
409
|
hash2c = void_hash.merge(@@merchant_hash)
|
409
410
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
410
|
-
assert_equal('
|
411
|
-
assert_equal('
|
411
|
+
assert_equal('001', void_response.voidResponse.response)
|
412
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
412
413
|
end
|
413
414
|
|
414
415
|
def test_4_avs
|
@@ -466,15 +467,15 @@ module LitleOnline
|
|
466
467
|
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
467
468
|
hash2b = credit_hash.merge(@@merchant_hash)
|
468
469
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
469
|
-
assert_equal('
|
470
|
-
assert_equal('
|
470
|
+
assert_equal('001', credit_response.creditResponse.response)
|
471
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
471
472
|
|
472
473
|
#test 4C
|
473
474
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
474
475
|
hash2c = void_hash.merge(@@merchant_hash)
|
475
476
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
476
|
-
assert_equal('
|
477
|
-
assert_equal('
|
477
|
+
assert_equal('001', void_response.voidResponse.response)
|
478
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
478
479
|
end
|
479
480
|
|
480
481
|
def test_5_auth
|
@@ -501,22 +502,22 @@ module LitleOnline
|
|
501
502
|
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
502
503
|
hash2a = capture_hash.merge(@@merchant_hash)
|
503
504
|
capture_response = LitleOnlineRequest.new.capture(hash2a)
|
504
|
-
assert_equal('
|
505
|
-
assert_equal('
|
505
|
+
assert_equal('001', capture_response.captureResponse.response)
|
506
|
+
assert_equal('Transaction Received', capture_response.captureResponse.message)
|
506
507
|
|
507
508
|
#test 5B
|
508
509
|
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
509
510
|
hash2b = credit_hash.merge(@@merchant_hash)
|
510
511
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
511
|
-
assert_equal('
|
512
|
-
assert_equal('
|
512
|
+
assert_equal('001', credit_response.creditResponse.response)
|
513
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
513
514
|
|
514
515
|
#test 5C
|
515
516
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
516
517
|
hash2c = void_hash.merge(@@merchant_hash)
|
517
518
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
518
|
-
assert_equal('
|
519
|
-
assert_equal('
|
519
|
+
assert_equal('001', void_response.voidResponse.response)
|
520
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
520
521
|
end
|
521
522
|
|
522
523
|
def test_5_avs
|
@@ -564,15 +565,15 @@ module LitleOnline
|
|
564
565
|
credit_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId}
|
565
566
|
hash2b = credit_hash.merge(@@merchant_hash)
|
566
567
|
credit_response = LitleOnlineRequest.new.credit(hash2b)
|
567
|
-
assert_equal('
|
568
|
-
assert_equal('
|
568
|
+
assert_equal('001', credit_response.creditResponse.response)
|
569
|
+
assert_equal('Transaction Received', credit_response.creditResponse.message)
|
569
570
|
|
570
571
|
#test 5C
|
571
572
|
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
572
573
|
hash2c = void_hash.merge(@@merchant_hash)
|
573
574
|
void_response = LitleOnlineRequest.new.void(hash2c)
|
574
|
-
assert_equal('
|
575
|
-
assert_equal('
|
575
|
+
assert_equal('001', void_response.voidResponse.response)
|
576
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
576
577
|
end
|
577
578
|
|
578
579
|
def test_6_auth
|
@@ -630,8 +631,8 @@ module LitleOnline
|
|
630
631
|
void_hash = {'litleTxnId' => sale_response.saleResponse.litleTxnId }
|
631
632
|
hash6A = void_hash.merge(@@merchant_hash)
|
632
633
|
void_response = LitleOnlineRequest.new.void(hash6A)
|
633
|
-
assert_equal('
|
634
|
-
assert_equal('
|
634
|
+
assert_equal('001', void_response.voidResponse.response)
|
635
|
+
assert_equal('Transaction Received', void_response.voidResponse.message)
|
635
636
|
end
|
636
637
|
|
637
638
|
def test_7_auth
|