dmz9 / insales-api
1.0.2
2017-06-13 20:07 UTC
Requires (Dev)
- phpunit/phpunit: 6.2
This package is not auto-updated.
Last update: 2024-09-29 04:25:51 UTC
README
非常初稿。
使用示例
$key='myApplicationKey';
$token = 'md5-string';
$domain='my-cool-shop.com';
$useHttps=true;
$transport = new \InsalesApi\Transport(
$key,
$token,
$domain,
$useHttps
);
$api = new \InsalesApi\InsalesAPI($transport);
$webhookApi = $api->webhook();
$webhook = $webhookApi->create('http://my-domain.com/callback.php',$webhookApi::MESSAGE_FORMAT_JSON);
具体的模型属性是公开的
$id = $webhook->id;
$format = $webhook->format_type;
$createdAt = $webhook->created_at;
$topic = $webhook->topic;
$address = $webhook->address;
每个响应模型都有这些方法
$lastHeaders = $webhook->getHeaders();
$request = $webhook->getRequest();
$originServerResponse = $webhook->getOriginData();