Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
pengwynn committed May 28, 2010
1 parent 796416f commit a32e5a9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 29 deletions.
2 changes: 0 additions & 2 deletions README.markdown
Expand Up @@ -4,8 +4,6 @@ Ruby wrapper for the chargify.com SAAS and billing API


## Installation ## Installation


sudo gem install gemcutter
gem tumble
sudo gem install chargify sudo gem install chargify


## Example Usage ## Example Usage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.2.5 0.2.6
1 change: 1 addition & 0 deletions changelog.md
Expand Up @@ -3,6 +3,7 @@
## 0.2.6 May 27, 2010 ## 0.2.6 May 27, 2010
* Fix #charge_subscription to submit it's body as json [@will](http://github.com/will) and [@ignat](http://github.com/ignat) * Fix #charge_subscription to submit it's body as json [@will](http://github.com/will) and [@ignat](http://github.com/ignat)
* API coverage for quantity components [@will](http://github.com/will) * API coverage for quantity components [@will](http://github.com/will)
* API coverage for site and subscription transactions [@ignat](http://github.com/ignat)


## 0.2.5 May 24, 2010 ## 0.2.5 May 24, 2010
* Require fix from [@will](http://github.com/will) * Require fix from [@will](http://github.com/will)
Expand Down
2 changes: 1 addition & 1 deletion lib/chargify.rb
Expand Up @@ -9,5 +9,5 @@
require File.join(directory, 'chargify', 'client') require File.join(directory, 'chargify', 'client')


module Chargify module Chargify
VERSION = "0.2.5".freeze VERSION = "0.2.6".freeze
end end
47 changes: 22 additions & 25 deletions lib/chargify/client.rb
Expand Up @@ -127,11 +127,7 @@ def reactivate_subscription(sub_id)
end end


def charge_subscription(sub_id, subscription_attributes={}) def charge_subscription(sub_id, subscription_attributes={})
<<<<<<< HEAD
raw_response = self.class.post("/subscriptions/#{sub_id}/charges.json", :body => { :charge => subscription_attributes }.to_json)
=======
raw_response = post("/subscriptions/#{sub_id}/charges.json", :body => { :charge => subscription_attributes }) raw_response = post("/subscriptions/#{sub_id}/charges.json", :body => { :charge => subscription_attributes })
>>>>>>> 7b882dbb5e65d7ddd4b2be6ab6227fc13da6fa61
success = raw_response.code == 201 success = raw_response.code == 201
if raw_response.code == 404 if raw_response.code == 404
raw_response = {} raw_response = {}
Expand Down Expand Up @@ -169,13 +165,14 @@ def list_subscription_usage(subscription_id, component_id)
end end


def subscription_transactions(sub_id, options={}) def subscription_transactions(sub_id, options={})
transactions = self.class.get("/subscriptions/#{sub_id}/transactions.json", :query => options) transactions = get("/subscriptions/#{sub_id}/transactions.json", :query => options)
transactions.map{|t| Hashie::Mash.new t['transaction']} transactions.map{|t| Hashie::Mash.new t['transaction']}
end end


def site_transactions(options={}) def site_transactions(options={})
transactions = self.class.get("/transactions.json", :query => options) transactions = get("/transactions.json", :query => options)
transactions.map{|t| Hashie::Mash.new t['transaction']} transactions.map{|t| Hashie::Mash.new t['transaction']}
end


def list_components(subscription_id) def list_components(subscription_id)
components = get("/subscriptions/#{subscription_id}/components.json") components = get("/subscriptions/#{subscription_id}/components.json")
Expand All @@ -197,29 +194,29 @@ def update_subscription_component_allocated_quantity(subscription_id, component_


private private


def post(path, options={}) def post(path, options={})
jsonify_body!(options) jsonify_body!(options)
self.class.post(path, options) self.class.post(path, options)
end end


def put(path, options={}) def put(path, options={})
jsonify_body!(options) jsonify_body!(options)
self.class.put(path, options) self.class.put(path, options)
end end


def delete(path, options={}) def delete(path, options={})
jsonify_body!(options) jsonify_body!(options)
self.class.delete(path, options) self.class.delete(path, options)
end end


def get(path, options={}) def get(path, options={})
jsonify_body!(options) jsonify_body!(options)
self.class.get(path, options) self.class.get(path, options)
end end


def jsonify_body!(options) def jsonify_body!(options)
options[:body] = options[:body].to_json if options[:body] options[:body] = options[:body].to_json if options[:body]


end end
end end
end end

0 comments on commit a32e5a9

Please sign in to comment.