checkout/checkout-php-api
最新稳定版本:1.2.18
Composer 安装命令:
composer require checkout/checkout-php-api
包简介
Checkout PHP API Library
README 文档
README
❗ This library points to Checkout.com's classic API. Please refer to the latest PHP SDK instead to benefit from the updated API
Requirements
PHP 5 > 5.3.0
How to use the library
Add the latest version of checkout-php-library into your project by using Composer or manually:
Using Composer (Recommended)
Either run the following command in the root directory of your project:
composer require checkout/checkout-php-api
Or require the Checkout.com package inside the composer.json of your project:
"require": {
"php": ">=5.2.4",
"checkout/checkout-php-api": "1.2.18"
},
Manually
Download or clone the github repository, master or download a release, and manually add it to your project.
Example
After adding the library to your project, include the file autoload.php found in root of the library.
include 'checkout-php-api/autoload.php';
You will be required to set the secret key when initialising a new APIClient instance. You will also have option for other configurations defined in AppSettings.php file.
The constructor available for configuration:
__construct($secretKey, $env = 'sandbox' ,$debugMode = false, $connectTimeout = 60, $readTimeout =60)
//Example:
use com\checkout;
$apiClient = new checkout\ApiClient('sk_test_XXXXXXXXXXXX');
By default both $connectTimeout and $readTimeout are to 60 seconds. You may change them as needed.
$env accepts either 'sandbox' or 'live' as value. This parameter allow you to shift between the sandbox environment or live environment. By Default the sandbox environment will be used.
Sample code for:
统计信息
- 总下载量: 432.77k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-27