CnpOnline 9.14.0 → 11.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +7 -7
  2. data/CHANGELOG +23 -17
  3. data/CONTRIBUTORS +0 -0
  4. data/DESCRIPTION +1 -1
  5. data/LICENSE +1 -1
  6. data/README.md +5 -3
  7. data/Rakefile +5 -5
  8. data/Rakefile~ +5 -5
  9. data/SETUP.md +3 -3
  10. data/bin/Setup.rb +59 -41
  11. data/lib/Communications.rb +3 -3
  12. data/lib/Configuration.rb +52 -45
  13. data/lib/EnvironmentVariables.rb +5 -1
  14. data/lib/LitleBatchRequest.rb +72 -7
  15. data/lib/LitleListeners.rb +17 -1
  16. data/lib/LitleOnline.rb +3 -4
  17. data/lib/LitleOnlineRequest.rb +37 -7
  18. data/lib/LitleRequest.rb +315 -186
  19. data/lib/LitleTransaction.rb +212 -85
  20. data/lib/LitleXmlMapper.rb +4 -2
  21. data/lib/XMLFields.rb +384 -171
  22. data/lib/cacert.pem +0 -0
  23. data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
  24. data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
  25. data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
  26. data/samples/Batch/AccountUpdate.rb +1 -0
  27. data/samples/Batch/SampleBatchDriver.rb +2 -1
  28. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
  29. data/samples/Capture/LitleCaptureTransaction.rb +2 -2
  30. data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
  31. data/samples/Capture/LitlePartialCapture.rb +3 -3
  32. data/samples/Credit/LitleCreditTransaction.rb +2 -2
  33. data/samples/Credit/LitleRefundTransaction.rb +2 -1
  34. data/samples/Other/LitleAvsTransaction.rb +2 -1
  35. data/samples/Other/LitleVoidTransaction.rb +2 -1
  36. data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
  37. data/samples/Run_all.rb +0 -0
  38. data/samples/Sale/LitleSaleTransaction.rb +2 -1
  39. data/samples/Sale/SampleSaleTransaction.rb +2 -1
  40. data/test/certification/certTest1_base.rb +52 -53
  41. data/test/certification/certTest2_authenhanced.rb +24 -25
  42. data/test/certification/certTest3_authreversal.rb +23 -26
  43. data/test/certification/certTest4_echeck.rb +18 -32
  44. data/test/certification/certTest5_token.rb +105 -106
  45. data/test/certification/certTest_batchAll.rb +47 -15
  46. data/test/functional/test_activate.rb +32 -4
  47. data/test/functional/test_activateReversal.rb +18 -5
  48. data/test/functional/test_auth.rb +94 -48
  49. data/test/functional/test_authReversal.rb +4 -1
  50. data/test/functional/test_balanceInquiry.rb +28 -3
  51. data/test/functional/test_batchStream.rb +2 -4
  52. data/test/functional/test_cancelSubscription.rb +2 -2
  53. data/test/functional/test_capture.rb +21 -14
  54. data/test/functional/test_captureGivenAuth.rb +15 -6
  55. data/test/functional/test_createPlan.rb +1 -1
  56. data/test/functional/test_credit.rb +14 -5
  57. data/test/functional/test_deactivate.rb +26 -3
  58. data/test/functional/test_deactivateReversal.rb +18 -5
  59. data/test/functional/test_depositReversal.rb +31 -19
  60. data/test/functional/test_echeckCredit.rb +34 -6
  61. data/test/functional/test_echeckRedeposit.rb +29 -2
  62. data/test/functional/test_echeckSale.rb +68 -11
  63. data/test/functional/test_echeckVerification.rb +32 -7
  64. data/test/functional/test_echeckVoid.rb +2 -1
  65. data/test/functional/test_forceCapture.rb +20 -6
  66. data/test/functional/test_fraudCheck.rb +3 -5
  67. data/test/functional/test_giftCardAuthReversal.rb +72 -0
  68. data/test/functional/test_giftCardCapture.rb +72 -0
  69. data/test/functional/test_giftCardCredit.rb +69 -0
  70. data/test/functional/test_litle_requests.rb +3 -6
  71. data/test/functional/test_load.rb +27 -3
  72. data/test/functional/test_loadReversal.rb +18 -5
  73. data/test/functional/test_override.rb +7 -3
  74. data/test/functional/test_pgp_litle_requests.rb +294 -0
  75. data/test/functional/test_queryTransaction.rb +152 -0
  76. data/test/functional/test_refundReversal.rb +18 -5
  77. data/test/functional/test_sale.rb +122 -159
  78. data/test/functional/test_token.rb +17 -11
  79. data/test/functional/test_unload.rb +27 -3
  80. data/test/functional/test_unloadReversal.rb +18 -5
  81. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -0
  82. data/test/functional/test_updatePlan.rb +2 -1
  83. data/test/functional/test_updateSubscription.rb +3 -1
  84. data/test/functional/test_wallet.rb +74 -0
  85. data/test/functional/test_xmlfields.rb +22 -3
  86. data/test/functional/ts_all.rb +2 -0
  87. data/test/unit/test_LitleBatchRequest.rb +53 -5
  88. data/test/unit/test_LitleOnlineRequest.rb +5 -30
  89. data/test/unit/test_LitleRequest.rb +7 -6
  90. data/test/unit/test_LitleTransaction.rb +34 -5
  91. data/test/unit/test_LitleXmlMapper.rb +3 -0
  92. data/test/unit/test_activate.rb +22 -2
  93. data/test/unit/test_activateReversal.rb +15 -3
  94. data/test/unit/test_auth.rb +11 -9
  95. data/test/unit/test_balanceInquiry.rb +2 -2
  96. data/test/unit/test_capture.rb +2 -2
  97. data/test/unit/test_captureGivenAuth.rb +21 -1
  98. data/test/unit/test_credit.rb +1 -1
  99. data/test/unit/test_deactivate.rb +19 -0
  100. data/test/unit/test_deactivateReversal.rb +15 -3
  101. data/test/unit/test_depositReversal.rb +17 -5
  102. data/test/unit/test_echeckCredit.rb +19 -0
  103. data/test/unit/test_echeckRedeposit.rb +15 -0
  104. data/test/unit/test_echeckSale.rb +20 -1
  105. data/test/unit/test_echeckVerification.rb +6 -3
  106. data/test/unit/test_forceCapture.rb +1 -1
  107. data/test/unit/test_giftCardAuthReversal.rb +58 -0
  108. data/test/{functional/test_utf8.rb → unit/test_giftCardCapture.rb} +25 -12
  109. data/test/unit/test_giftCardCredit.rb +57 -0
  110. data/test/unit/test_load.rb +2 -2
  111. data/test/unit/test_loadReversal.rb +15 -3
  112. data/test/unit/test_pgp_LitleRequest +139 -0
  113. data/test/unit/test_queryTransaction.rb +105 -0
  114. data/test/unit/test_refundReversal.rb +15 -3
  115. data/test/unit/test_sale.rb +23 -3
  116. data/test/unit/test_token.rb +24 -20
  117. data/test/unit/test_unload.rb +2 -2
  118. data/test/unit/test_unloadReversal.rb +15 -3
  119. data/test/unit/test_wallet.rb +262 -0
  120. data/test/unit/ts_unit.rb +2 -1
  121. metadata +81 -100
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA256:
3
- metadata.gz: e28fa5a2df7b0a8309b102abd5bd9fd4bd5874959be9461d07b895f056d588fd
4
- data.tar.gz: 9f45274bc91b59db75c4103231857f39232ea168da1ad1e64f84740b09b8d976
5
- SHA512:
6
- metadata.gz: deec6fa2301e4b984234534f0833d72351f8ef7772df1c5242f1307c2aa00858722ebc4e19709859047dfead257eab37e492af61156e38d74caf3bfacae612cc
7
- data.tar.gz: 80761e4501d6730f2b499d9c0d01336426e7a92b0b09d58a7e1c42bde552fb524bff8af19a5ea276289053f8c59fc64287cd8b626d261d6dcf2d2f566ec5fc25
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 9.14.0 (March 29, 2018)
4
- *Feature: add Girotype and SofortType support
5
+ ==Version 11.0.1 (March 27, 2017)
6
+ * Feature: added PGP encryption support
5
7
 
6
- ==Version 9.12.0
7
- *Feature: updated to use XML v9.12
8
- *Feature: added SEPA Direct Debit transaction support
9
- *Feature: added iDeal (Direct Debit) transaction support
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 9.3.3
20
- * add fraudCheck transaction type
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
- * HTTP timeout set to 500ms
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
 
File without changes
@@ -1,4 +1,4 @@
1
- Vantiv eCommerce Ruby SDK created for version 9.10 of Vantiv eCommerce XML format, see the XSD schema for specific fields that are supported by this format.
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
@@ -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
data/README.md CHANGED
@@ -9,7 +9,9 @@ About Vantiv eCommerce
9
9
 
10
10
  About this SDK
11
11
  --------------
12
- 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.
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. We are reachable at sdksupport@Vantiv.com
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 Vantiv eCommerce certification environment. You will see an HTTP error if you don't have access to the Vantiv eCommerce URL
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 v9.12'
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 = '9.14.0'
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 = 'http://www.vantiv.com/developers'
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 v9.12'
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 = '9.14.0'
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 = 'http://www.vantiv.com/developers'
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 Litle url from the following list (example: 'cert') or directly input another URL:
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 Litle configuration file has been generated, the file is located at: /<your-home-directory>/.litle_SDK_config.yml
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 Vantiv eCommerce configuration file:
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
 
@@ -1,51 +1,52 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Copyright (c) 2017 Vantiv eCommerce
4
- #
5
- # Permission is hereby granted, free of charge, to any person
6
- # obtaining a copy of this software and associated documentation
7
- # files (the "Software"), to deal in the Software without
8
- # restriction, including without limitation the rights to use,
9
- # copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the
11
- # Software is furnished to do so, subject to the following
12
- # conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be
15
- # included in all copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
- # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
- # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
- # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
- # OTHER DEALINGS IN THE SOFTWARE.
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 | File::TRUNC | File::RDWR, 0o600)
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 'user: ' + gets
42
+ f.puts 'user: '+ gets
39
43
  puts 'Please input your password:'
40
- f.puts 'password: ' + gets
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 'proxy_addr: ' + gets
59
+ f.puts 'proxy_addr: ' + gets
59
60
  puts 'Please input the proxy port, if no proxy hit enter key: '
60
- f.puts 'proxy_port: ' + gets
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 self.choice(litle_env)
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/new/sandbox/communicator/online'
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
- path = if !ENV['LITLE_CONFIG_DIR'].nil?
112
- ENV['LITLE_CONFIG_DIR']
113
- else
114
- ENV['HOME']
115
- end
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
+
@@ -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 Vantiv eCommerce
75
- Under normal operating circumstances, the transmission time to and from Vantiv eCommerce does not exceed 0.6 seconds
76
- and processing overhead by Vantiv eCommerce occurs in 0.1 seconds.
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
 
@@ -1,29 +1,28 @@
1
- =begin
2
- Copyright (c) 2017 Vantiv eCommerce
3
-
4
- Permission is hereby granted, free of charge, to any person
5
- obtaining a copy of this software and associated documentation
6
- files (the "Software"), to deal in the Software without
7
- restriction, including without limitation the rights to use,
8
- copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the
10
- Software is furnished to do so, subject to the following
11
- conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
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
- begin
39
- if !(ENV['LITLE_CONFIG_DIR'].nil?)
40
- config_file = ENV['LITLE_CONFIG_DIR'] + '/.litle_SDK_config.yml'
41
- else
42
- config_file = ENV['HOME'] + '/.litle_SDK_config.yml'
43
- end
44
- # if Env variable exist, then just override the data from config file
45
- if File.exists?(config_file)
46
- datas=YAML.load_file(config_file)
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
- if !(ENV['litle_'+key].nil?)
62
- datas[key]=ENV['litle_'+key]
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