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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7208945e0ed36984ca3dce4bb08fa204f3bfc13b9c610eea4fb6394e60537059
|
4
|
+
data.tar.gz: 6eff86ac54c6e26e845ab636ae0b865a3682585856cad5b7c6ac7b9d871ceda0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 12e058a60c489b8c76d490b1b433eb9c1b16c1f3f1294c1aacf29afef20ca0dd96e573f0043da92c2bda79efb4261b57d05c85da1a8536664f251f5039ee25db
|
7
|
+
data.tar.gz: 66e5c5996e7e85131939189d1baf21007b7ea807f2782c4a03598c61ad7e0767e5a30ccd0fe1bf65a8cd2705fe52cc4d1bd0cd8d9f3907b80d7e220ed44bfff8
|
data/CHANGELOG
CHANGED
@@ -1,26 +1,33 @@
|
|
1
1
|
= LitleOnline CHANGELOG
|
2
|
+
==Version 11.4.0 (March 28, 2018)
|
3
|
+
* Feature: FastAccessFunding support
|
2
4
|
|
3
|
-
==Version
|
4
|
-
*Feature:
|
5
|
+
==Version 11.0.1 (March 27, 2017)
|
6
|
+
* Feature: added PGP encryption support
|
5
7
|
|
6
|
-
==Version
|
7
|
-
*Feature:
|
8
|
-
*Feature:
|
9
|
-
*Feature:
|
8
|
+
== Version 11.0 (April 12, 2017)
|
9
|
+
* Feature: implement Vantiv eCommerce XMLv11.0
|
10
|
+
* Feature: SEPA Support
|
11
|
+
* Feature: iDEAL support
|
12
|
+
* Feature: new giftCard transactions
|
13
|
+
* Feature: giroPay support
|
14
|
+
* Feature: Network Enhancements mandates
|
15
|
+
* Feature: add support for raw network response
|
16
|
+
* Bug fix: specify char encoding in HTTP header
|
10
17
|
|
11
|
-
==Version 9.10.0
|
12
|
-
* Feature: add androidpay
|
13
|
-
* Feature: add network enhancements for original txn Id and original amount
|
14
|
-
* Feature: add processingType
|
15
|
-
* Feature: add cardSuffix on responses
|
16
|
-
* Feature: add Card Pin Support
|
17
|
-
* Feature: add Wallet support
|
18
18
|
|
19
|
-
==Version
|
20
|
-
*
|
19
|
+
==Version 10.1.1
|
20
|
+
* Feature: support standalone FraudCheck transaction type
|
21
|
+
|
22
|
+
==Version 10.1
|
23
|
+
* Feature: Support for the following new transactions:
|
24
|
+
FundingInstructionVoid and QueryTransaction
|
25
|
+
* Feature: 'id' field should be added to all incoming transaction types
|
26
|
+
* Feature: Constraints were added to ApplepayType and ApplyPayHeaderType
|
27
|
+
* Feature: Wallet class was added and new enum types were introduced
|
21
28
|
|
22
29
|
==Version 9.3.2
|
23
|
-
|
30
|
+
HTTP timeout set to 500ms
|
24
31
|
|
25
32
|
==Version 9.3.1 (March 9, 2015)
|
26
33
|
*Feature: PFIF instruction transaction support was added
|
@@ -39,7 +46,6 @@
|
|
39
46
|
== version 8.25.1(July 18,2014)
|
40
47
|
* Feature : Added Env variables to setup ruby config
|
41
48
|
|
42
|
-
|
43
49
|
== version 8.25.0 (March 17, 2014)
|
44
50
|
* Feature: Added support for ROAM: Authorization, ForceCapture, CaptureGivenAuth, Sale, Credit
|
45
51
|
|
data/CONTRIBUTORS
CHANGED
File without changes
|
data/DESCRIPTION
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Vantiv eCommerce Ruby SDK created for version
|
1
|
+
Vantiv eCommerce Online Ruby SDK created for version 11.0 of Vantiv eCommerce XML format, see the XSD schema for specific fields that are supported by this format.
|
2
2
|
|
3
3
|
This gem contains an application interface in the Ruby programming language created by Vantiv eCommerce.
|
4
4
|
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,9 @@ About Vantiv eCommerce
|
|
9
9
|
|
10
10
|
About this SDK
|
11
11
|
--------------
|
12
|
-
|
12
|
+
##### No major updates are planned for this repository. SDK Version 12 and above can be found here: [cnp-sdk-for-ruby](https://github.com/Vantiv/cnp-sdk-for-ruby)
|
13
|
+
|
14
|
+
The Vantiv eCommerce Ruby SDK is a Ruby implementation of the [Vantiv eCommerce](http://www.vantiv.com). XML API. This SDK was created to make it as easy as possible to connect process your payments with Vantiv eCommerce. This SDK utilizes the HTTPS protocol to securely connect to Vantiv eCommerce. Using the SDK requires coordination with the Vantiv eCommerce team in order to be provided with credentials for accessing our systems.
|
13
15
|
|
14
16
|
Each Ruby SDK release supports all of the functionality present in the associated Vantiv eCommerce XML version (e.g., SDK v9.3.2 supports Vantiv eCommerce XML v9.3). Please see the online copy of our XSD for Vantiv eCommerce XML to get more details on what the Vantiv eCommerce payments engine supports.
|
15
17
|
|
@@ -19,7 +21,7 @@ See LICENSE file for details on using this software.
|
|
19
21
|
|
20
22
|
Source Code available from : https://github.com/LitleCo/litle-sdk-for-ruby
|
21
23
|
|
22
|
-
Please contact [Vantiv eCommerce](http://www.vantiv.com) to receive valid merchant credentials in order to run tests successfully or if you require assistance in any way.
|
24
|
+
Please contact [Vantiv eCommerce](http://www.vantiv.com) to receive valid merchant credentials in order to run tests successfully or if you require assistance in any way. We are reachable at sdksupport@vantiv.com
|
23
25
|
|
24
26
|
Setup
|
25
27
|
-----
|
@@ -62,7 +64,7 @@ puts "Message: "+ response.message
|
|
62
64
|
puts "Litle Transaction ID: "+ response.saleResponse.litleTxnId
|
63
65
|
```
|
64
66
|
|
65
|
-
3) Next run this file using ruby. You should see the following result provided you have connectivity to the
|
67
|
+
3) Next run this file using ruby. You should see the following result provided you have connectivity to the Litle certification environment. You will see an HTTP error if you don't have access to the Litle URL
|
66
68
|
|
67
69
|
Message: Valid Format
|
68
70
|
Litle Transaction ID: <your-numeric-litle-txn-id>
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2017 Vantiv eCommerce
|
1
|
+
# Copyright (c) 2017 Vantiv eCommerce.
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person
|
4
4
|
# obtaining a copy of this software and associated documentation
|
@@ -28,14 +28,14 @@ require 'rake/clean'
|
|
28
28
|
spec = Gem::Specification.new do |s|
|
29
29
|
FileUtils.rm_rf('pkg')
|
30
30
|
s.name = 'CnpOnline'
|
31
|
-
s.summary = 'Ruby SDK produced by Vantiv eCommerce for transaction processing using Vantiv eCommerce XML format
|
31
|
+
s.summary = 'Ruby SDK produced by Vantiv eCommerce for transaction processing using Vantiv eCommerce XML format v11.0'
|
32
32
|
s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
|
33
33
|
s.requirements =
|
34
34
|
['Contact sdksupport@vantiv.com for more information']
|
35
|
-
s.version = '
|
36
|
-
s.author = 'Vantiv eCommerce'
|
35
|
+
s.version = '11.4.0'
|
36
|
+
s.author = 'Vantiv - eCommerce'
|
37
37
|
s.email = 'sdksupport@vantiv.com'
|
38
|
-
s.homepage = '
|
38
|
+
s.homepage = 'https://developer.vantiv.com/community/ecommerce/pages/sdks#jive_content_id_Ruby_SDK'
|
39
39
|
s.platform = Gem::Platform::RUBY
|
40
40
|
s.required_ruby_version = '>=2.2.0'
|
41
41
|
s.files = Dir['**/**']
|
data/Rakefile~
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2017 Vantiv eCommerce
|
1
|
+
# Copyright (c) 2017 Vantiv eCommerce.
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person
|
4
4
|
# obtaining a copy of this software and associated documentation
|
@@ -28,14 +28,14 @@ require 'rake/clean'
|
|
28
28
|
spec = Gem::Specification.new do |s|
|
29
29
|
FileUtils.rm_rf('pkg')
|
30
30
|
s.name = 'LitleOnline'
|
31
|
-
s.summary = 'Ruby SDK produced by Vantiv eCommerce for transaction processing using Vantiv eCommerce XML format
|
31
|
+
s.summary = 'Ruby SDK produced by Vantiv eCommerce for transaction processing using Vantiv eCommerce XML format v11.0'
|
32
32
|
s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
|
33
33
|
s.requirements =
|
34
34
|
['Contact sdksupport@vantiv.com for more information']
|
35
|
-
s.version = '
|
36
|
-
s.author = 'Vantiv eCommerce'
|
35
|
+
s.version = '11.4.0'
|
36
|
+
s.author = 'Vantiv - eCommerce'
|
37
37
|
s.email = 'sdksupport@vantiv.com'
|
38
|
-
s.homepage = '
|
38
|
+
s.homepage = 'https://developer.vantiv.com/community/ecommerce/pages/sdks#jive_content_id_Ruby_SDK'
|
39
39
|
s.platform = Gem::Platform::RUBY
|
40
40
|
s.required_ruby_version = '>=2.2.0'
|
41
41
|
s.files = Dir['**/**']
|
data/SETUP.md
CHANGED
@@ -14,7 +14,7 @@ please input your user name:
|
|
14
14
|
test_user
|
15
15
|
please input your password:
|
16
16
|
test_password
|
17
|
-
Please choose
|
17
|
+
Please choose Vantiv eCommerce url from the following list (example: 'cert') or directly input another URL:
|
18
18
|
cert => https://cert.litle.com/vap/communicator/online
|
19
19
|
precert => https://precert.litle.com/vap/communicator/online
|
20
20
|
production1 => https://payments.litle.com/vap/communicator/online
|
@@ -24,14 +24,14 @@ Please input the proxy address, if no proxy hit enter key:
|
|
24
24
|
|
25
25
|
Please input the proxy port, if no proxy hit enter key:
|
26
26
|
|
27
|
-
The
|
27
|
+
The Vantiv eCommerce configuration file has been generated, the file is located at: /<your-home-directory>/.litle_SDK_config.yml
|
28
28
|
```
|
29
29
|
|
30
30
|
Modifying your configuration
|
31
31
|
----------------------------
|
32
32
|
You may change the configuration values at anytime by running Setup.rb again, or simpy opening the configuration file directly in the editor of your choice and changing the appropriate fields.
|
33
33
|
|
34
|
-
Changing the location of the
|
34
|
+
Changing the location of the Litle configuration file:
|
35
35
|
------------------------------------------------------
|
36
36
|
NOTICE you can set the environment variable $LITLE_CONFIG_DIR to locate your configuration file in a location other than the $HOME Directory, the the file will reside in $LITLE_CONFIG_DIR/.litle_SDK_config.yml
|
37
37
|
|
data/bin/Setup.rb
CHANGED
@@ -1,51 +1,52 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
3
|
+
=begin
|
4
|
+
Copyright (c) 2017 Vantiv eCommerce
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person
|
7
|
+
obtaining a copy of this software and associated documentation
|
8
|
+
files (the "Software"), to deal in the Software without
|
9
|
+
restriction, including without limitation the rights to use,
|
10
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the
|
12
|
+
Software is furnished to do so, subject to the following
|
13
|
+
conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be
|
16
|
+
included in all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
20
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
22
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
23
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
24
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
25
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
26
|
+
=end
|
25
27
|
|
26
28
|
# make setup file executable
|
27
29
|
|
30
|
+
require 'iostreams'
|
31
|
+
|
28
32
|
#
|
29
33
|
# Configuration generation for URL and credentials
|
30
34
|
#
|
31
35
|
class Setup
|
32
36
|
attr_reader :handle, :path
|
33
37
|
def initialize(filename)
|
34
|
-
@handle = File.new(filename, File::CREAT
|
38
|
+
@handle = File.new(filename, File::CREAT|File::TRUNC|File::RDWR, 0600)
|
35
39
|
File.open(filename, 'w') do |f|
|
36
40
|
puts 'Welcome to Vantiv eCommerce Ruby_SDK'
|
37
41
|
puts 'Please input your user name:'
|
38
|
-
f.puts
|
42
|
+
f.puts 'user: '+ gets
|
39
43
|
puts 'Please input your password:'
|
40
|
-
f.puts
|
44
|
+
f.puts 'password: ' + gets
|
41
45
|
puts 'Please input your merchantId:'
|
42
|
-
|
43
46
|
f.puts 'currency_merchant_map:'
|
44
47
|
f.puts ' DEFAULT: ' + gets
|
45
48
|
f.puts "default_report_group: 'Default Report Group'"
|
46
|
-
|
47
|
-
puts "Please choose Vantiv eCommerce url from the following list
|
48
|
-
(example: 'prelive') or directly input another URL:
|
49
|
+
puts "Please choose Vantiv eCommerce url from the following list (example: 'prelive') or directly input another URL:
|
49
50
|
sandbox => https://www.testvantivcnp.com/sandbox/communicator/online
|
50
51
|
prelive => https://payments.vantivprelive.com/vap/communicator/online
|
51
52
|
postlive => https://payments.vantivpostlive.com/vap/communicator/online
|
@@ -55,9 +56,9 @@ transact_postlive => https://transact.vantivpostlive.com/vap/communicator/online
|
|
55
56
|
transact_production => https://transact.vantivcnp.com/vap/communicator/online"
|
56
57
|
f.puts 'url: ' + Setup.choice(gets)
|
57
58
|
puts 'Please input the proxy address, if no proxy hit enter key: '
|
58
|
-
f.puts
|
59
|
+
f.puts 'proxy_addr: ' + gets
|
59
60
|
puts 'Please input the proxy port, if no proxy hit enter key: '
|
60
|
-
f.puts
|
61
|
+
f.puts 'proxy_port: ' + gets
|
61
62
|
puts 'Please input your sFTP username for batch processing; if no sFTP, hit enter key: '
|
62
63
|
f.puts 'sftp_username: ' + gets
|
63
64
|
puts 'Please input your sFTP password for batch processing; if no sFTP, hit enter key: '
|
@@ -68,10 +69,26 @@ transact_production => https://transact.vantivcnp.com/vap/communicator/online"
|
|
68
69
|
f.puts 'fast_url: ' + gets
|
69
70
|
puts 'Please input your port for fast batch processing; if no fast batch, hit enter key: '
|
70
71
|
f.puts 'fast_port: ' + gets
|
71
|
-
|
72
72
|
f.puts 'printxml: false'
|
73
73
|
# default http timeout set to 500 ms
|
74
74
|
f.puts 'timeout: 500'
|
75
|
+
puts 'Use PGP encryption for sending batch files through sftp (true/false) (No encryption by default): '
|
76
|
+
useEncryption = (gets.chomp() == 'true')
|
77
|
+
f.puts "useEncryption: #{useEncryption}"
|
78
|
+
if useEncryption
|
79
|
+
puts "Path to Vantiv's Public key (For encryption of batch files): "
|
80
|
+
puts "Note: The key from the provided file path will be added to your gpg keyring. If you do not have gpg2 installed, please install it before proceeding"
|
81
|
+
key_path = gets.chomp()
|
82
|
+
key = File.read(key_path)
|
83
|
+
key_info = IOStreams::Pgp.import(key: key)
|
84
|
+
if key_info.empty?
|
85
|
+
key_info = IOStreams::Pgp.key_info(key: key)
|
86
|
+
end
|
87
|
+
key_id = key_info[0][:key_id]
|
88
|
+
f.puts "vantivPublicKeyID: " + key_id
|
89
|
+
puts "Enter passphrase of your merchant key for decrypting responses: "
|
90
|
+
f.puts "passphrase: " + gets
|
91
|
+
end
|
75
92
|
end
|
76
93
|
end
|
77
94
|
|
@@ -79,10 +96,10 @@ transact_production => https://transact.vantivcnp.com/vap/communicator/online"
|
|
79
96
|
@handle.close
|
80
97
|
end
|
81
98
|
|
82
|
-
def
|
99
|
+
def Setup.choice(litle_env)
|
83
100
|
litle_online_ctx = 'vap/communicator/online'
|
84
101
|
if litle_env == "sandbox\n"
|
85
|
-
return 'https://www.testvantivcnp.com/sandbox/
|
102
|
+
return 'https://www.testvantivcnp.com/sandbox/communicator/online'
|
86
103
|
elsif litle_env == "prelive\n"
|
87
104
|
return 'https://payments.vantivprelive.com/' + litle_online_ctx
|
88
105
|
elsif litle_env == "postlive\n"
|
@@ -90,9 +107,9 @@ transact_production => https://transact.vantivcnp.com/vap/communicator/online"
|
|
90
107
|
elsif litle_env == "production\n"
|
91
108
|
return 'https://payments.vantivcnp.com/' + litle_online_ctx
|
92
109
|
elsif litle_env == "transact_production\n"
|
93
|
-
return 'https://transact.litle.com/' + litle_online_ctx
|
94
|
-
elsif litle_env == "transact_prelive\n"
|
95
110
|
return 'https://transact.vantivcnp.com/' + litle_online_ctx
|
111
|
+
elsif litle_env == "transact_prelive\n"
|
112
|
+
return 'https://transact.vantivprelive.com/' + litle_online_ctx
|
96
113
|
elsif litle_env == "transact_postlive\n"
|
97
114
|
return 'https://transact.vantivpostlive.com/' + litle_online_ctx
|
98
115
|
else
|
@@ -108,11 +125,11 @@ end
|
|
108
125
|
#
|
109
126
|
|
110
127
|
# make the config.yml file in the LITLE_CONFIG_DIR directory or HOME directory
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
128
|
+
if !(ENV['LITLE_CONFIG_DIR'].nil?)
|
129
|
+
path = ENV['LITLE_CONFIG_DIR']
|
130
|
+
else
|
131
|
+
path = ENV['HOME']
|
132
|
+
end
|
116
133
|
|
117
134
|
# make the config.yml file hidden
|
118
135
|
# create a config file contain all the configuration data
|
@@ -123,3 +140,4 @@ f = Setup.new(config_file)
|
|
123
140
|
@path = File.expand_path(config_file)
|
124
141
|
puts 'The Vantiv eCommerce configuration file has been generated, the file is located at: ' + @path
|
125
142
|
f.finished
|
143
|
+
|
data/lib/Communications.rb
CHANGED
@@ -71,9 +71,9 @@ end
|
|
71
71
|
The round-trip time of an Authorization can be broken down into three parts, as follows:
|
72
72
|
1. Transmission time (across the internet) to Vantiv eCommerce and back to the merchant
|
73
73
|
2. Processing time by the authorization provider
|
74
|
-
3. Processing time by
|
75
|
-
Under normal operating circumstances, the transmission time to and from
|
76
|
-
and processing overhead by
|
74
|
+
3. Processing time by Litle
|
75
|
+
Under normal operating circumstances, the transmission time to and from Litle does not exceed 0.6 seconds
|
76
|
+
and processing overhead by Litle occurs in 0.1 seconds.
|
77
77
|
Typically, the processing time by the card association or authorization provider can take between 0.5 and 3 seconds,
|
78
78
|
but some percentage of transactions may take significantly longer.
|
79
79
|
|
data/lib/Configuration.rb
CHANGED
@@ -1,29 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
-
=end
|
1
|
+
# Copyright (c) 2017 Vantiv eCommerce
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person
|
4
|
+
# obtaining a copy of this software and associated documentation
|
5
|
+
# files (the "Software"), to deal in the Software without
|
6
|
+
# restriction, including without limitation the rights to use,
|
7
|
+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the
|
9
|
+
# Software is furnished to do so, subject to the following
|
10
|
+
# conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
# OTHER DEALINGS IN THE SOFTWARE.
|
25
23
|
|
26
24
|
require 'yaml'
|
25
|
+
require_relative 'EnvironmentVariables'
|
27
26
|
#
|
28
27
|
# Loads the configuration from a file
|
29
28
|
#
|
@@ -35,33 +34,41 @@ module LitleOnline
|
|
35
34
|
end
|
36
35
|
|
37
36
|
def config
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
else
|
48
|
-
environments = EnvironmentVariables.new
|
49
|
-
datas={}
|
50
|
-
environments.instance_variables.each {|var| datas[var.to_s.delete("@")] = environments.instance_variable_get(var)}
|
51
|
-
end
|
52
|
-
datas.each {|key, value| setENV(key, datas)}
|
53
|
-
return datas
|
54
|
-
rescue
|
55
|
-
return {}
|
37
|
+
if !ENV['LITLE_CONFIG_DIR'].nil?
|
38
|
+
config_file = ENV['LITLE_CONFIG_DIR'] + '/.litle_SDK_config.yml'
|
39
|
+
else
|
40
|
+
config_file = ENV['HOME'] + '/.litle_SDK_config.yml'
|
41
|
+
end
|
42
|
+
datas = {}
|
43
|
+
# if Env variable exist, then just override the data from config file
|
44
|
+
if File.exist?(config_file)
|
45
|
+
datas = YAML.load_file(config_file)
|
56
46
|
end
|
57
47
|
|
48
|
+
# fill in fields missing in config from run time environment
|
49
|
+
environments = EnvironmentVariables.new
|
50
|
+
environments.instance_variables.each do |var|
|
51
|
+
if datas[var.to_s.delete('@')].nil?
|
52
|
+
datas[var.to_s.delete('@')] = environments.instance_variable_get(var)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
datas.each { |key, _value| setENV(key, datas) }
|
56
|
+
return datas
|
57
|
+
rescue
|
58
|
+
return {}
|
58
59
|
end
|
59
60
|
|
60
61
|
def setENV(key, datas)
|
61
|
-
|
62
|
-
|
62
|
+
val = ENV['litle_' + key]
|
63
|
+
if !val.nil?
|
64
|
+
if val == 'true'
|
65
|
+
datas[key] = true
|
66
|
+
elsif val == 'false'
|
67
|
+
datas[key] = false
|
68
|
+
else
|
69
|
+
datas[key] = val
|
70
|
+
end
|
63
71
|
end
|
64
72
|
end
|
65
73
|
end
|
66
|
-
|
67
74
|
end
|