PHP 5.3 Library for Chargify
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
LICENSE
README.md
original.README

README.md

PHP 5.3 Library for the Chargify API

This is a PHP library for the Chargify API [http://docs.chargify.com/api-introduction]

History

This is actually a fork of a fork..

The master is: [https://github.com/jforrest/Chargify-PHP-Client]it hasn't been updated in a while, and the maintainer hasn't merged the pull requests from maskim. These pull requests are crucial for me, so I forked https://github.com/makasim/Chargify-PHP-Client

I had a PoC working, and then decided to integrate that into a new app we're developing for our customers, using the Lithium framework.

All hell broke lose. I had to refactor quite a bit of the code to work with Namespaces and for it to work cleanly with Lithium.

How to use with Lithium

  1. Just drop the code base in $project_root/libraries/_
  2. Add the following to your app/config/bootstrap/libraries.php
       Libraries::add('chargify',
         array('bootstrap' => 'lib/Chargify.php')
        ); 
  1. In your controller add: use chargify;

Adding to your existing Lithium project

Assuming your working directory is already a git repo, you can add this repository to it as a submodule and keep it up to date, without having to manually check all the time.

bash> cd current_lithium_project
bash> git submodule add https://github.com/zippykid/chargiphy libraries/chargify
bash> git commit 
bash> git push 

On a fresh clone you just need to do

bash> git submodule init
bash> git submodule update

What it currently does

I'll try and keep this up to date with what all it can do, as more functionality/bugs are fixed.

  • Create a subscription in Chargify
  • Throw an error from Chargify if something is broken (tested with API specific errors)