Ingenico Connect Ruby SDK
This SDK has been rebranded to Worldline. As part of the rebranding the SDK has moved to https://github.com/Worldline-Global-Collect/connect-sdk-ruby.
The Ruby SDK helps you to communicate with the Ingenico Connect Server API. Its primary features are:
Its use is demonstrated by an example for each possible call. The examples execute a call using the provided API keys.
See the Ingenico Connect Developer Hub for more information on how to use the SDK.
This repository consists out of four main components:
/lib/ingenico/connect/sdk/
/spec/lib/
/spec/integration/
/examples/
Note that the source code of the unit tests, integration tests and the examples can only be found on GitHub.
Ruby 2.3 or higher is required.
As for JRuby, version 9.0.0.0 and higher are supported.
In addition, the following packages are required:
To install the SDK using gem
, execute the following command:
gem install connect-sdk-ruby
connect-sdk-ruby-x.y.z.gem
file from the releases page, where x.y.z
is the version number.Navigate into the folder where the gem file is downloaded to, and execute the following command:
gem install connect-sdk-ruby-x.y.z.gem
connect-sdk-ruby-x.y.z.zip
file from the releases page, where x.y.z
is the version number.Unzip the file, navigate into the folder where the file is unzipped to, and execute the following commands:
gem build connect-sdk-ruby.gemspec
gem install connect-sdk-ruby-x.y.z.gem
After the Ruby SDK has been installed, it can be uninstalled using the
following command:
gem uninstall connect-sdk-ruby
The required packages can be uninstalled in the same way.
After the Ruby SDK has been installed, it can be required in Ruby program as follows:
require 'ingenico/connect/sdk'
There are two types of tests: unit tests and integration tests. The unit tests will work out-of-the-box; for the integration tests some configuration is required.
First, some environment variables need to be set:
connect_api_apiKeyId
for the API key id to use. This can be retrieved from the Configuration Center.connect_api_secretApiKey
for the secret API key to use. This can be retrieved from the Configuration Center.connect_api_merchantId
for your merchant ID.In addition, to run the proxy integration tests, the proxy URI, username and password should be set in the spec/fixtures/resources/properties.proxy.yml
file.
In order to run the unit and integration tests, some additional dependencies are required:
They can be installed using the following command:
gem install rake rspec webmock sinatra
Note: if rake is already installed as part of the Ruby installation, this will cause a conflict error. This can safely be ignored.
The following commands can now be executed from the root directory of the SDK folder (/) to execute the tests:
Unit tests:
rake unit
Integration tests:
rake integration
Both unit and integration tests:
rake spec
Documentation can be generated with YARD. YARD can be installed as a gem. The gems required to generate documentation are:
They can be installed using the following command:
gem install rake yard
Note: if rake is already installed as part of the Ruby installation, this will cause a conflict error. This can safely be ignored.
Once YARD and rake are installed, documentation can be generated with the following command (ran from the root folder):
rake yard
Documentation will be generated in the /doc
folder. The file /doc/index.html
is the main documentation file.