Version 2 by Dan Bowen
on Dec 30, 2010 17:12.

compared with
Version 3 by Dan Bowen
on May 20, 2011 02:15.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (169)

View Page History

{zone-data:revision}
1.0 - 30 December 2010: 19 May 2011: Initial Draft.
{zone-data}

{zone-data:requirements}
The component *will* wrap the entire Chargify REST API.
The component *will* provide responses as Arrays.
The component *will* provide response objects that implment ArrayAccess, Iterator, Countable for easy iteration.
The component *will* allow for both JSON and XML requests and responses.
The component *will* respond appropriately to HTTP response codes returned by the Chargify API
The component *will* provide an expressive API (setters) so it is obvious what parameters need to be sent with a given request.
{zone-data}


{zone-data:milestones}
* Milestone 1: \[DONE\] Supporting Documentation, Use Cases, Class Skeletons, uploaded.
* Milestone 2: Check in working Code to support the basic Zend_Service_Chargify instantiation
* Milestone 3: Check in working code to support Products functionality
* Milestone 4: Check in working code to support Coupons Components functionality
* Milestone 5: Check in working code to support Customers Coupons functionality
* Milestone 6: Check in working code to support Subscriptions Customers functionality
* Milestone 7: Check in working code to support Transactions Subscriptions functionality
* Milestone 8: Check in working code to support Migrations Transactions functionality
* Milestone 9: Check in working code to support Charges Migrations functionality
* Milestone 10: Check in working code to support Adjustments Charges functionality
Milestone 11: Check in working code to support Adjustments functionality
* Milestone 112: Check in working code to support Metered Usage functionality
* Milestone 123: Check in working code to support Quantity Component Allocations functionality
* Milestone 134: Check in working code to support Refunds functionality
* Milestone 14: Check in working code to support Credits functionality
* Milestone 15: PHPUnit Test exist.
Milestone 15: Check in working code to support Statements functionality
* Milestone 16.: Redesign and update code based off community feedback.
Milestone 17: PHPUnit Tests exist.
Milestone 18: Solidify DocBlox API documentation
{zone-data}

* Zend_Service_Chargify
* Zend_Service_Chargify_Abstract
* Zend_Service_Chargify_Product Zend_Service_Chargify_Adjustment
* Zend_Service_Chargify_Charge
* Zend_Service_Chargify_Component
* Zend_Service_Chargify_Coupon
* Zend_Service_Chargify_Customer
* Zend_Service_Chargify_Exception
* Zend_Service_Chargify_Product
* Zend_Service_Chargify_Refund
* Zend_Service_Chargify_Statement
* Zend_Service_Chargify_Subscription
* Zend_Service_Chargify_Transaction
* Zend_Service_Chargify_Migration
* Zend_Service_Chargify_Charge
* Zend_Service_Chargify_Adjustement
* Zend_Service_Chargify_MeteredUsage
* Zend_Service_Chargify_QuantityComponent
* Zend_Service_Chargify_Refund
* Zend_Service_Chargify_Credit
{zone-data}

// this could also be a Zend_Config object
$config = array(
  'format'   => 'json',
  'api_key'  => 'yourapikey',
  'hostname' => 'yoursite.chargify.com',
'format' => 'json',
'api_key' => 'yourapikey',
'hostname' => 'yoursite.chargify.com',
  'password' => 'x' // password is always x. might not need to send this as a config option
);
$service = new Zend_Service_Chargify($config);
Zend_Service_Chargify::setService($service); // you only need to do this one time

// create customer and subscription
$subscription = new Zend_Service_Chargify_Subscription();
$subscription->setProductHandle('your-product-handle')
             ->setCustomerAttributes(array(
               'first_name'   => 'First Name',
               'last_name'    => 'Last Name',
               'email'        => 'user@email.com,
               'reference'    => $uniqueUserIdFromYourApp
             ));
             
$response = $subscription->create();
$sub = $service->subscription()
->setProductHandle('your-product-handle')
->setCustomerAttributes(array(
'first_name' => 'First Name',
'last_name' => 'Last Name',
'email' => 'user@email.com',
'reference' => $uniqueUserIdFromYourApp
))
->create();

// check for errors
if ($subscription->isError()) {
  $errors = $subscription->getErrors();
$errors = $sub->getErrors();
}
{code}
{code}
<?php
$subscription = new Zend_Service_Chargify_Subscription();
$service->subscription()->cancel(123456);
{code}

||UC-03||
UC-03 List transactions for a specific subscription. cCharges, refunds and payments only

$transactions = $service->transaction()
->setPagination(1, 20)
->setKinds(array('charge', 'refund', 'payment'))
->listBySubscription(123456);
{code}
<?php
$trans = new Zend_Service_Chargify_Transaction();
$trans->setPagination(1, 20)
->setKinds(array('charge', 'refund', 'payment'));
$transactions = $trans->listBySubscription(123456);
{code}
 
{zone-data}
{code}
<?php
/**
* @category Zend
* @package Zend_Service_Chargify
*/
class Zend_Service_Chargify extends Zend_Service_Abstract
{

/**
* Your http authentication password. Your The password is always "x" but for now we're
* for now it will be sent in via $config object in constructor
* accepting in in the $config
*
* @var string
* Original config used in constructor
*
* @var array|Zend_Config mixed Zend_Config|array
*/
protected $_config;

/**
* Enter description here...
* @var Core_Service_Chargify
*/
protected static $_service;

/**
* Set up configuration options for use by Zend_Http_Client
*
* @param array|Zend_Config mixed Zend_Config|array $config
*/
public function __construct($config) {}

/**
* Set static Zend_Service_Chargify for reuse xml or json
*
* @param Zend_Service_Chargify $service @return string
*/
public static function setService(Zend_Service_Chargify $service) {}
public function getFormat() {}

/**
* Returns original config sent in constructor
* Get the static Zend_Service_Chargify object
* @return Zend_Config|array
* @return Zend_Service_Chargify
*/
public static function getService() {}
public function getConfig() {}

/**
* Send the request
* Sends a request to the Chargify API
*
* @param string $path

/**
* Helper for instantiating a Zend_Service_Chargify_Customer object
* xml or json
* @return Zend_Service_Chargify_Customer
*/
public function customer() {}

/**
* Helper for instantiating a Zend_Service_Chargify_Subscription object
*
* @return string Zend_Service_Chargify_Subscription
*/
public function getFormat() subscription() {}

/**
* Helper for instantiating a Zend_Service_Chargify_Product object
*
* @return Zend_Service_Chargify_Product
*/
public function product() {}

/**
* Helper for instantiating a Zend_Service_Chargify_Adjustment object
*
* @return Zend_Service_Chargify_Adjustment
*/
public function adjustment() {}

/**
* Helper for instantiating a Zend_Service_Chargify_Charge object
*
* @return Zend_Service_Chargify_Charge
*/
public function charge() {}

/**
* Helper for instantiating a Zend_Service_Chargify_Component object
*
* @return Zend_Service_Chargify_Component
*/
public function component() {}

/**
* Helper for instantiating a Zend_Service_Chargify_Coupon object
*
* @return Zend_Service_Chargify_Coupon
*/
public function coupon() {}

/**
* Helper for instantiating a Zend_Service_Chargify_Transaction object
*
* @return Zend_Service_Chargify_Transaction
*/
public function transaction() {}

/**
* Helper for instantiating a Zend_Service_Chargify_Refund object
*
* @return Zend_Service_Chargify_Refund
*/
public function refund() {}

/**
* Helper for instantiating a Zend_Service_Chargify_Statement object
*
* @return Zend_Service_Chargify_Statement
*/
public function statement() {}
}
{code}
{code}
<?php
/**
* @category Zend
* @package Zend_Service_Chargify
*/
abstract class Zend_Service_Chargify_Abstract implements ArrayAccess, Iterator, Countable
{
protected $_params = array();

/**
* Generic setter of parameters to be used in the request
* Data container for providing ArrayAccess on this object
*
* @var array
*/
protected $_data = array();

/**
* Instance of Zend_Service_Chargify sent in constructor
*
* @var Zend_Service_Chargify
*/
protected $_service;

public function __construct(Zend_Service_Chargify $service) {}

/**
* Get Zend_Service_Chargify instance sent in constructor
*
* @return Zend_Service_Chargify
*/
public function getService() {}

/**
* Set a single parameter. Provides fluent interface.
*
* @param string $param
* @param mixed string|array $value
* @return Zend_Service_Chargify_Abstract
*/

/**
* Generic getter of params Get a single parameter.
*
* @param string $paramName

/**
* Get all params.
*
* @return array

/**
* Assembles xml from given array
*
* @param array $array

/**
* Assmbles a full xml document from given array
*
* @param array $array
* @return string
*/
public function getXml($array) {}

/**
* Assembles the raw data (xml or json) from the given array
*

/**
* Get the errors
* Array of errors, if any, returned from Chargify.
* @return array
*/
*/
public function getResponseArray(Zend_Http_Response $response) {}
}
{code}

{code}
<?php
/**
* Class for interacting with Customer functionality
*
* @link http://docs.chargify.com/api-customers
*/
class Zend_Service_Chargify_Customer extends Zend_Service_Chargify_Abstract
{
/**
* (Required)
*
* @param string $firstName
* @return Zend_Service_Chargify_Customer
*/
public function setFirstName($firstName) {}

/**
* (Required)
* Implementation of ArrayAccess
* @param string $lastName
* @return Zend_Service_Chargify_Customer
*/
public function setLastName($lastName) {}

/**
* (Required)
* @param mixed $offset
* @param string $email mixed $value
* @return Zend_Service_Chargify_Customer
*/
public function setEmail($email) offsetSet($offset, $value) {}

/**
* (Optional) Company/Organization name
*
* @param string $organization
* @return Core_Service_Chargify_Customer
*/
public function setOrganization($organization) {}

/**
* (Optional, but encouraged) The unique identifier used within your own
* application for this customer
*
* @param string|int $reference
* @return Core_Service_Chargify_Customer
*/
public function setReference($reference) {}

/**
* Update a customer by their ID within Chargify
*
* @param int $id
* @return array
*/
public function update($id) {}
}
{code}
<?php
/**
* Class for interactive with Subcription functionality
* @category Zend
* @package Zend_Service_Chargify
* @link http://docs.chargify.com/api-subscriptions
* @link http://docs.chargify.com/api-migrations
*/
class Zend_Service_Chargify_Subscription extends Zend_Service_Chargify_Abstract
{

/**
* The API Handle of the product for which you are creating a subscription.
* or migrating to. Required, unless a product_id is given instead.
*
* @param string $handle

/**
* The ID of the Product that the subscription will created for or migrated
* to.
*
* @param string|int $id
* @return Zend_Service_Chargify_Subscription
*/
public function setProductId($id) {}

/**
* The ID of an existing customer within Chargify. Required, unless a
* customer_reference or a set of customer_attributes is given.

/**
* Possible array keys:
* Array containing component IDs and quantities for components to be added
* at subscription creation time. Array should look like this:
*
* first_name array(
* The first name of the customer. Required when creating a customer via
* array('component_id' => $id, 'allocated_quantity' => $quantity),
* array('component_id' => $id, 'allocated_quantity' => $quantity)
* attributes. )
*
* @param array $components
* @return Zend_Service_Chargify_Subscription
* @todo Unit test this
*/
public function setComponents($components) {}

/**
* Set the attributes for the customer. Useful when creating customer and
* subscription at the same time.
*
* last_name
* The last name of the customer. Required when creating a customer via
* attributes.
*
* email
* The email address of the customer. Required when creating a customer via
* attributes.
*
* organization
* The organization/company of the customer. Optional.
*
* reference
* A customer "reference", or unique identifier from your app, stored in
* Chargify. Can be used so that you may reference your customers within
* Chargify using the same unique value you use in your application. Optional.
*
* @param array $attributes
* @return Zend_Service_Chargify_Subscription

/**
* Set payment profile attributes. Useful when accepting (or requiring) a
* Possible array keys:
* credit card at signup.
* first_name
* (Optional) First name on card. If omitted, the first_name from customer
* attributes will be used.
*
* last_name
* (Optional) Last name on card. If omitted, the last_name from customer
* attributes will be used.
*
* full_number
* The full credit card number (string representation, i.e.
* "5424000000000015")
*
* expiration_month
* (Optional when performing a Subscription Import via `vault_token`,
* required otherwise) The 1- or 2-digit credit card expiration month, as an
* integer or string, i.e. "5"
*
* expiration_year
* (Optional when performing a Subscription Import via `vault_token`,
* required otherwise) The 4-digit credit card expiration year, as an integer
* or string, i.e. "2012"
*
* cvv
* (Optional, may be required by your gateway settings) The 3- or 4-digit
* Card Verification Value. This value is merely passed through to the
* payment gateway.
*
* billing_address
* (Optional, may be required by your product configuration or gateway
* settings) The credit card billing street address (i.e. "123 Main St.").
* This value is merely passed through to the payment gateway.
*
* billing_city
* (Optional, may be required by your product configuration or gateway
* settings) The credit card billing address city (i.e. "Boston"). This
* value is merely passed through to the payment gateway.
*
* billing_state
* (Optional, may be required by your product configuration or gateway
* settings) The credit card billing address state (i.e. "MA"). This value is
* merely passed through to the payment gateway.
*
* billing_zip
* (Optional, may be required by your product configuration or gateway
* settings) The credit card billing address zip code (i.e. "12345"). This
* value is merely passed through to the payment gateway.
*
* billing_country
* (Optional, may be required by your product configuration or gateway
* settings) The credit card billing address country, preferably in
* [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
* format (i.e. "US"). This value is merely passed through to the payment
* gateway. Some gateways require country codes in a specific format. Please
* check your gateway's documentation.
*
* vault_token
* (Optional, used only for Subscription Import) The "token" provided by your
* vault storage for an already stored payment profile
*
* customer_vault_token
* (Optional, used only for Subscription Import) (only for Authorize.Net CIM
* storage) The customerProfileId for the owner of the
* customerPaymentProfileId provided as the vault_token
*
* current_vault
* (Optional, used only for Subscription Import) The vault that stores the
* payment profile with the provided vault_token. May be authorizenet,
* trust_commerce, payment_express, beanstream, or braintree1
*
* last_four
* (Optional, used only for Subscription Import) If you have the last 4
* digits of the credit card number, you may supply them here so that we may
* create a masked card number (i.e. 'XXXX-XXXX-XXXX-1234') for display in
* the UI
*
* card_type
* (Optional, used only for Subscription Import) If you know the card type
* (i.e. Visa, MC, etc) you may supply it here so that we may display the
* card type in the UI. May be visa, master, discover, american_express,
* diners_club, jcb, switch, solo, dankort, maestro, forbrugsforeningen, orlaser
*
* @param array $attributes

/**
* (Optional, used for Subscription Import) Set this attribute to a future
* date/time to sync imported subscriptions to your existing renewal
* schedule. See the notes on "Date/Time Format" below. If you provide a
* next_billing_at timestamp that is in the future, no trial or initial
* charges will be applied when you create the subscription. In fact, no
* payment will be captured at all. The first payment will be captured,
* according to the prices defined by the product, near the time specified
* by next_billing_at. If you do not provide a value for next_billing_at,
* any trial and/or initial charges will be assessed and charged at the time
* of subscription creation. If the card cannot be successfully charged, the
* Required when using cancelDelayed(). Set the subscription to be cancelled
* at the end of the current billing period.
* subscription will not be created.
* @param bool $bool
* @return Zend_Service_Chargify_Subscription
*/
public function setCancelAtEndOfPeriod($bool) {}

/**
* Only used for import.
*
* @param string $nextBilling

/**
* Boolean, default 0. If 1 is sent initial charges will be assessed. If 0 is
* sent initial charges will be ignored.
*
* @param int $initialCharge
* @return Zend_Service_Chargify_Subscription
*/
public function setIncludeInitialCharge($initialCharge = 0) {}

/**
* Boolean, default 0. If 1 is sent the customer will migrate to the new
* product with a trial if one is available. If 0 is sent, the trial period
* will be ignored.
*
* @param int $includeTrial
* @return Zend_Service_Chargify_Subscription
*/
public function setIncludeTrial($includeTrial = 0) {}

/**
* Set the coupon code to be used at subscription creation.
*
* @param string $coupon_code
* @return Zend_Service_Chargify_Subscription
* @link http://docs.chargify.com/api-coupons
* @todo Unit test this
*/
public function setCouponCode($coupon_code) {}

/**
* An integer value which specifies which page of results to fetch, starting
* at 1. Fetching successively higher page numbers will return additional
* results, until there are no more results to return (in which case an empty
* result set will be returned). Defaults to 1.
*
* @param int $page
* @return Zend_Service_Chargify_Subscription
*/
public function setPage($page) {}

/**
* How many records to fetch in each request, defaults to 2000. Note:
* fetching subscriptions is currently unoptimized, so fetching large batches
* of subscriptions will be a slow operation.
*
* @param int $perPage
* @return Zend_Service_Chargify_Subscription
*/
public function setPerPage($perPage) {}

/**
* Get subscription data for given subscription ID
*
* @param int $subscriptionId
* @return Zend_Service_Chargify_Subscription
*/
public function read($subscriptionId) {}

/**
* Create a subscription with params set by setters new subscription.
*
* @throws Zend_Service_Chargify_Exception @return Zend_Service_Chargify_Subscription
* @return array @see Zend_Service_Chargify_Subscription::setProductHandle()
* @see Zend_Service_Chargify_Subscription::setProductId()
* @see Zend_Service_Chargify_Subscription::setCustomerId()
* @see Zend_Service_Chargify_Subscription::setCustomerAttributes()
* @see Zend_Service_Chargify_Subscription::setPaymentProfileAttributes()
* @see Zend_Service_Chargify_Subscription::setCouponCode()
* @see Zend_Service_Chargify_Subscription::setCustomerReference()
* @see Zend_Service_Chargify_Subscription::setNextBillingAt()
* @link http://docs.chargify_Subscription.com/api-subscriptions
* @link http://docs.chargify.com/api-coupons
*/
public function create() {}

/**
* Set the given subscription ID to be canceled immediately
*
* @param int $id
* @return Zend_Service_Chargify_Subscription
* @see @see Zend_Service_Chargify_Subscription::setCancellationMessage()
*/
public function cancelImmediately($id) {}

/**
* Set the subscription to be canceled at the end of the current billing
* period.
*
* @param int $id
* @return Zend_Service_Chargify_Subscription
* @see Zend_Service_Chargify_Subscription::setCancelAtEndOfPeriod()
* @see Zend_Service_Chargify_Subscription::setCancellationMessage()
*/
public function cancelDelayed($id) {}

/**
* Reactivate the given subscription ID
*
* @param int $id
* @return Zend_Service_Chargify_Subscription
* @see Zend_Service_Chargify_Subscription::setIncludeTrial()
*/
public function reactivate($id) {}

/**
* Reset the subscription balance to $0.00
*
* @param int $subscriptionId
* @return Zend_Service_Chargify_Subscription
*/
public function resetBalance($subscriptionId) {}

/**
* Update the given subscription ID.
*
* For moving to a different product (WITHOUT PRORATION), changing customer
* attributes or changing payment profile attributes.
*
* @param int $id
* @return Zend_Service_Chargify_Subscription
* @see Zend_Service_Chargify_Subscription::setProductHandle()
* @see Zend_Service_Chargify_Subscription::setCustomerAttributes()
* @see Zend_Service_Chargify_Subscription::setPaymentProfileAttributes()
*/
public function update($id) {}

/**
* Migrate a subscription to a new product with prorated credits/debits.
*
* @param int $id
* @return Zend_Service_Chargify_Subscription
* @see Zend_Service_Chargify_Subscription::setProductId()
* @see Zend_Service_Chargify_Subscription::setProductHandle()
* @see Zend_Service_Chargify_Subscription::setIncludeTrial()
* @see Zend_Service_Chargify_Subscription::setIncludeInitialCharge()
* @link http://docs.chargify.com/api-migrations
* @todo ?? should this be moved to Zend_Service_Chargify_Migration
*/
public function migrate($id) {}

/**
* List subscriptions for a site.
*
* @return Zend_Service_Chargify_Subscription
* @see Zend_Service_Chargify_Subscription::setPage()
* @see Zend_Service_Chargify_Subscription::setPerPage()
*/
public function listSubscriptions() {}

/**
* List subscriptions for a specific customer.
*
* @param int $customerId
* @return Zend_Service_Chargify_Subscription
* @see Zend_Service_Chargify_Subscription::setCustomerId()
*/
public function listByCustomer($customerId) {}

/**
* When returning multiple products the array is different depending on which
* format (xml/json) you are using. This normalizes the array for us so we can
* rely on a consistent structure.
*
* @param array $responseArray
* @return array
*/
protected function _normalizeResponseArray($responseArray) {}
}
{code}
<?php
/**
* Class for interacting with Transaction functionality
* @category Zend
* @package Zend_Service_Chargify
* @link http://docs.chargify.com/api-transactions http://docs.chargify.com/api-customers
*/
class Zend_Service_Chargify_Transaction Zend_Service_Chargify_Customer extends Zend_Service_Chargify_Abstract
{
/**
* An array of transaction types. Multiple values can be passed in the url,
* for example: http://example.com?kinds[]=charge&kinds[]=payment&kinds[]=credit
* (Required)
* The following is a list of available transaction types.
*
* @param string $firstName
* charge @return Zend_Service_Chargify_Customer
* refund
* payment
* credit
* payment_authorization
* info
* adjustment
*
* @param array $kinds
* @return Zend_Service_Chargify_Transaction
*/
public function setKinds($kinds) setFirstName($firstName) {}

/**
* Returns transactions with an id greater than or equal to the one specified
* (Required)
*
* @param int $sinceId string $lastName
* @return Zend_Service_Chargify_Transaction Zend_Service_Chargify_Customer
*/
public function setSinceId($sinceId) setLastName($lastName) {}

/**
* Returns transactions with an id less than or equal to the one specified
* (Required)
*
* @param int $maxId string $email
* @return Zend_Service_Chargify_Transaction Zend_Service_Chargify_Customer
*/
public function setMaxId($maxId) setEmail($email) {}

/**
* Returns transactions with a created_at date greater than or equal to the
* one specified (Optional) Company/Organization name
*
* @param string $sinceDate; format YYYY-MM-DD $organization
* @return Zend_Service_Chargify_Transaction Zend_Service_Chargify_Customer
*/
public function setSinceDate($sinceDate) setOrganization($organization) {}

/**
* Returns transactions with a created_at date less than or equal to the one specified
* (Optional) Phone
*
* @param string $untilDate; format YYYY-MM-DD $phone
* @return Zend_Service_Chargify_Transaction Zend_Service_Chargify_Customer
*/
public function setUntilDate($untilDate) setPhone($phone) {}

/**
* The page number and number of results used for pagination. By default
* results are paginated 20 per page.
* (Optional) Address
*
* @param string $address
* @return Zend_Service_Chargify_Customer
*/
public function setAddress($address) {}

/**
* (Optional) Address2
*
* @param string $address
* @return Zend_Service_Chargify_Customer
*/
public function setAddress2($address) {}

/**
* (Optional) Country
*
* @param string $country
* @return Zend_Service_Chargify_Customer
*/
public function setCountry($country) {}

/**
* (Optional) State
*
* @param string $state
* @return Zend_Service_Chargify_Customer
*/
public function setState($state) {}

/**
* (Optional) City
*
* @param string $city
* @return Zend_Service_Chargify_Customer
*/
public function setCity($city) {}

/**
* (Optional) Zip
*
* @param string $zip
* @return Zend_Service_Chargify_Customer
*/
public function setZip($zip) {}

/**
* (Optional, but encouraged) The unique identifier used within your own
* application for this customer
*
* @param string|int $reference
* @return Zend_Service_Chargify_Customer
*/
public function setReference($reference) {}

/**
* The 'page' parameter. Used when listing customers since you can only get 50
* at a time.
*
* @param int $page
* @param int $perPage @return Zend_Service_Chargify_Customer
* @return Zend_Service_Chargify_Transaction
*/
public function setPagination($page, $perPage) setPage($page) {}

/**
* Retrieve transactions for a specific subscription
* Create a new customer
*
* @param int $subscriptionId; Chargify subscription_id @return Zend_Service_Chargify_Customer
* @return array
*/
public function listBySubscription($subscriptionId) create() {}

/**
* Depending on what format you are using some of the associative array keys
* get nested differently. This fixes them up so you always get the same array.
* List all customers for a site
*
* @return Zend_Service_Chargify_Customer
* @see Zend_Service_Chargify_Customer::setPage()
*/
public function listCustomers() {}

/**
* Read the customer data for the given Chargify ID
*
* @param int $id
* @return Zend_Service_Chargify_Customer
*/
public function readByChargifyId($id) {}

/**
* Read the customer data for the given reference (from your app)
*
* @return Zend_Service_Chargify_Customer
* @see Zend_Service_Chargify_Customer::setReference()
*/
public function readByReference() {}

/**
* Update the customer record in Chargify.
*
* @param int $id
* @return Zend_Service_Chargify_Customer
* @see Zend_Service_Chargify_Customer::setFirstName()
* @see Zend_Service_Chargify_Customer::setLastName()
* @see Zend_Service_Chargify_Customer::setEmail()
* @see Zend_Service_Chargify_Customer::setOrganization()
* @see Zend_Service_Chargify_Customer::setPhone()
* @see Zend_Service_Chargify_Customer::setAddress()
* @see Zend_Service_Chargify_Customer::setAddress2()
* @see Zend_Service_Chargify_Customer::setCity()
* @see Zend_Service_Chargify_Customer::setState()
* @see Zend_Service_Chargify_Customer::setZip()
* @see Zend_Service_Chargify_Customer::setCountry()
* @see Zend_Service_Chargify_Customer::setReference()
*/
public function update($id) {}

/**
* When returning multiple products the array is different depending on which
* format (xml/json) you are using. This normalizes the array for us so we can
* rely on a consistent structure.
*
* @param array $responseArray
* @return array