|
@@ -8,9 +8,11 @@ use Yansongda\Supports\Arr;
|
|
|
class Kd100 extends QueryInterface{
|
|
|
protected $key;
|
|
|
protected $customer;
|
|
|
+ protected $secret;
|
|
|
public function __construct()
|
|
|
{
|
|
|
$this->key=Env::get('logistics.kd100_key','fVczXhfg8960');
|
|
|
+ $this->secret=config('site.kd100_secret')?:'kd100';
|
|
|
$this->customer=Env::get('logistics.kd100_customer','B20CCD1C0BAFDD7E69CC986A1A0C57E0');
|
|
|
}
|
|
|
|
|
@@ -102,7 +104,43 @@ class Kd100 extends QueryInterface{
|
|
|
public function labelOrder(){
|
|
|
$params=[
|
|
|
'printType'=>'IMAGE',
|
|
|
- 'partnerId'=>
|
|
|
+ 'partnerId'=>config('site.kd100_lo_partnerId')?:'kd100',
|
|
|
+ 'partnerKey'=>config('site.kd100_lo_partnerKey')?:'kd100',
|
|
|
+ 'partnerSecret'=>config('site.kd100_lo_partnerSecret')?:'kd100',
|
|
|
+ 'partnerName'=>config('site.kd100_lo_partnerName')?:'kd100',
|
|
|
+ 'net'=>config('site.kd100_lo_net')?:'kd100',
|
|
|
+ 'code'=>config('site.kd100_lo_code')?:'kd100',
|
|
|
+ 'checkMan'=>config('site.kd100_lo_checkMan')?:'kd100',
|
|
|
+ 'tbNet'=>config('site.kd100_lo_tbNet')?:'kd100',
|
|
|
+ 'kuaidicom'=>$this->logistics->code_kd100,
|
|
|
+ 'recMan'=>[
|
|
|
+ 'name'=>$this->username,
|
|
|
+ 'mobile'=>$this->phone,
|
|
|
+ 'printAddr'=>$this->getToArea(),
|
|
|
+ ],
|
|
|
+ 'sendMan'=>[
|
|
|
+ 'name'=>$this->getFromUsername(),
|
|
|
+ 'mobile'=>$this->getFromMobile(),
|
|
|
+ 'printAddr'=>$this->getFromArea(),
|
|
|
+ 'cargo'=>$this->getCargo(),
|
|
|
+ 'count'=>$this->getCount(),
|
|
|
+ ],
|
|
|
+ 'tempId'=>config('site.kd100_lo_tempId')?:'kd100',
|
|
|
+ 'orderId'=>$this->getOrderNo(),
|
|
|
];
|
|
|
+ $body=[
|
|
|
+ 'method'=>'order',
|
|
|
+ 'key'=>$this->key,
|
|
|
+ 't'=>time()*1000,
|
|
|
+ 'param'=>$params,
|
|
|
+ ];
|
|
|
+ $body['sign']=md5(json_encode($params,256).$body['t'].$body['key'].$this->secret);
|
|
|
+
|
|
|
+ $response=(new Client)->post('https://api.kuaidi100.com/label/order',[
|
|
|
+ 'json'=>$body,
|
|
|
+ 'http_errors'=>false,
|
|
|
+ ]);
|
|
|
+ $data=json_decode($response->getBody()->getContents(),true);
|
|
|
+ dd($data);
|
|
|
}
|
|
|
}
|