| 123456789101112131415161718192021222324252627282930313233 |
- <?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' => 0,
- 'orderCode' => '200824000005397109',
- 'billCode' => '73110263178916',
- ]);
- $request->setBody($body);
- return json_decode($client->execute($request));
- }
- }
|