Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
  lib
  spec
  .gitignore
  CHANGELOG.txt
  Gemfile
  Gemfile.lock
  LICENSE.txt
  README.md
  Rakefile
  successware21_asp.gemspec
Size: Mime:
  README.md

Successware21Asp

A Ruby wrapper for the Successware21Asp REST API.

Installation

Add this line to your application's Gemfile:

gem 'successware21'

And then execute:

$ bundle

Or install it yourself as:

$ gem install successware21

Usage

Configuration

Before you can make calls to Successware21Asp you must configure the library with a valid API Token. You can request a token be generated by Successware21Asp. The API Token ties the API request to a particular Successware21Asp company id.

To configure the gem pass a hash of configuration options when you create a client. Successware21 has a slightly unconventional API which means you have to get a connection_id, company_id and session_id before making requests. This is built into the gem so you can simply call the set_auth_params method as below. You must pass the full url for your instance including the port number as shown in the example below.

client = Successware21Asp.client({ agent_name: 'name', agent_password: 'password', master_id: 123, 
                                   user_name: 'test user', user_password: 'test pass', company_id: 123, endpoint:'http://services.successware21.com:2142' })
client.set_auth_params

You can then retrieve resources using the following commands:

client.customers({date_time: '2010-01-01'})
client.transactions({date_time: '2010-01-01'})

Pagination is also enabled by passing an extra parameter like so:

client.customers({page_size_: 10, page_no: 1})

To end session/connection

client.end_session
client.end_connection

Logging can also be enabled by passing an optional parameter

client = Successware21Asp.client({ agent_name: 'name',
                                   agent_password: 'password',
                                   master_id: 123,
                                   user_name: 'test user',
                                   user_password: 'test pass',
                                   company_id: 123,
                                   endpoint:'http://services.successware21.com:2142',
                                   logging: true })

Contributing

  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