Ruby example calling DirectKit API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib Updated to version 1.0.2 Aug 4, 2016

Build Status


Ruby API client to query LemonWay API


Add this line to your application's Gemfile:

gem 'lemonway'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lemonway


  1. Initialization :, client_config_options, &client_config_block)
  • api_options (Hash) : mandatory hash where are passed the api param you want to reapeat every client query + the :wsdl uri
  • client_config_options (Hash) : optional hash passed to savon to build its global options used by the client on every query
  • client_config_block (Block) : optional block to customize the savon client, takes a savon global options instance as param
client ={wsdl:  "[...]/service.asmx?wsdl"}, {ssl_verify_mode: :none})
#is the same as
client = wsdl:  "[...]/service.asmx?wsdl" do |opts|
  1. Query the API directly calling the method on the client instance : client.api_method_name(params, client_config_override, &client_block_config_override)
  • api_method_name : Lemonway underscorized mehtod name (refer to the Lemonway doc or to client.operations to list them
  • params (Hash) : params sent to the api, keys will be camelcased to comply with the SOAP convention used by Lemonway
  • client_config_override (Hash) : A hash of config transmitted to the savon client, which overrides the savon global config for the current api call only
  • client_block_config_override (Block) : A Block taking a savon global options instance as param, to override the client call configuration options
  1. API response will always be a HashWithIndifferentAccess with underscored keys. Retrieve it as a result or pass a block to the API point method
# initialize the client
client = wsdl:  "",
                              wl_login: "test",
                              wl_pass: "test",
                              language: "fr",
                              version: "1.1",
                              wallet_ip: ""

# list the available operations as follow : 
resp = client.operations
=> [:register_wallet,

# requests takes underscored names, and undescored (or camelcased) options, some hash with indifferent access are returned
resp = client.register_wallet,  wallet: "123",
                                client_mail:        "",
                                client_first_name:  "nicolas",
                                client_last_name:   "nicolas",
                                wallet_ip: ""
=> {id: '123', lwid: "98098"}
resp[:id] == resp['id'] == '123'

Please refer to the Lemonway documentation for the complete list of methods and their parameters, or query[YOUR_LEMONWAY_NAME]/dev/directkit/service.asmx if Lemonway has provided you a development account


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request