2017 © Pedro Peláez
 

library chargify

Interact with the Chargify API v1

image

esokullu/chargify

Interact with the Chargify API v1

  • Thursday, November 2, 2017
  • by esokullu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Chargify API

This library provides you with functionality to interact with the Chargify payment platform. It's built according to the Chargify API version 1., (*1)

Supported Resources

  • Products
  • Customers
  • Subscriptions
  • Coupons
  • Components
  • Transactions

Roadmap

  • Implement PHPUnit tests for the supported resources.
  • Add more resources from the Chargify API.

Installation

Easiest way would be using Composer and adding this to the composer.json requirement section., (*2)

{
  "require": {
    "johannez/chargify": "dev-master"
  }
}

It's PSR-0 compliant, so you can also use your own custom autoloader., (*3)

Usage

In general, every resource has a controller and a resource class. The controller is used to send requests to Chargify and the resource classes map the response data., (*4)

Only thing you really need is a controller for the resource you want to work with:, (*5)

<?php
// $type Singular lower-case name of a suported resource
// $domain Unique sub-domain name (https://DOMAIN.chargify.com)
// $api_key API key that you get through your Chargify environment.
$controller = new \Chargify\Controller\Factory::build($type, $domain, $api_key);

For example to get a listing of all products in the system:, (*6)

<?php

$pc = new \Chargify\Controller\Factory::build('product', YOUR_DOMAIN, YOUR_API_KEY);
$products = $pc->getAll();

Sending data to Chargify is easy as well., (*7)

<?php

$data = array(
  'customer' => array(
    'first_name' => 'Joe',
    'last_name' => 'Smith',
    'email' => 'joe4@example.com',
    'organization' => 'Example Corp.',
    'reference' => 'js21',
  )
);

$cc = new \Chargify\Controller\Factory::build('customer', YOUR_DOMAIN, YOUR_API_KEY);
$new_customer = $cc->create($data);

The Versions

02/11 2017

dev-master

9999999-dev https://github.com/johannez/chargify

Interact with the Chargify API v1

  Sources   Download

MIT

The Requires

 

27/10 2013

v1.0

1.0.0.0 https://github.com/johannez/chargify

Interact with the Chargify API v1

  Sources   Download

MIT

The Requires