splashmedia/chargify-php
Composer 安装命令:
composer require splashmedia/chargify-php
包简介
Chargify payment processor API for PHP 5.3+
README 文档
README
This library is a simple wrapper for the Chargify payment platform. Documentation for the Chargify API can be found at http://docs.chargify.com/.
Installation
Installation is easiest with Composer. Just add the following to your requirements section:
{
"require": {
"splashmedia/chargify-php": "dev-master"
}
}
Alternatively you can autoload the library yourself as it complies with PSR-0 namespacing.
Usage
The client is relatively straightforward to use. First you must initialize the connection:
<?php $client = new \Splash\Chargify\Client(APIKEY, DOMAIN, SITESHAREDKEY);
Afterwards you may make calls to API endpoints as per the official chargify documentation:
<?php $data = array( 'subscription' => array( 'customer_attributes' => array( //... ), 'payment_profile_attributes' => array( //... ), ), ); /** @var $subscription \Splash\Chargify\Resource\Subscription **/ $subscription = $client->api('subscriptions', $data, 'POST');
The API will automatically hydrate Chargify API responses into the domain objects located in
lib/Splash/Chargify/Resource/. You can optionally pass a 4th parameter into the api() method to disable hydration
if you would prefer to work with the raw response array.
Memcached
Use memcache by calling Client::setMemcached() with an instance of the class Memcached. At this time, individual
products and a complete list of products are cached.
统计信息
- 总下载量: 6.23k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-02-12