SaasRunner
Ruby client library for the SaaS Runner REST API
Installation
Add this line to your application's Gemfile:
gem 'saas_runner'
And then execute:
$ bundle
Or install it yourself as:
$ gem install saas_runner
Usage
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
client = SaasRunner::Client.new(api_key: 'YOUR API KEY')
And then call the relevant resource
Subscribers
Create a new subscriber
client.subscribers.create!(subscriber_uid: 'ABC123')
Transactions
Create a new transaction charge using the three digit letter code for the currency (eg USD or GBP)
client.transactions.charge!(subscriber_uid: 'ABC123', transaction_uid: '123', amount_in_cents: 1000, currency: 'USD')
Create a new transaction refund
client.transactions.refund!(subscriber_uid: 'ABC123', transaction_uid: '124', amount_in_cents: 150, currecny: 'USD')
Activations
client.activations.create!(subscriber_uid: 'ABC123')
Events
List all events
client.events.index
List a single event
client.events.show(568)
Delete an event
client.events.destroy!(568)
Contributing
- Fork it
- 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 new Pull Request