Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A client for our billing service
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.env
.gitignore
.rvmrc
.travis.yml
Gemfile
Rakefile
Readme.md
william-client.gemspec

Readme.md

William-client

William-client acts as an interface between William and your Ruby application. It will ideally only be a thin HyperClient wrapper, but could evolve to incorporate more of William's business logic.

Main goals

  • High-level
  • Clean interface
  • No bullshit

Usage

# Authentication
william = William::Client.new(api_key)

# Get all the subscriptions
william.subscriptions

# Create a new subscription
william.create_subscription({name: 'Blah'})

# List all the invoices for a subscription
william.subscriptions.first.invoices

Idea: Rack callbacks

In order to receive callbacks from william, william-client could be mounted as a rack application:

# in routes.rb
mount William::Client::RackApp, to: '/william'

Then, you could subscribe to them:

William::Client.callbacks.on_failed_payment do |invoice, subscription|
  # Shut off the service
end
Something went wrong with that request. Please try again.