| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Services;
- use App\library\zop\ZopClient;
- use App\library\zop\ZopProperties;
- use App\library\zop\ZopRequest;
- class LogisticZopService
- {
- public function get(array $logisticNums)
- {
- $url = config('api_logistic.ZTO.url');
- $xAppKey = config('api_logistic.ZTO.x-appKey');
- $xDataDigest = config('api_logistic.ZTO.x-dataDigest');
- $properties = new ZopProperties($xAppKey, $xDataDigest);
- $client = new ZopClient($properties);
- $request = new ZopRequest();
- $request->setUrl($url);
- $body = json_encode([
- 'type' => 1,
- 'billCode' => '75424921258500',
- ]);
- $request->setBody($body);
- return json_decode($client->execute($request));
- }
- }
|