NuORDER
Gem that wraps up the communication with the API services from NuORDER
Faraday and Excon are used for creating persistent connections.
Installation
Add this line to your application's Gemfile:
gem 'nuorder'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nuorder
Usage
Configuration
The following options are available when configuring NuORDER:
app_name
Default:'Springboard Retail'
api_endpoint
Default:'http://buyer.nuorder.com'
oauth_consumer_key
oauth_consumer_secret
oauth_token
oauth_token_secret
oauth_callback
Default:'oob'
- NuORDER will POST the callback the
oauth_verifier
token. - If the callback is set to
'oob'
, theoauth_verifier
token must be supplied manually by the user.
- NuORDER will POST the callback the
Example
Nuorder.configure do |config|
config.oauth_consumer_key = 'key'
config.oauth_consumer_secret = 'key'
config.oauth_token = 'key'
config.oauth_token_secret = 'key'
end
or
client = Nuorder::Client.new(oauth_token: 'key', oauth_token_secret: 'key')
Authorization (OAuth 1.0)
NuORDER uses OAuth 1.0 for authorization.
To get the oauth tokens the following methods must be called:
Nuorder.api_initiate
- An inital call will be made in order to get the temporary tokens.
Nuorder.get_oauth_token(oauth_verifier)
- Call for getting the permanent tokens.
oauth_verifier
must be supplied.
Retrieve tokens:
oauth_token = Nuorder.oauth_token
oauth_token_secret = Nuorder.oauth_token_secret
Requests
TODO
Contributing
- Fork it ( https://github.com/springboardretail/nuorder/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Running tests
Place your consumer keys and tokens in the .env
file
OAUTH_CONSUMER_KEY = 'nuorder-consumer-key'
OAUTH_CONSUMER_SECRET = 'nuorder-consumer-secret'
OAUTH_TOKEN = 'nuorder-oauth-token'
OAUTH_TOKEN_SECRET = 'nuorder-token-secret'
rake
default task will run all the tests