adrzei / php-lib-blesta-api
此包的最新版本(dev-master)没有可用的许可信息。
PHP Blesta API 库
dev-master
2018-12-04 13:22 UTC
This package is auto-updated.
Last update: 2024-09-05 02:09:10 UTC
README
此开发套件包括以下内容
- 一个API处理器,用于简化与Blesta API的接口
- 示例商户和非商户网关实现
要求
- PHP 5.2.0 或更高版本
- Blesta 3.0.0 或更高版本
使用API
<?php require_once "blesta_api.php"; $user = "YOUR_API_USER"; $key = "YOUR_API_KEY"; $url = "http://yourdomain.com/installpath/api/"; $api = new BlestaApi($url, $user, $key); $response = $api->get("users", "get", array('user_id' => 1)); print_r($response->response()); print_r($response->errors()); ?>
插件模型也可以访问
<?php require_once "blesta_api.php"; $user = "YOUR_API_USER"; $key = "YOUR_API_KEY"; $url = "http://yourdomain.com/installpath/api/"; $api = new BlestaApi($url, $user, $key); $response = $api->post("support_manager.support_manager_tickets", "close", array('ticket_id' => 1)); print_r($response->response()); print_r($response->errors()); ?>
与网关一起工作
此SDK包含两个示例网关
- 商户信用卡网关 /components/gateways/merchant/merchant_demo_cc/
- 非商户网关 /components/gateways/nonmerchant/nonmerchant_demo/