PHPackages                             citizennet/chargify-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. citizennet/chargify-php-client

ActiveLibrary[Payment Processing](/categories/payments)

citizennet/chargify-php-client
==============================

Chargify PHP Client

v1.1.1(13y ago)13.1kMITPHP

Since Apr 17Pushed 13y ago7 watchersCompare

[ Source](https://github.com/citizennet/Chargify-PHP-Client)[ Packagist](https://packagist.org/packages/citizennet/chargify-php-client)[ Docs](https://github.com/citizennet/chargify-php-client)[ RSS](/packages/citizennet-chargify-php-client/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (3)Used By (0)

```
Chargify PHP Client library
Jason Forrest, 2010 (jason.forrest@rigbooks.com)

This is a PHP client for the Chargify API. It allows JSON, XML or internal classes to be used.
All calls will raise an exception on error, so make sure to wrap calls in a try...catch block.
Also, be sure to check out the Wiki for more tips: http://wiki.github.com/jforrest/Chargify-PHP-Client/

Abraham Williams has created a great Getting Started guide for this library, I recommend you check it out
for example usage: http://github.com/abraham/chargify

Example XML usage:

//assumes $subscription_xml contains xml data. This can be from your app, or
//populated from any Chargify Data object (inherits ChargifyBase) by calling the getXML() method.
//    ex. $subscription_xml = $chargify_subscription->getXML();
$request_format = 'XML';
$api_key = 'YOUR_API_KEY';

$connector = new ChargifyConnector($api_key);

try {
	$new_subscription_xml = $connector->requestCreateSubscription($subscription_xml,$request_format);
} catch (ChargifyValidationException $cve) {
	//process error handling code here.
	echo $cve->getMessage();
}

NOTE: all functions in ChargifyConnector whose names begin with 'retrieve' or 'request' return either
pure XML or pure JSON, depending on the format of the request.

Example JSON usage:

//assumes $subscription_json contains json data. This can be from your app, or
//populated from any Chargify Data object (inherits ChargifyBase) by calling the getJSON() method.
//    ex. $subscription_json = $chargify_subscription->getJSON();
$request_format = 'JSON';
$api_key = 'YOUR_API_KEY';

$connector = new ChargifyConnector($api_key);

try {
	$new_subscription_json = $connector->requestCreateSubscription($subscription_json,$request_format);
} catch (ChargifyValidationException $cve) {
        //process error handling code here.
        echo $cve->getMessage();
}

Example internal class usage:

// setup connector
$api_key = 'YOUR_API_KEY';
$connector = new ChargifyConnector($api_key);

//Customer creation
$xml_import = null; //this is useful for populating from API response.
$chargify_customer = new ChargifyCustomer($connector, $xml_import);
$chargify_customer->email = "a@b.com";
$chargify_customer->first_name = "Charles";
$chargify_customer->last_name = "Jones";
$chargify_customer->reference = "123b1j23kjb";

try {
	$new_customer = $chargify_customer->create();
} catch (ChargifyValidationException $cve) {
        //process error handling code here.
        echo $cve->getMessage();
}

//Subscription creation
//create customer and credit card first
$chargify_customer = new ChargifyCustomer($connector); //defaults to same as above
$chargify_customer->email = "a@b.com";
$chargify_customer->first_name = "Charles";
$chargify_customer->last_name = "Jones";
$chargify_customer->reference = "123b1j23kjb";

$chargify_card = new ChargifyCreditCard();
$chargify_card->first_name = "Charles";
$chargify_card->last_name = "Jones";
$chargify_card->full_number = '4111111111111111';
$chargify_card->cvv = '123';
$chargify_card->expiration_month = "02";
$chargify_card->expiration_year = "2011";
$chargify_card->billing_address = "123 any st";
$chargify_card->billing_city = "Anytown";
$chargify_card->billing_state = "CA";
$chargify_card->billing_zip = "55555";
$chargify_card->billing_country = 'US';

$chargify_subscription = new ChargifySubscription($connector);
//$chargify_subscription->customer_attributes is required
//(don't confuse with $chargify_subscription->customer.)
$chargify_subscription->customer_attributes = $chargify_customer;
$chargify_subscription->credit_card_attributes = $chargify_card; //required (See above)
$chargify_subscription->product_handle = "your product handle"; //required or product_id.
$chargify_subscription->coupon_code = "coupon_code"; //optional

try {
	$new_subscription = $chargify_subscription->create();
 } catch (ChargifyValidationException $cve) {
        //process error handling code here.
        echo $cve->getMessage();
}
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4821d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/591833?v=4)[Lee Leathers](/maintainers/theoreticaLee)[@theoreticaLee](https://github.com/theoreticaLee)

---

Top Contributors

[![jforrest](https://avatars.githubusercontent.com/u/250371?v=4)](https://github.com/jforrest "jforrest (20 commits)")[![makasim](https://avatars.githubusercontent.com/u/143206?v=4)](https://github.com/makasim "makasim (4 commits)")[![abraham](https://avatars.githubusercontent.com/u/3341?v=4)](https://github.com/abraham "abraham (1 commits)")

---

Tags

php

### Embed Badge

![Health badge](/badges/citizennet-chargify-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/citizennet-chargify-php-client/health.svg)](https://phpackages.com/packages/citizennet-chargify-php-client)
```

###  Alternatives

[cartalyst/stripe-laravel

Laravel 11 integration for the Cartalyst Stripe package.

3392.7M9](/packages/cartalyst-stripe-laravel)[yandex-money/yandex-money-sdk-php

Yandex.Money API SDK for PHP

105168.6k2](/packages/yandex-money-yandex-money-sdk-php)[cryptonator/merchant-php-sdk

Cryptonator.com Merchant API SDK for PHP

2714.2k](/packages/cryptonator-merchant-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
