Name: saasrunner-client-ruby
Owner: Simpleweb
Description: Ruby bindings for the SaaS Runner API
Created: 2014-04-25 11:02:13.0
Updated: 2014-09-11 15:46:41.0
Pushed: 2014-09-11 15:51:42.0
Homepage: null
Size: 356
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Ruby client library for the SaaS Runner REST API
Add this line to your application's Gemfile:
gem 'saas_runner'
And then execute:
$ bundle
Or install it yourself as:
$ gem install saas_runner
Refer to the SaaS Runner API docs for more information on the API.
First create a new client object with your SaaS Runner API key
nt = SaasRunner::Client.new(api_key: 'YOUR API KEY')
And then call the relevant resource
Create a new subscriber
nt.subscribers.create!(subscriber_uid: 'ABC123')
Create a new transaction charge using the three digit letter code for the currency (eg USD or GBP)
nt.transactions.charge!(subscriber_uid: 'ABC123', transaction_uid: '123', amount_in_cents: 1000, currency: 'USD')
Create a new transaction refund
nt.transactions.refund!(subscriber_uid: 'ABC123', transaction_uid: '124', amount_in_cents: 150, currecny: 'USD')
nt.activations.create!(subscriber_uid: 'ABC123')
List all events
nt.events.index
List a single event
nt.events.show(568)
Delete an event
nt.events.destroy!(568)
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)