VantivCnp 8.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG +139 -0
- data/CONTRIBUTORS +2 -0
- data/DESCRIPTION +5 -0
- data/LICENSE +22 -0
- data/README.md +72 -0
- data/Rakefile +89 -0
- data/SETUP.md +46 -0
- data/bin/Setup.rb +124 -0
- data/bin/sample_batch_driver.rb +123 -0
- data/bin/sample_driver.rb +49 -0
- data/lib/Communications.rb +85 -0
- data/lib/Configuration.rb +67 -0
- data/lib/EnvironmentVariables.rb +22 -0
- data/lib/LitleBatchRequest.rb +562 -0
- data/lib/LitleListeners.rb +142 -0
- data/lib/LitleOnline.rb +62 -0
- data/lib/LitleOnlineRequest.rb +297 -0
- data/lib/LitleRequest.rb +494 -0
- data/lib/LitleTransaction.rb +463 -0
- data/lib/LitleXmlMapper.rb +64 -0
- data/lib/XMLFields.rb +1869 -0
- data/lib/cacert.pem +3331 -0
- data/samples/Auth/LitleAuthReversalTransaction.rb +15 -0
- data/samples/Auth/LitleAuthorizationTransaction.rb +31 -0
- data/samples/Auth/LitlePaymentFullLifeCycle.rb +47 -0
- data/samples/Batch/AccountUpdate.rb +64 -0
- data/samples/Batch/SampleBatchDriver.rb +94 -0
- data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +30 -0
- data/samples/Capture/LitleCaptureTransaction.rb +14 -0
- data/samples/Capture/LitleForceCaptureTransaction.rb +26 -0
- data/samples/Capture/LitlePartialCapture.rb +16 -0
- data/samples/Credit/LitleCreditTransaction.rb +16 -0
- data/samples/Credit/LitleRefundTransaction.rb +29 -0
- data/samples/Other/LitleAvsTransaction.rb +34 -0
- data/samples/Other/LitleVoidTransaction.rb +18 -0
- data/samples/Paypage/FullPaypageLifeCycle.rb +74 -0
- data/samples/Run_all.rb +17 -0
- data/samples/Sale/LitleSaleTransaction.rb +29 -0
- data/samples/Sale/SampleSaleTransaction.rb +24 -0
- data/test/certification/certTest1_base.rb +945 -0
- data/test/certification/certTest2_authenhanced.rb +573 -0
- data/test/certification/certTest3_authreversal.rb +185 -0
- data/test/certification/certTest4_echeck.rb +278 -0
- data/test/certification/certTest5_token.rb +204 -0
- data/test/certification/certTest_batchAll.rb +337 -0
- data/test/certification/ts_all.rb +33 -0
- data/test/functional/test_activate.rb +100 -0
- data/test/functional/test_activateReversal.rb +56 -0
- data/test/functional/test_auth.rb +298 -0
- data/test/functional/test_authReversal.rb +69 -0
- data/test/functional/test_balanceInquiry.rb +80 -0
- data/test/functional/test_batch.rb +164 -0
- data/test/functional/test_batchStream.rb +145 -0
- data/test/functional/test_cancelSubscription.rb +55 -0
- data/test/functional/test_capture.rb +84 -0
- data/test/functional/test_captureGivenAuth.rb +235 -0
- data/test/functional/test_configuration.rb +89 -0
- data/test/functional/test_createPlan.rb +85 -0
- data/test/functional/test_credit.rb +174 -0
- data/test/functional/test_deactivate.rb +80 -0
- data/test/functional/test_deactivateReversal.rb +56 -0
- data/test/functional/test_depositReversal.rb +56 -0
- data/test/functional/test_echeckCredit.rb +134 -0
- data/test/functional/test_echeckRedeposit.rb +88 -0
- data/test/functional/test_echeckSale.rb +177 -0
- data/test/functional/test_echeckVerification.rb +127 -0
- data/test/functional/test_echeckVoid.rb +41 -0
- data/test/functional/test_forceCapture.rb +183 -0
- data/test/functional/test_litle_requests.rb +356 -0
- data/test/functional/test_load.rb +82 -0
- data/test/functional/test_loadReversal.rb +56 -0
- data/test/functional/test_override.rb +64 -0
- data/test/functional/test_refundReversal.rb +56 -0
- data/test/functional/test_sale.rb +259 -0
- data/test/functional/test_token.rb +115 -0
- data/test/functional/test_unload.rb +82 -0
- data/test/functional/test_unloadReversal.rb +56 -0
- data/test/functional/test_updateCardValidationNumOnToken.rb +43 -0
- data/test/functional/test_updatePlan.rb +58 -0
- data/test/functional/test_updateSubscription.rb +76 -0
- data/test/functional/test_xmlfields.rb +427 -0
- data/test/functional/ts_all.rb +66 -0
- data/test/unit/test_LitleAUBatch.rb +216 -0
- data/test/unit/test_LitleBatchRequest.rb +643 -0
- data/test/unit/test_LitleOnlineRequest.rb +295 -0
- data/test/unit/test_LitleRequest.rb +316 -0
- data/test/unit/test_LitleTransaction.rb +397 -0
- data/test/unit/test_activate.rb +92 -0
- data/test/unit/test_activateReversal.rb +44 -0
- data/test/unit/test_auth.rb +421 -0
- data/test/unit/test_authReversal.rb +82 -0
- data/test/unit/test_balanceInquiry.rb +52 -0
- data/test/unit/test_cancelSubscription.rb +43 -0
- data/test/unit/test_capture.rb +73 -0
- data/test/unit/test_captureGivenAuth.rb +188 -0
- data/test/unit/test_createPlan.rb +52 -0
- data/test/unit/test_credit.rb +342 -0
- data/test/unit/test_deactivate.rb +52 -0
- data/test/unit/test_deactivateReversal.rb +44 -0
- data/test/unit/test_depositReversal.rb +44 -0
- data/test/unit/test_echeckCredit.rb +71 -0
- data/test/unit/test_echeckRedeposit.rb +94 -0
- data/test/unit/test_echeckSale.rb +71 -0
- data/test/unit/test_echeckVerification.rb +71 -0
- data/test/unit/test_echeckVoid.rb +54 -0
- data/test/unit/test_forceCapture.rb +145 -0
- data/test/unit/test_load.rb +53 -0
- data/test/unit/test_loadReversal.rb +44 -0
- data/test/unit/test_refundReversal.rb +44 -0
- data/test/unit/test_sale.rb +465 -0
- data/test/unit/test_token.rb +144 -0
- data/test/unit/test_unload.rb +53 -0
- data/test/unit/test_unloadReversal.rb +44 -0
- data/test/unit/test_updateCardValidationNumOnToken.rb +80 -0
- data/test/unit/test_updatePlan.rb +45 -0
- data/test/unit/test_updateSubscription.rb +172 -0
- data/test/unit/test_xmlfields.rb +2930 -0
- data/test/unit/ts_unit.rb +65 -0
- metadata +224 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
|
|
3
|
+
#Auth Reversal
|
|
4
|
+
#litleTxnId contains the Litle Transaction Id returned on the authorization
|
|
5
|
+
reversal_info = {'litleTxnId' => '100000000000000001'}
|
|
6
|
+
reversal_response = LitleOnline::LitleOnlineRequest.new.auth_reversal(reversal_info)
|
|
7
|
+
|
|
8
|
+
#display results
|
|
9
|
+
puts "Response: " + reversal_response.authReversalResponse.response
|
|
10
|
+
puts "Message: " + reversal_response.authReversalResponse.message
|
|
11
|
+
puts "Litle Transaction ID: " + reversal_response .authReversalResponse.litleTxnId
|
|
12
|
+
|
|
13
|
+
if (!reversal_response.authReversalResponse.message.eql?'Approved')
|
|
14
|
+
raise ArgumentError, "LitleAuthReversalTransaction has not been Approved", caller
|
|
15
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
|
|
3
|
+
#Authorization
|
|
4
|
+
auth_info = {
|
|
5
|
+
'orderId' => '1',
|
|
6
|
+
'amount' => '10010',
|
|
7
|
+
'orderSource'=>'ecommerce',
|
|
8
|
+
'billToAddress'=>{
|
|
9
|
+
'name' => 'John Smith',
|
|
10
|
+
'addressLine1' => '1 Main St.',
|
|
11
|
+
'city' => 'Burlington',
|
|
12
|
+
'state' => 'MA',
|
|
13
|
+
'zip' => '01803-3747',
|
|
14
|
+
'country' => 'US'},
|
|
15
|
+
'card'=>{
|
|
16
|
+
'number' =>'4**************9',
|
|
17
|
+
'expDate' => '0112',
|
|
18
|
+
'cardValidationNum' => '349',
|
|
19
|
+
'type' => 'VI'}
|
|
20
|
+
}
|
|
21
|
+
auth_response = LitleOnline::LitleOnlineRequest.new.authorization(auth_info)
|
|
22
|
+
|
|
23
|
+
#display results
|
|
24
|
+
puts "Response: " + auth_response.authorizationResponse.response
|
|
25
|
+
puts "Message: " + auth_response.authorizationResponse.message
|
|
26
|
+
puts "Litle Transaction ID: " + auth_response.authorizationResponse.litleTxnId
|
|
27
|
+
|
|
28
|
+
if (!auth_response.authorizationResponse.message.eql?'Approved')
|
|
29
|
+
raise ArgumentError, "LitleAuthorizationTransaction has not been Approved", caller
|
|
30
|
+
end
|
|
31
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
|
|
3
|
+
#Authorization
|
|
4
|
+
#Puts a hold on the funds
|
|
5
|
+
auth_hash = {
|
|
6
|
+
'orderId' => '1',
|
|
7
|
+
'amount' => '10010',
|
|
8
|
+
'orderSource'=>'ecommerce',
|
|
9
|
+
'billToAddress'=>{
|
|
10
|
+
'name' => 'John Smith',
|
|
11
|
+
'addressLine1' => '1 Main St.',
|
|
12
|
+
'city' => 'Burlington',
|
|
13
|
+
'state' => 'MA',
|
|
14
|
+
'zip' => '01803-3747',
|
|
15
|
+
'country' => 'US'},
|
|
16
|
+
'card'=>{
|
|
17
|
+
'number' =>'4**************9',
|
|
18
|
+
'expDate' => '0112',
|
|
19
|
+
'cardValidationNum' => '349',
|
|
20
|
+
'type' => 'VI'}
|
|
21
|
+
}
|
|
22
|
+
auth_response = LitleOnline::LitleOnlineRequest.new.authorization(auth_hash)
|
|
23
|
+
|
|
24
|
+
#Capture
|
|
25
|
+
#Captures the authorization and results in money movement
|
|
26
|
+
capture_hash = {'litleTxnId' => auth_response.authorizationResponse.litleTxnId}
|
|
27
|
+
capture_response = LitleOnline::LitleOnlineRequest.new.capture(capture_hash)
|
|
28
|
+
|
|
29
|
+
if (!capture_response.captureResponse.message.eql?'Approved')
|
|
30
|
+
raise ArgumentError, "LitlePaymentFullLifeCycle's Capture Transaction has not been Approved", caller
|
|
31
|
+
end
|
|
32
|
+
#Credit
|
|
33
|
+
#Refund the customer
|
|
34
|
+
credit_hash = {'litleTxnId' => capture_response.captureResponse.litleTxnId}
|
|
35
|
+
credit_response = LitleOnline::LitleOnlineRequest.new.credit(credit_hash)
|
|
36
|
+
|
|
37
|
+
if (!credit_response.creditResponse.message.eql?'Approved')
|
|
38
|
+
raise ArgumentError, "LitlePaymentFullLifeCycle's credit Transaction has not been Approved", caller
|
|
39
|
+
end
|
|
40
|
+
#Void
|
|
41
|
+
#Cancel the refund, note that a deposit can be Voided as well
|
|
42
|
+
void_hash = {'litleTxnId' => credit_response.creditResponse.litleTxnId}
|
|
43
|
+
void_response = LitleOnline::LitleOnlineRequest.new.void(void_hash)
|
|
44
|
+
|
|
45
|
+
if (!void_response.voidResponse.message.eql?'Approved')
|
|
46
|
+
raise ArgumentError, "LitlePaymentFullLifeCycle's Void Transaction has not been Approved", caller
|
|
47
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
accountUpdateHash = {
|
|
3
|
+
'reportGroup'=>'Planets',
|
|
4
|
+
'id'=>'12345',
|
|
5
|
+
'customerId'=>'0987',
|
|
6
|
+
'orderId'=>'1234',
|
|
7
|
+
'card'=>{
|
|
8
|
+
'type'=>'VI',
|
|
9
|
+
'number' =>'4100000000000001',
|
|
10
|
+
'expDate' =>'1210'
|
|
11
|
+
}}
|
|
12
|
+
|
|
13
|
+
saleHash = {
|
|
14
|
+
'reportGroup'=>'Planets',
|
|
15
|
+
'id' => '006',
|
|
16
|
+
'orderId'=>'12344',
|
|
17
|
+
'amount'=>'6000',
|
|
18
|
+
'orderSource'=>'ecommerce',
|
|
19
|
+
'card'=>{
|
|
20
|
+
'type'=>'VI',
|
|
21
|
+
'number' =>'4100000000000001',
|
|
22
|
+
'expDate' =>'1210'
|
|
23
|
+
}}
|
|
24
|
+
|
|
25
|
+
authReversalHash = {
|
|
26
|
+
'merchantId' => '101',
|
|
27
|
+
'version'=>'8.8',
|
|
28
|
+
'reportGroup'=>'Planets',
|
|
29
|
+
'litleTxnId'=>'12345678000',
|
|
30
|
+
'amount'=>'106',
|
|
31
|
+
'payPalNotes'=>'Notes'
|
|
32
|
+
}
|
|
33
|
+
path = Dir.pwd
|
|
34
|
+
|
|
35
|
+
request = LitleOnline::LitleRequest.new({'sessionId'=>'8675309'})
|
|
36
|
+
|
|
37
|
+
request.create_new_litle_request(path)
|
|
38
|
+
puts "Created new LitleRequest at location: " + path
|
|
39
|
+
start = Time::now
|
|
40
|
+
#create five batches, each with 10 sales
|
|
41
|
+
|
|
42
|
+
batch = LitleOnline::LitleBatchRequest.new
|
|
43
|
+
batch.create_new_batch(path)
|
|
44
|
+
|
|
45
|
+
#add the same sale ten times
|
|
46
|
+
|
|
47
|
+
batch.account_update(accountUpdateHash)
|
|
48
|
+
|
|
49
|
+
#close the batch, indicating we plan to add no more transactions
|
|
50
|
+
batch.close_batch()
|
|
51
|
+
#add the batch to the LitleRequest
|
|
52
|
+
request.commit_batch(batch)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
request.finish_request
|
|
56
|
+
puts "Generated final XML markup of the LitleRequest"
|
|
57
|
+
|
|
58
|
+
#send the batch files at the given directory over sFTP
|
|
59
|
+
request.send_to_litle
|
|
60
|
+
puts "Dropped off the XML of the LitleRequest over FTP"
|
|
61
|
+
#grab the expected number of responses from the sFTP server and save them to the given path
|
|
62
|
+
request.get_responses_from_server()
|
|
63
|
+
puts "Received the LitleRequest responses from the server"
|
|
64
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
saleHash = {
|
|
3
|
+
'reportGroup'=>'Planets',
|
|
4
|
+
'id' => '006',
|
|
5
|
+
'orderId'=>'12344',
|
|
6
|
+
'amount'=>'6000',
|
|
7
|
+
'orderSource'=>'ecommerce',
|
|
8
|
+
'card'=>{
|
|
9
|
+
'type'=>'VI',
|
|
10
|
+
'number' =>'4100000000000001',
|
|
11
|
+
'expDate' =>'1210'
|
|
12
|
+
}}
|
|
13
|
+
|
|
14
|
+
updateCardHash = {
|
|
15
|
+
'merchantId' => '101',
|
|
16
|
+
'version'=>'8.8',
|
|
17
|
+
'reportGroup'=>'Planets',
|
|
18
|
+
'id'=>'12345',
|
|
19
|
+
'customerId'=>'0987',
|
|
20
|
+
'orderId'=>'12344',
|
|
21
|
+
'litleToken'=>'1233456789103801',
|
|
22
|
+
'cardValidationNum'=>'123'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
accountUpdateHash = {
|
|
26
|
+
'reportGroup'=>'Planets',
|
|
27
|
+
'id'=>'12345',
|
|
28
|
+
'customerId'=>'0987',
|
|
29
|
+
'orderId'=>'1234',
|
|
30
|
+
'card'=>{
|
|
31
|
+
'type'=>'VI',
|
|
32
|
+
'number' =>'4100000000000001',
|
|
33
|
+
'expDate' =>'1210'
|
|
34
|
+
}}
|
|
35
|
+
|
|
36
|
+
path = Dir.pwd
|
|
37
|
+
|
|
38
|
+
request = LitleOnline::LitleRequest.new({'sessionId'=>'8675309'})
|
|
39
|
+
|
|
40
|
+
request.create_new_litle_request(path)
|
|
41
|
+
puts "Created new LitleRequest at location: " + path
|
|
42
|
+
start = Time::now
|
|
43
|
+
#create five batches, each with 10 sales
|
|
44
|
+
5.times{
|
|
45
|
+
batch = LitleOnline::LitleBatchRequest.new
|
|
46
|
+
batch.create_new_batch(path)
|
|
47
|
+
|
|
48
|
+
#add the same sale ten times
|
|
49
|
+
10.times{
|
|
50
|
+
batch.sale(saleHash)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#close the batch, indicating we plan to add no more transactions
|
|
54
|
+
batch.close_batch()
|
|
55
|
+
#add the batch to the LitleRequest
|
|
56
|
+
request.commit_batch(batch)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
# puts "Finished adding batches to LitleRequest at " + request.get_path_to_batches
|
|
60
|
+
#finish the Litle Request, indicating we plan to add no more batches
|
|
61
|
+
request.finish_request
|
|
62
|
+
puts "Generated final XML markup of the LitleRequest"
|
|
63
|
+
|
|
64
|
+
#send the batch files at the given directory over sFTP
|
|
65
|
+
request.send_to_litle
|
|
66
|
+
puts "Dropped off the XML of the LitleRequest over FTP"
|
|
67
|
+
#grab the expected number of responses from the sFTP server and save them to the given path
|
|
68
|
+
request.get_responses_from_server()
|
|
69
|
+
puts "Received the LitleRequest responses from the server"
|
|
70
|
+
#process the responses from the server with a listener which applies the given block
|
|
71
|
+
start = Time::now
|
|
72
|
+
request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
|
|
73
|
+
type = transaction["type"]
|
|
74
|
+
#if we're dealing with a saleResponse (check the Litle XML Reference Guide!)
|
|
75
|
+
if(type == "saleResponse") then
|
|
76
|
+
#grab an attribute of the parent of the response
|
|
77
|
+
puts "Report Group: " + transaction["reportGroup"]
|
|
78
|
+
|
|
79
|
+
#grab some child elements of the transaction
|
|
80
|
+
puts "Litle Txn Id: " + transaction["litleTxnId"]
|
|
81
|
+
puts "Order Id: " + transaction["orderId"]
|
|
82
|
+
puts "Response: " + transaction["response"]
|
|
83
|
+
|
|
84
|
+
#grab a child element of a child element of the transation
|
|
85
|
+
puts "AVS Result: " + transaction["fraudResult"]["avsResult"]
|
|
86
|
+
puts "Token Response Message: " + transaction["tokenResponse"]["tokenMessage"]
|
|
87
|
+
if (!transaction["message"].eql?'Approved')
|
|
88
|
+
raise ArgumentError, "SampleBatchDriver has not been Approved", caller
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end})
|
|
92
|
+
stop = Time::now
|
|
93
|
+
puts "Total time: " + (stop - start).to_s
|
|
94
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
#Capture Given Auth
|
|
3
|
+
capture_given_auth_info = {
|
|
4
|
+
'merchantId' => '101',
|
|
5
|
+
'version'=>'8.8',
|
|
6
|
+
'reportGroup'=>'Planets',
|
|
7
|
+
'orderId'=>'12344',
|
|
8
|
+
'amount'=>'106',
|
|
9
|
+
'authInformation' => {
|
|
10
|
+
'authDate'=>'2002-10-09',
|
|
11
|
+
'authCode'=>'543216',
|
|
12
|
+
'authAmount'=>'12345'
|
|
13
|
+
},
|
|
14
|
+
'orderSource'=>'ecommerce',
|
|
15
|
+
'card'=>{
|
|
16
|
+
'type'=>'VI',
|
|
17
|
+
'number' =>'4100000000000001',
|
|
18
|
+
'expDate' =>'1210'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
response = LitleOnline::LitleOnlineRequest.new.capture_given_auth(capture_given_auth_info)
|
|
22
|
+
|
|
23
|
+
#display results
|
|
24
|
+
puts "Response: " + response.captureGivenAuthResponse.response
|
|
25
|
+
puts "Message: " + response.captureGivenAuthResponse.message
|
|
26
|
+
puts "Litle Transaction ID: " + response.captureGivenAuthResponse.litleTxnId
|
|
27
|
+
|
|
28
|
+
if (!response.captureGivenAuthResponse.message.eql?'Approved')
|
|
29
|
+
raise ArgumentError, "LitleCaptureGivenAuthTransaction has not been Approved", caller
|
|
30
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
#Capture
|
|
3
|
+
#litleTxnId contains the Litle Transaction Id returned on the authorization
|
|
4
|
+
capture_info = {'litleTxnId' => '100000000000000001'}
|
|
5
|
+
capture_response = LitleOnline::LitleOnlineRequest.new.capture(capture_info)
|
|
6
|
+
|
|
7
|
+
#display results
|
|
8
|
+
puts "Response: " + capture_response.captureResponse.response
|
|
9
|
+
puts "Message: " + capture_response.captureResponse.message
|
|
10
|
+
puts "Litle Transaction ID: " + capture_response .captureResponse.litleTxnId
|
|
11
|
+
|
|
12
|
+
if (!capture_response.captureResponse.message.eql?'Approved')
|
|
13
|
+
raise ArgumentError, "LitleCaptureTransaction has not been Approved", caller
|
|
14
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
#Force Capture
|
|
3
|
+
force_capture_info = {
|
|
4
|
+
'merchantId' => '101',
|
|
5
|
+
'version'=>'8.8',
|
|
6
|
+
'reportGroup'=>'Planets',
|
|
7
|
+
'litleTxnId'=>'123456',
|
|
8
|
+
'orderId'=>'12344',
|
|
9
|
+
'amount'=>'106',
|
|
10
|
+
'orderSource'=>'ecommerce',
|
|
11
|
+
'card'=>{
|
|
12
|
+
'type'=>'VI',
|
|
13
|
+
'number' =>'4100000000000001',
|
|
14
|
+
'expDate' =>'1210'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
response= LitleOnline::LitleOnlineRequest.new.force_capture(force_capture_info)
|
|
18
|
+
|
|
19
|
+
#display results
|
|
20
|
+
puts "Response: " + response.forceCaptureResponse.response
|
|
21
|
+
puts "Message: " + response.forceCaptureResponse.message
|
|
22
|
+
puts "Litle Transaction ID: " + response.forceCaptureResponse.litleTxnId
|
|
23
|
+
|
|
24
|
+
if (!response.forceCaptureResponse.message.eql?'Approved')
|
|
25
|
+
raise ArgumentError, "LitleForceCaptureTransaction has not been Approved", caller
|
|
26
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
#Partial Capture
|
|
3
|
+
#litleTxnId contains the Litle Transaction Id returned as part of the authorization
|
|
4
|
+
#submit the amount to capture which is less than the authorization amount
|
|
5
|
+
#to generate a partial capture
|
|
6
|
+
capture_info = {'litleTxnId' => '320000000000000001', 'amount' => '5005'}
|
|
7
|
+
capture_response = LitleOnline::LitleOnlineRequest.new.capture(capture_info)
|
|
8
|
+
|
|
9
|
+
#display results
|
|
10
|
+
puts "Response: " + capture_response.captureResponse.response
|
|
11
|
+
puts "Message: " + capture_response.captureResponse.message
|
|
12
|
+
puts "Litle Transaction ID: " + capture_response.captureResponse.litleTxnId
|
|
13
|
+
|
|
14
|
+
if (!capture_response.captureResponse.message.eql?'Approved')
|
|
15
|
+
raise ArgumentError, "LitlePartialCapture has not been Approved", caller
|
|
16
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
#Credit
|
|
3
|
+
#litleTxnId contains the Litle Transaction Id returned on
|
|
4
|
+
#the capture or sale transaction being credited
|
|
5
|
+
#the amount is optional, if it isn't submitted the full amount will be credited
|
|
6
|
+
credit_info = {'litleTxnId' => '100000000000000002', 'amount' => '1010'}
|
|
7
|
+
credit_response = LitleOnline::LitleOnlineRequest.new.credit(credit_info)
|
|
8
|
+
|
|
9
|
+
#display results
|
|
10
|
+
puts "Response: " + credit_response.creditResponse.response
|
|
11
|
+
puts "Message: " + credit_response.creditResponse.message
|
|
12
|
+
puts "Litle Transaction ID: " + credit_response.creditResponse.litleTxnId
|
|
13
|
+
|
|
14
|
+
if (!credit_response.creditResponse.message.eql?'Approved')
|
|
15
|
+
raise ArgumentError, "LitleCreditTransaction has not been Approved", caller
|
|
16
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
#Stand alone credit
|
|
3
|
+
credit_info = {
|
|
4
|
+
'orderId' => '1',
|
|
5
|
+
'amount' => '1010',
|
|
6
|
+
'orderSource'=>'ecommerce',
|
|
7
|
+
'billToAddress'=>{
|
|
8
|
+
'name' => 'John Smith',
|
|
9
|
+
'addressLine1' => '1 Main St.',
|
|
10
|
+
'city' => 'Burlington',
|
|
11
|
+
'state' => 'MA',
|
|
12
|
+
'zip' => '01803-3747',
|
|
13
|
+
'country' => 'US'},
|
|
14
|
+
'card'=>{
|
|
15
|
+
'number' =>'4**************9',
|
|
16
|
+
'expDate' => '0112',
|
|
17
|
+
'cardValidationNum' => '349',
|
|
18
|
+
'type' => 'VI'}
|
|
19
|
+
}
|
|
20
|
+
credit_response= LitleOnline::LitleOnlineRequest.new.credit(credit_info)
|
|
21
|
+
|
|
22
|
+
#display results
|
|
23
|
+
puts "Response: " + credit_response.creditResponse.response
|
|
24
|
+
puts "Message: " + credit_response.creditResponse.response
|
|
25
|
+
puts "Litle Transaction ID: " + credit_response.creditResponse.litleTxnId
|
|
26
|
+
|
|
27
|
+
if (!credit_response.creditResponse.message.eql?'Approved')
|
|
28
|
+
raise ArgumentError, "LitleRefundTransaction has not been Approved", caller
|
|
29
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
@@merchant_hash = {'reportGroup'=>'Planets','id'=>'321','customerId'=>'123',
|
|
3
|
+
'merchantId'=>'101'
|
|
4
|
+
}
|
|
5
|
+
#AVS Only
|
|
6
|
+
auth_info = {
|
|
7
|
+
'orderId' => '1',
|
|
8
|
+
'amount' => '10010',
|
|
9
|
+
'orderSource'=>'ecommerce',
|
|
10
|
+
'billToAddress'=>{
|
|
11
|
+
'name' => 'John Smith',
|
|
12
|
+
'addressLine1' => '1 Main St.',
|
|
13
|
+
'city' => 'Burlington',
|
|
14
|
+
'state' => 'MA',
|
|
15
|
+
'zip' => '01803-3747',
|
|
16
|
+
'country' => 'US'},
|
|
17
|
+
'card'=>{
|
|
18
|
+
'number' =>'4457010000000009',
|
|
19
|
+
'expDate' => '0112',
|
|
20
|
+
'cardValidationNum' => '349',
|
|
21
|
+
'type' => 'VI'}
|
|
22
|
+
}
|
|
23
|
+
hash = auth_info.merge(@@merchant_hash)
|
|
24
|
+
auth_response = LitleOnline::LitleOnlineRequest.new.authorization(hash)
|
|
25
|
+
|
|
26
|
+
#display results
|
|
27
|
+
puts "Response: " + auth_response.authorizationResponse.response
|
|
28
|
+
puts "Message: " + auth_response.authorizationResponse.message
|
|
29
|
+
puts "Litle Transaction ID: " + auth_response.authorizationResponse.litleTxnId
|
|
30
|
+
puts "AVS Match: " + auth_response.authorizationResponse.fraudResult.avsResult
|
|
31
|
+
|
|
32
|
+
if (!auth_response.authorizationResponse.message.eql?'Approved')
|
|
33
|
+
raise ArgumentError, "LitleAvsTransaction has not been Approved", caller
|
|
34
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require_relative '../../lib/LitleOnline'
|
|
2
|
+
|
|
3
|
+
#Void
|
|
4
|
+
void_info = {
|
|
5
|
+
#litleTxnId contains the Litle Transaction Id returned on the deposit/refund
|
|
6
|
+
'litleTxnId' => '100000000000000001',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
response = LitleOnline::LitleOnlineRequest.new.void(void_info)
|
|
10
|
+
|
|
11
|
+
#display results
|
|
12
|
+
puts "Response: " + response.voidResponse.response
|
|
13
|
+
puts "Message: " + response.voidResponse.message
|
|
14
|
+
puts "Litle Transaction ID: " + response.voidResponse.litleTxnId
|
|
15
|
+
|
|
16
|
+
if (!response.voidResponse.message.eql?'Approved')
|
|
17
|
+
raise ArgumentError, "LitleVoidTransaction has not been Approved", caller
|
|
18
|
+
end
|