VantivCnp 8.31.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 16b7b06caa7e5904063ffe1fa049bb19f6d8528549ad16d1d9f2b7cb7c92242d
|
4
|
+
data.tar.gz: 7773a944c7b6eb146acd52fa7f6d0c60d34153caa846dfa7ee0700163edb38d6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7f24bf2604e32cf44cdf813316c421f6929cb43f482e36a545a9884aa043749a0a478197535a0d2ce262a0b00bf22f12b336328411fc99251251c36e6210a6c1
|
7
|
+
data.tar.gz: 8c2accb5053ed937ebbcd9558cd576c78b51de017792d75215163b2e142dcb2b3d8533ce51f4863874224f39b76209272674871ade470e7c73021678305b3776
|
data/CHANGELOG
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
= LitleOnline CHANGELOG
|
2
|
+
|
3
|
+
== version 8.31.0(March 29, 2018)
|
4
|
+
* Feature : Processingtype elements added to sale, authorization, and forcecapture
|
5
|
+
|
6
|
+
==version 8.29.2
|
7
|
+
HTTP timeout set to 500ms
|
8
|
+
|
9
|
+
== version 8.29.1(March 11, 2015)
|
10
|
+
* BugFix: fixed a XML field bug in Account Update Token
|
11
|
+
|
12
|
+
== version 8.29.0(January 28, 2015)
|
13
|
+
* Feature : Added support for Applepay and Secondary Amount
|
14
|
+
* BugFix: fix an incorrect mapping in fraud check option fields for Sale transaction
|
15
|
+
|
16
|
+
== version 8.27.0(August 27, 2014)
|
17
|
+
* Feature : Added samples for all kinds of transactions
|
18
|
+
|
19
|
+
== version 8.25.1(July 18,2014)
|
20
|
+
* Feature : Added Env variables to setup ruby config
|
21
|
+
|
22
|
+
|
23
|
+
== version 8.25.0 (March 17, 2014)
|
24
|
+
* Feature: Added support for ROAM: Authorization, ForceCapture, CaptureGivenAuth, Sale, Credit
|
25
|
+
|
26
|
+
== version 8.24.0 (March 17, 2014)
|
27
|
+
* Feature: add triggered rules for advancedFraudCheckResult
|
28
|
+
|
29
|
+
== Version 8.23.0 (March 14, 2014)
|
30
|
+
* Feature: advancedFraudChecks now available in authorization and sale
|
31
|
+
* Feature: catLevel (Cardholder Activated Terminal) now available in pos
|
32
|
+
* Feature: advancedFraudResults now available in fraudResult
|
33
|
+
|
34
|
+
== Version 8.22.0 (March 14, 2014)
|
35
|
+
* Feature: Support for the following new gift card transactions:
|
36
|
+
ActivateReversal, DeactivateReversal, LoadReversal, RefundReversal,
|
37
|
+
UnloadReversal, DepositReversal
|
38
|
+
* Feature: UpdateSubscription now can take token or paypage updates, and
|
39
|
+
can return token in the response
|
40
|
+
* Feature: Support for virtualGiftCard in giftCard activations and can be returned in EnhancedAuthResponses
|
41
|
+
* Feature: Gift Card responses can be returned from AuthReversal
|
42
|
+
|
43
|
+
== Version 8.21.0 (March 13, 2014)
|
44
|
+
* Feature: Support for the following new recurring transactions:
|
45
|
+
CreatePlan, UpdatePlan
|
46
|
+
* Feature: Support for the following new gift card transactions:
|
47
|
+
Activate, Deactivate, Load, Unload, Balance Inquiry
|
48
|
+
* Feature: Gift card responses are now returned as part of
|
49
|
+
authorzationResponse, authReversalResponse, captureResponse,
|
50
|
+
forceCapture, captureGivenAuthResponse, saleResponse, creditResponse
|
51
|
+
* Feature: fraudResult is now returned as part of captureResponse,
|
52
|
+
forceCaptureResponse, captureGivenAuthResponse, creditResponse
|
53
|
+
|
54
|
+
== Version 8.20.0 (December 17, 2013)
|
55
|
+
* Feature: More initial support for Recurring, including the ability to update or cancel subscriptions
|
56
|
+
|
57
|
+
== Version 8.19.0 (March 07, 2014)
|
58
|
+
* Feature: Added deptRepayment as a choice for authorizations, forceCapture, captureGivenAuth, sale
|
59
|
+
* Feature: More initial support for Recurring, including a backwards incompatible changing a field from numberOfPaymentsRemaining to numberOfPayments
|
60
|
+
|
61
|
+
== Version 8.18.0 (July 31, 2013)
|
62
|
+
* Feature: Add initial support for Recurring
|
63
|
+
* Feature: Add support for Gift Card as a card type (GC)
|
64
|
+
|
65
|
+
== Version 8.17.0 (June 13, 2013)
|
66
|
+
* Feature: Batch support - see https://gist.github.com/litleSDK/5687345, https://gist.github.com/litleSDK/5714803 and https://gist.github.com/litleSDK/5714847
|
67
|
+
* Feature: Add support for surcharging credit card transactions
|
68
|
+
* Feature: Add support for specifying the terminalId on a pos transaction
|
69
|
+
* Feature: Add support for pos transactions on tied refunds
|
70
|
+
* Cleanup: Drop support for 1.8.6
|
71
|
+
|
72
|
+
== Version 8.16.0 (March 29, 2013)
|
73
|
+
|
74
|
+
* Feature: Merged pull request #7 from pierre to add external logging support
|
75
|
+
* Feature: Add recyling to voidResponse
|
76
|
+
* Bugfix: Force the "version" attribute of a LitleOnlineRequest to be the major and minor version of the sdk submitting the transaction instead of using the value from the configuration file
|
77
|
+
* Bugfix: Add Connection: close header to reduce the chance of 403s from reaching the ip connection limit
|
78
|
+
* Bugfix: Merged pull request #5 from simeonwillbanks to fix a typo in sale when payPalOrderComplete is specified
|
79
|
+
|
80
|
+
== Version 8.15.0 (January 31, 2013)
|
81
|
+
|
82
|
+
* Feature: Add merchantData to echeck verifications and echeck redeposits
|
83
|
+
|
84
|
+
== Version 8.14.0 (January 31, 2013)
|
85
|
+
|
86
|
+
* Feature: Temporary storage of card validation num on tokens
|
87
|
+
* Feature: Updating card validation numbers on tokens
|
88
|
+
|
89
|
+
== Version 8.13.2 (June 28, 2012)
|
90
|
+
|
91
|
+
* Feature: Most schema validations are now handled by ruby code and throw errors.
|
92
|
+
* Bugfix: Remove hardcoded username/password fields
|
93
|
+
|
94
|
+
== Version 8.13.1 (May 22, 2012)
|
95
|
+
|
96
|
+
* Feature: Echeck Void now supported
|
97
|
+
|
98
|
+
== Version 8.13.0 (May 18, 2012)
|
99
|
+
|
100
|
+
* Feature: Authorizations and Sales can accept an optional fraudFilterOverride parameter
|
101
|
+
|
102
|
+
== Version 8.12.4 (May 17, 2012)
|
103
|
+
|
104
|
+
* Bugfix: Use modules so that we are not polluting the global namespace
|
105
|
+
|
106
|
+
== Version 8.12.3 (May 17, 2012)
|
107
|
+
|
108
|
+
* Bugfix: Allow use without the configuration file
|
109
|
+
|
110
|
+
== Version 8.12.2 (May 16, 2012)
|
111
|
+
|
112
|
+
* Bugfix: Fix bug where rails "capture" method was interfering with Litle's "capture"
|
113
|
+
|
114
|
+
== Version 8.12.1 (May 15, 2012)
|
115
|
+
|
116
|
+
* Feature: Support Ruby 1.8.7
|
117
|
+
* Bugfix: Add support for line item data and tax detail to enhanced auth
|
118
|
+
|
119
|
+
== Version 8.12.0 (April 16, 2012)
|
120
|
+
|
121
|
+
* Feature: Add support for actionReason on credit
|
122
|
+
* Feature: Track SDK Usage
|
123
|
+
* Bugfix: Add support for MerchantData on auth and sale
|
124
|
+
|
125
|
+
== Version 8.10.3 (April 16, 2012)
|
126
|
+
|
127
|
+
* Feature: Support Ruby 1.8.6
|
128
|
+
* Bugfix: Setup sandbox url was incorrect
|
129
|
+
* Cleanup: Support newest sandbox conventions
|
130
|
+
|
131
|
+
== Version 8.10.1 (March 2, 2012)
|
132
|
+
|
133
|
+
* Feature: Allow use without the configuration file
|
134
|
+
* Bugfix: Reauth works
|
135
|
+
* Cleanup: Use ruby conventions
|
136
|
+
|
137
|
+
== Version 8.10.0 (February 17, 2012)
|
138
|
+
|
139
|
+
* Initial release
|
data/CONTRIBUTORS
ADDED
data/DESCRIPTION
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2011 Litle & Co.
|
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
|
+
NONINFRINGEMENT. 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.
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
Vantiv eCommerce Ruby SDK
|
2
|
+
=====================
|
3
|
+
#### Warning:
|
4
|
+
#### All version changes require recertification to the new version. Once certified for the use of a new version, Vantiv modifies your Merchant Profile, allowing you to submit transaction to the Production Environment using the new version. Updating your code without recertification and modification of your Merchant Profile will result in transaction declines. Please consult you Implementation Analyst for additional information about this process.
|
5
|
+
About Vantiv eCommerce
|
6
|
+
------------
|
7
|
+
[Vantiv eCommerce](http://www.vantiv.com) powers the payment processing engines for leading companies that sell directly to consumers through internet retail, direct response marketing (TV, radio and telephone), and online services. Vantiv eCommerce is the leading authority in card-not-present (CNP) commerce, transaction processing and merchant services.
|
8
|
+
|
9
|
+
|
10
|
+
About this SDK
|
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.
|
13
|
+
|
14
|
+
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
|
+
|
16
|
+
This SDK was implemented to support the Ruby programming language and was created by Vantiv eCommerce. Its intended use is for online transaction processing utilizing your account on the Vantiv eCommerce payments engine.
|
17
|
+
|
18
|
+
See LICENSE file for details on using this software.
|
19
|
+
|
20
|
+
Source Code available from : https://github.com/LitleCo/litle-sdk-for-ruby
|
21
|
+
|
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
|
23
|
+
|
24
|
+
Setup
|
25
|
+
-----
|
26
|
+
|
27
|
+
1) Install the LitleOnline Ruby gem from rubygems.org, this will install the latest SDK gem in your Ruby environment.
|
28
|
+
Our gem is available publicly from rubygems.org. Use the command below to install.
|
29
|
+
|
30
|
+
>sudo gem install LitleOnline
|
31
|
+
|
32
|
+
Note: If you get errors, you might have to configure your proxy.
|
33
|
+
|
34
|
+
2) Once the gem is installed run our setup program to generate a configuration file. The configuration file resides in your home directory
|
35
|
+
$HOME/.litle_SDK_config.yml
|
36
|
+
|
37
|
+
For more details on setup see our instructions [here](https://github.com/LitleCo/litle-sdk-for-ruby/blob/master/SETUP.md)
|
38
|
+
|
39
|
+
3.) Create a ruby file similar to:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require 'LitleOnline'
|
43
|
+
include LitleOnline
|
44
|
+
|
45
|
+
# Visa $10 Sale
|
46
|
+
litleSaleTxn = {
|
47
|
+
'reportGroup'=>'rpt_grp',
|
48
|
+
'orderId'=>'1234567',
|
49
|
+
'card'=>{
|
50
|
+
'type'=>'VI',
|
51
|
+
'number' =>'4100000000000001',
|
52
|
+
'expDate' =>'1212'},
|
53
|
+
'orderSource'=>'ecommerce',
|
54
|
+
'amount'=>'1000'
|
55
|
+
}
|
56
|
+
|
57
|
+
# Peform the transaction on the Litle Platform
|
58
|
+
response = LitleOnlineRequest.new.sale(litleSaleTxn)
|
59
|
+
|
60
|
+
# display result
|
61
|
+
puts "Message: "+ response.message
|
62
|
+
puts "Litle Transaction ID: "+ response.saleResponse.litleTxnId
|
63
|
+
```
|
64
|
+
|
65
|
+
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
|
+
|
67
|
+
Message: Valid Format
|
68
|
+
Litle Transaction ID: <your-numeric-litle-txn-id>
|
69
|
+
|
70
|
+
More examples (including batch processing with sFTP) can be found here [Ruby Gists](https://gist.github.com/litleSDK)
|
71
|
+
|
72
|
+
Please contact Vantiv eCommerce with any further questions. You can reach us at sdksupport@vantiv.com.
|
data/Rakefile
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# Copyright (c) 2011 Litle & Co.
|
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.
|
23
|
+
require 'rubygems'
|
24
|
+
require 'rubygems/package_task'
|
25
|
+
require 'rake/testtask'
|
26
|
+
require 'rake/clean'
|
27
|
+
|
28
|
+
spec = Gem::Specification.new do |s|
|
29
|
+
FileUtils.rm_rf('pkg')
|
30
|
+
s.name = 'VantivCnp'
|
31
|
+
s.summary = 'Ruby SDK produced by Vantiv eCommerce for transaction processing using Vantiv eCommerce XML format v8.31'
|
32
|
+
s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
|
33
|
+
s.requirements =
|
34
|
+
['Contact sdksupport@vantiv.com for more information']
|
35
|
+
s.version = '8.31.0'
|
36
|
+
s.author = 'Vantiv eCommerce'
|
37
|
+
s.email = 'sdksupport@vantiv.com'
|
38
|
+
s.homepage = 'http://www.vantiv.com/developers'
|
39
|
+
s.platform = Gem::Platform::RUBY
|
40
|
+
s.required_ruby_version = '>=1.8.7'
|
41
|
+
s.files = Dir['**/**']
|
42
|
+
s.executables = ['sample_driver.rb', 'Setup.rb']
|
43
|
+
s.test_files = Dir['test/unit/ts_unit.rb']
|
44
|
+
s.has_rdoc = true
|
45
|
+
s.add_dependency('xml-object')
|
46
|
+
s.add_dependency('xml-mapping')
|
47
|
+
s.add_dependency('net-sftp')
|
48
|
+
s.add_dependency('libxml-ruby')
|
49
|
+
s.add_dependency('crack')
|
50
|
+
s.add_development_dependency('mocha')
|
51
|
+
end
|
52
|
+
|
53
|
+
Gem::PackageTask.new(spec) do |pkg|
|
54
|
+
pkg.gem_spec = spec
|
55
|
+
pkg.need_zip = true
|
56
|
+
pkg.need_tar = true
|
57
|
+
end
|
58
|
+
|
59
|
+
namespace :test do
|
60
|
+
Rake::TestTask.new do |t|
|
61
|
+
t.libs << '.'
|
62
|
+
t.name = 'unit'
|
63
|
+
t.test_files = FileList['test/unit/ts_unit.rb']
|
64
|
+
t.verbose = true
|
65
|
+
end
|
66
|
+
|
67
|
+
Rake::TestTask.new do |t|
|
68
|
+
t.libs << '.'
|
69
|
+
t.name = 'functional'
|
70
|
+
t.test_files = FileList['test/functional/ts_all.rb']
|
71
|
+
t.verbose = true
|
72
|
+
end
|
73
|
+
|
74
|
+
Rake::TestTask.new do |t|
|
75
|
+
t.libs << '.'
|
76
|
+
t.name = 'certification'
|
77
|
+
t.test_files = FileList['test/certification/certTest*.rb']
|
78
|
+
t.verbose = true
|
79
|
+
end
|
80
|
+
|
81
|
+
Rake::TestTask.new do |t|
|
82
|
+
t.libs << '.'
|
83
|
+
t.name = 'all'
|
84
|
+
t.test_files = FileList['test/**/*.rb']
|
85
|
+
t.verbose = true
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
task default: 'gem'
|
data/SETUP.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
Setting up and Configuring the Litle SDK
|
2
|
+
=========================================
|
3
|
+
|
4
|
+
Running the built in configuration file generator
|
5
|
+
-------------------------------------------------
|
6
|
+
The Ruby SDK ships with a built in program which can be used to generate your specific configuration.
|
7
|
+
|
8
|
+
This program runs as follows:
|
9
|
+
|
10
|
+
```
|
11
|
+
>Setup.rb
|
12
|
+
Welcome to Litle Ruby_SDK
|
13
|
+
please input your user name:
|
14
|
+
test_user
|
15
|
+
please input your password:
|
16
|
+
test_password
|
17
|
+
Please choose Litle url from the following list (example: 'cert') or directly input another URL:
|
18
|
+
cert => https://cert.litle.com/vap/communicator/online
|
19
|
+
precert => https://precert.litle.com/vap/communicator/online
|
20
|
+
production1 => https://payments.litle.com/vap/communicator/online
|
21
|
+
production2 => https://payments2.litle.com/vap/communicator/online
|
22
|
+
cert
|
23
|
+
Please input the proxy address, if no proxy hit enter key:
|
24
|
+
|
25
|
+
Please input the proxy port, if no proxy hit enter key:
|
26
|
+
|
27
|
+
The Litle configuration file has been generated, the file is located at: /<your-home-directory>/.litle_SDK_config.yml
|
28
|
+
```
|
29
|
+
|
30
|
+
Modifying your configuration
|
31
|
+
----------------------------
|
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
|
+
|
34
|
+
Changing the location of the Litle configuration file:
|
35
|
+
------------------------------------------------------
|
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
|
+
|
38
|
+
Sample configuration file contents
|
39
|
+
----------------------------------
|
40
|
+
```
|
41
|
+
user: test_user
|
42
|
+
password: test_password
|
43
|
+
url: https://www.testlitle.com/vap/communicator/online
|
44
|
+
proxy_addr: yourproxyserver
|
45
|
+
proxy_port: 8080
|
46
|
+
```
|
data/bin/Setup.rb
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Copyright (c) 2011 Litle & Co.
|
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
|
+
# NON-INFRINGEMENT. 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.
|
25
|
+
|
26
|
+
# make setup file executable
|
27
|
+
|
28
|
+
#
|
29
|
+
# Configuration generation for URL and credentials
|
30
|
+
#
|
31
|
+
class Setup
|
32
|
+
attr_reader :handle, :path
|
33
|
+
def initialize(filename)
|
34
|
+
@handle = File.new(filename, File::CREAT | File::TRUNC | File::RDWR, 0o600)
|
35
|
+
File.open(filename, 'w') do |f|
|
36
|
+
puts 'Welcome to Litle Ruby_SDK'
|
37
|
+
puts 'Please input your user name:'
|
38
|
+
f.puts 'user: ' + gets
|
39
|
+
puts 'Please input your password:'
|
40
|
+
f.puts 'password: ' + gets
|
41
|
+
puts 'Please input your merchantId:'
|
42
|
+
|
43
|
+
f.puts 'currency_merchant_map:'
|
44
|
+
f.puts ' DEFAULT: ' + gets
|
45
|
+
f.puts "default_report_group: 'Default Report Group'"
|
46
|
+
|
47
|
+
puts "Please choose Litle url from the following list (example: 'prelive') or directly input another URL:
|
48
|
+
sandbox => https://www.testvantivcnp.com/sandbox/communicator/online
|
49
|
+
prelive => https://payments.vantivprelive.com/vap/communicator/online
|
50
|
+
postlive => https://payments.vantivpostlive.com/vap/communicator/online
|
51
|
+
production => https://payments.vantivcnp.com/vap/communicator/online
|
52
|
+
transact_prelive => https://transact.vantivprelive.com/vap/communicator/online
|
53
|
+
transact_postlive => https://transact.vantivpostlive.com/vap/communicator/online
|
54
|
+
transact_production => https://transact.vantivcnp.com/vap/communicator/online"
|
55
|
+
f.puts 'url: ' + Setup.choice(gets)
|
56
|
+
puts 'Please input the proxy address, if no proxy hit enter key: '
|
57
|
+
f.puts 'proxy_addr: ' + gets
|
58
|
+
puts 'Please input the proxy port, if no proxy hit enter key: '
|
59
|
+
f.puts 'proxy_port: ' + gets
|
60
|
+
puts 'Please input your sFTP username for batch processing; if no sFTP, hit enter key: '
|
61
|
+
f.puts 'sftp_username: ' + gets
|
62
|
+
puts 'Please input your sFTP password for batch processing; if no sFTP, hit enter key: '
|
63
|
+
f.puts 'sftp_password: ' + gets
|
64
|
+
puts 'Please input your sFTP url for batch processing; if no sFTP, hit enter key: '
|
65
|
+
f.puts 'sftp_url: ' + gets
|
66
|
+
puts 'Please input your url for fast batch processing; if no fast batch, hit enter key: '
|
67
|
+
f.puts 'fast_url: ' + gets
|
68
|
+
puts 'Please input your port for fast batch processing; if no fast batch, hit enter key: '
|
69
|
+
f.puts 'fast_port: ' + gets
|
70
|
+
|
71
|
+
f.puts 'printxml: false'
|
72
|
+
# default http timeout set to 500 ms
|
73
|
+
f.puts 'timeout: 500'
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def finished
|
78
|
+
@handle.close
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.choice(litle_env)
|
82
|
+
litle_online_ctx = 'vap/communicator/online'
|
83
|
+
if litle_env == "sandbox\n"
|
84
|
+
return 'https://www.testvantivcnp.com/sandbox/communicator/online'
|
85
|
+
elsif litle_env == "prelive\n"
|
86
|
+
return 'https://payments.vantivprelive.com/' + litle_online_ctx
|
87
|
+
elsif litle_env == "postlive\n"
|
88
|
+
return 'https://payments.vantivpostlive.com/' + litle_online_ctx
|
89
|
+
elsif litle_env == "production\n"
|
90
|
+
return 'https://payments.vantivcnp.com/' + litle_online_ctx
|
91
|
+
elsif litle_env == "transact_production\n"
|
92
|
+
return 'https://transact.vantivcnp.com/' + litle_online_ctx
|
93
|
+
elsif litle_env == "transact_prelive\n"
|
94
|
+
return 'https://transact.vantivprelive.com/' + litle_online_ctx
|
95
|
+
elsif litle_env == "transact_postlive\n"
|
96
|
+
return 'https://transact.vantivpostlive.com/' + litle_online_ctx
|
97
|
+
else
|
98
|
+
return 'https://www.testvantivcnp.com/sandbox/communicator/online'
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
#
|
104
|
+
#
|
105
|
+
# Optionally enable the configuration to reside in a custom location
|
106
|
+
# if the $LITLE_CONFIG_DIR directory is set
|
107
|
+
#
|
108
|
+
|
109
|
+
# make the config.yml file in the LITLE_CONFIG_DIR directory or HOME directory
|
110
|
+
path = if !ENV['LITLE_CONFIG_DIR'].nil?
|
111
|
+
ENV['LITLE_CONFIG_DIR']
|
112
|
+
else
|
113
|
+
ENV['HOME']
|
114
|
+
end
|
115
|
+
|
116
|
+
# make the config.yml file hidden
|
117
|
+
# create a config file contain all the configuration data
|
118
|
+
config_file = path + '/.litle_SDK_config.yml'
|
119
|
+
f = Setup.new(config_file)
|
120
|
+
|
121
|
+
# return the path of the config file and the path file
|
122
|
+
@path = File.expand_path(config_file)
|
123
|
+
puts 'The Litle configuration file has been generated, the file is located at: ' + @path
|
124
|
+
f.finished
|