Giter Club home page Giter Club logo

charged's Introduction

charged

A high-level binding to the Chargify API.

Charged also provides an interactive chargify shell for managing sites.

Example Usage

var charged = require('charged');

var chargify = charged({
  subdomain: 'monthly-chili-cheese-fries',
  apiKey: 'ad3rt4302ebdd'
});

chargify.getSubscriptionsByCustomerRef('chjj', function(err, results) {
  if (err) throw err;
  console.log(results);
});

Usage: $ charged my-site
       $ charged my-site my-key 'ls /customers/foo'
       $ echo 'ls /stats' | charged my-site my-key
       $ echo 'ls /stats' | charged --cfg ./config.json
       $ charged --cfg ./config.json ls /customers/foo/subscriptions

$ charged my-site
API Key: foobar
[charged] ls /stats
{ seller_name: 'My Site Inc.',
  site_name: 'my-site',
  stats:
   { revenue_this_year: '$34,578.01',
     total_revenue: '$34,581.01',
     total_subscriptions: 1648,
     subscriptions_today: 0,
     revenue_this_month: '$18.00',
     revenue_today: '$18.00' } }
[charged] ls /customers/foo
{ customer:
   { reference: 'foo',
     email: '[email protected]',
     country: null,
     updated_at: '2012-09-27T15:01:17-04:00',
     address: null,
     created_at: '2012-08-26T16:53:03-04:00',
     id: 2000,
     state: null,
     first_name: 'Foo',
     last_name: 'Bar',
     zip: null,
     city: null,
     organization: null,
     phone: null,
     address_2: null } }
[charged] cat /product_families
[ { product_family:
     { name: 'my-family',
       accounting_code: null,
       id: 20000,
       description: 'Main product family.',
       handle: 'my-family' } } ]
[charged] less /subscriptions
[charged] mk /subscriptions {product_handle:'my-product',customer_reference:'foo'}
[charged] mv {product_handle:'my-product2'} /subscriptions/[last-id]
[charged] ls customers/foo/subscriptions
[charged] cd customers
[charged] pwd
/customers
[charged] rm foo
# All of the Charged method names work as well...
[charged] get-stats
[charged] get-subscription 1000
[charged] update-subscription 1000 {product_handle:'my-product'}
[charged] get-customer-by-ref foo

charged's People

Contributors

chjj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

charged's Issues

Concurrency of Requests

Everything is serial now. e.g. If you want to list every subscription each page is requested one after the other.

It would be nice to specify this level of concurrency to charged.

[feature request] Calculate future revenue

... across active subscriptions for the rest of the month starting from a given day from the charged CLI.

e.g.

[charged] revenue
Projected revenue this month: $XX.XXX based on subscriptions:
  YY active for PP product
  ZZ active for QQ product 

resolve paths

using the REPL shell and all ls commands fail.

Done some debugging and see that when attempting a 'ls' the following line ends up with an incorrect path on Windows, I expect you only tested on *nix based system.

bin\charged: 74

path = resolve('/', shell.cwd, path);

Resolves to 'c:', subsequent request attempts then fail

Support for Chargify Direct

I see there are some APIs in there for Chargify Direct, but it would be nice to support the things the Ruby library does for this. I think what's mostly missing is support for generating the secure form parameters.

If I have this wrong, please let me know. We'd like to use the Chargify Direct API and this library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.