Gem that wraps up the communication with the API services from NuORDER
Faraday and Excon are used for creating persistent connections.
Add this line to your application's Gemfile:
gem 'nuorder'And then execute:
$ bundle
Or install it yourself as:
$ gem install nuorder
The following options are available when configuring NuORDER:
app_nameDefault:'Springboard Retail'api_endpointDefault:'http://buyer.nuorder.com'oauth_consumer_keyoauth_consumer_secretoauth_tokenoauth_token_secretoauth_callbackDefault:'oob'- NuORDER will POST the callback the
oauth_verifiertoken. - If the callback is set to
'oob', theoauth_verifiertoken must be supplied manually by the user.
- NuORDER will POST the callback the
Nuorder.configure do |config|
config.oauth_consumer_key = 'key'
config.oauth_consumer_secret = 'key'
config.oauth_token = 'key'
config.oauth_token_secret = 'key'
endor
client = Nuorder::Client.new(oauth_token: 'key', oauth_token_secret: 'key')
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_verifiermust be supplied.
Retrieve tokens:
oauth_token = Nuorder.oauth_token
oauth_token_secret = Nuorder.oauth_token_secretTODO
- 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
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