Skip to content
A Chargify API wrapper for Ruby using ActiveResource
Ruby
Find file
Pull request Compare This branch is 3 commits ahead, 182 commits behind chargify:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
config
lib
samples
spec
.gitignore
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
VERSION
chargify_api_ares.gemspec

README.md

Chargify API wrapper for Ruby (using ActiveResource)

chargify_api_ares

This is a Ruby wrapper for the Chargify API that leverages ActiveResource. It allows you to interface with the Chargify API using simple ActiveRecord-like syntax, i.e.:

Chargify::Subscription.create(
  :customer_reference => 'moklett',
  :product_handle => 'chargify-api-ares-test',
  :credit_card_attributes => {
    :first_name => "Michael",
    :last_name => "Klett",
    :expiration_month => 1,
    :expiration_year => 2010,
    :full_number => "1234-1234-1234-1234"
  }
)

subscription.credit_card_attributes = {:expiration_year => 2013}
subscription.save

subscription.cancel

See the samples directory for more usage examples.

Installation

This library can be installed as a gem. It is hosted on Rubygems.

You can install this library as a gem using the following command:

$ gem install chargify_api_ares

Requirements

This library requires ActiveResource version 2.3.4 or greater.

$ gem install activeresource

Usage

Simply require this library before you use it:

require 'chargify_api_ares'

If you're using Rails, you could include this gem in your configuration, i.e. in environment.rb

config.gem 'chargify_api_ares'

Now you'll have access to classes the interact with the Chargify API, such as:

Chargify::Product
Chargify::Customer
Chargifiy::Subscription

Check out the examples in the samples directory. If you're not familiar with how ActiveResource works, you may be interested in some ActiveResource Documentation

Something went wrong with that request. Please try again.