opensdk / caotravel
曹操出行SDK
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:libaray
Requires
- php: >=7.0.0
Requires (Dev)
- php: >=7.0.0
This package is not auto-updated.
Last update: 2024-11-14 22:39:02 UTC
README
介绍
曹操出行SDK
使用示例
require '../vendor/autoload.php'; use OpenSDK\CaoTravel\Client; use OpenSDK\CaoTravel\Requests\CaoTravelOrdersQueryGetRequest; class CaoTravelOrdersQueryGetRequestTest { public function __invoke() { $c = new Client(); $c->appKey = $this->appKey; $c->appSecret = $this->appSecret; $c->gatewayUrl = $this->url; $req = new CaoTravelOrdersQueryGetRequest(); $oid = '164418193202242'; $req->setOrderId($oid); $req->setTimestamp(self::msectime()); $c->execute($req); $response = $c->result(); if(empty($response) || !isset($response['code']) || $response['code']!=200){ echo '无结果';exit; } var_dump($response);exit; } public static function msectime() { list($msec, $sec) = explode(' ', microtime()); $msectime = (int)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000); return $msectime; } }