stoyanov-sv / vipparcel
VIPparcel 客户端 PHP
v1.2
2015-09-23 13:44 UTC
Requires
- guzzle/guzzle: ~3.9
This package is not auto-updated.
Last update: 2024-09-21 10:51:07 UTC
README
需求
- PHP 5.3.3 或更高版本
- [PHP cURL 扩展] (https://php.ac.cn/manual/en/book.curl.php)
- PHP JSON 扩展
- [Composer] (https://github.com/composer/composer)
开发者文档
https://vipparcel.com/docs/api/
依赖
- [Guzzle HTTP 客户端] (https://github.com/guzzle/guzzle)
安装
运行 Composer 命令
composer require "vipparcel/client"
安装后,您需要包含 Composer 的自动加载器
require 'vendor/autoload.php';
示例
=======
$client = new VP_Client(); $client->auth_token('KEY'); $client->is_test(TRUE); // production or test request (default: production) $request = new VP_Request_Account_Balance_History(); $request->set_params(array('limit' => 10, 'orderBy' => array('created' => 'ASC'))); $client->request($request); // set request object $result = $client->execute(); // send request (return object VP_Response) print_r($result->has_errors()); // boolean print_r($result->get_errors()); // boolean false || array print_r($result->as_object()); // result as stdClass object print_r($result->as_array()); // result as array
$client = new VP_Client(); $client->auth_token('KEY'); $client->request(new VP_Request_Shipping_Label_Info(144241)); // with item id $result = $client->execute(); ...
请求对象
账户 > 地址
- [POST] VP_Request_Account_Address_Create
- [GET] VP_Request_Account_Address_List
- [GET] VP_Request_Account_Address_Info
- [PUT] VP_Request_Account_Address_Update
- [DELETE] VP_Request_Account_Address_Delete
账户 > 余额
- [GET] VP_Request_Account_Balance_Current
- [GET] VP_Request_Account_Balance_History
账户 > 个人信息
- [GET] VP_Request_Account_Personal_Details
- [PUT] VP_Request_Account_Personal_Update
配送 > 标签
- [GET] VP_Request_Shipping_Label_Info
- [GET] VP_Request_Shipping_Label_List
- [GET] VP_Request_Shipping_Label_Images
- [POST] VP_Request_Shipping_Label_Calculate
- [POST] VP_Request_Shipping_Label_Print
配送 > 提货
- [GET] VP_Request_Shipping_Pickup_List
- [GET] VP_Request_Shipping_Pickup_Info
- [POST] VP_Request_Shipping_Pickup_Request
配送 > 退款
- [GET] VP_Request_Shipping_Refund_Info
- [GET] VP_Request_Shipping_Refund_List
- [GET] VP_Request_Shipping_Refund_Labels
- [POST] VP_Request_Shipping_Refund_Request
配送 > 扫描表单
- [GET] VP_Request_Shipping_Scan_Info
- [GET] VP_Request_Shipping_Scan_List
- [GET] VP_Request_Shipping_Scan_Labels
- [POST] VP_Request_Shipping_Scan_Create
配送 > 跟踪
- [GET] VP_Request_Shipping_Tracking_Info
位置 > 国家
- [GET] VP_Request_Location_Country_List
位置 > 州
- [GET] VP_Request_Location_State_List