simpleweb/saasrunner-client-ruby

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

SaasRunner

Build Status

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

nt = SaasRunner::Client.new(api_key: 'YOUR API KEY')

And then call the relevant resource

Subscribers

Create a new subscriber

nt.subscribers.create!(subscriber_uid: 'ABC123')
Transactions

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')
Activations
nt.activations.create!(subscriber_uid: 'ABC123')
Events

List all events

nt.events.index

List a single event

nt.events.show(568)

Delete an event

nt.events.destroy!(568)
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

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.