esokullu/chargify
Composer 安装命令:
composer require esokullu/chargify
包简介
Interact with the Chargify API v1
README 文档
README
This library provides you with functionality to interact with the Chargify payment platform. It's built according to the Chargify API version 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.
{
"require": {
"johannez/chargify": "dev-master"
}
}
It's PSR-0 compliant, so you can also use your own custom autoloader.
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.
Only thing you really need is a controller for the resource you want to work with:
<?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:
<?php $pc = new \Chargify\Controller\Factory::build('product', YOUR_DOMAIN, YOUR_API_KEY); $products = $pc->getAll();
Sending data to Chargify is easy as well.
<?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);
esokullu/chargify 适用场景与选型建议
esokullu/chargify 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 11 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 esokullu/chargify 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 esokullu/chargify 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-02