0ctobat/octobat-php
最新稳定版本:2.4.0
Composer 安装命令:
composer require 0ctobat/octobat-php
包简介
Octobat PHP Library
README 文档
README
You can sign up for an Octobat account at https://www.octobat.com.
Requirements
PHP 5.4.0 and later.
Composer
You can install the bindings via Composer. Run the following command:
composer require 0ctobat/octobat-php
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
Manual Installation
If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the init.php file.
require_once('/path/to/octobat-php/init.php');
Dependencies
The bindings require the following extensions in order to work properly:
If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.
Getting Started
Simple usage looks like:
\Octobat\Octobat::setApiKey('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); $customer = \Octobat\Customer::create(['email' => "john.doe@gmail.com", 'name' => 'John Doe', 'billing_address_country' => 'FR']); echo $customer;
Documentation
Please see http://v2apidoc.octobat.com/ for up-to-date documentation.
Configuring a Logger
The library does minimal logging, but it can be configured
with a [PSR-3 compatible logger][psr3] so that messages
end up there instead of error_log:
\Octobat\Octobat::setLogger($logger);
Per-request Configuration
For apps that need to use multiple keys during the lifetime of a process, it's also possible to set a per-request key and/or account:
\Octobat\Customer::all([], [ 'api_key' => 'oc_test_skey...' ]); \Octobat\Customer::retrieve("oc_cu_xxxxxxxx", [ 'api_key' => 'oc_test_skey...' ]);
统计信息
- 总下载量: 54.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-02