Project

charger

0.0
No commit activity in last 3 years
No release in over 3 years
Utilizes Chargify's REST API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Project Readme

Charger

A different gem to interact with Chargify's API.

Installation

gem 'charger'

Usage

If you are using Rails, you could do the following

# config/initializers/charger.rb
Charger.configure do |config|
  config.site = {
    subdomain: ENV['CHARGIFY_URL'],
    api_key: ENV['CHARGIFY_TOKEN']
  }
end

# Some other file
mrr = 0.0
at_risk_mrr = 0.0

Charger::Subscription.all.each do |subscription|
  if subscription.live?
    mrr += subscription.mrr
  end
  if subscription.problem?
    at_risk_mrr += subscription.mrr
  end
end

puts "MRR: #{mrr}"
puts "At Risk MRR: #{at_risk_mrr}"

For more information on what is available, you'll need to check the source code.

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