增加奇门自测验签方法

This commit is contained in:
ZweiCD 2020-07-17 12:00:46 +08:00
parent 23f43aa727
commit 7a3735bc0d

View File

@ -451,7 +451,7 @@ class QimenWms extends BaseWms implements WmsInterface
'stockout.confirm' => 'stockOutConfirm',
];
public function callback($params)
public function callback($params, $onlyCheckSign = false)
{
if (!isset($params['method']) || empty($params['method'])) {
return $this->response('缺少参数method', false);
@ -474,9 +474,6 @@ class QimenWms extends BaseWms implements WmsInterface
if (!isset($params['sign_method']) || empty($params['sign_method'])) {
return $this->response('缺少加密方式', false);
}
if (!isset($params['customerId']) || empty($params['customerId'])) {
return $this->response('缺少参数customerId', false);
}
if (empty(($params['body']))) {
return $this->response('缺少消息body', false);
}
@ -488,6 +485,10 @@ class QimenWms extends BaseWms implements WmsInterface
if (!$this->checkSign($params)) {
return $this->response('签名错误', false);
}
// 用于阿里云自测验签
if ($onlyCheckSign) {
return $this->response();
}
$body = XML2Array::createArray($params['body']);
if (!isset($body['request']) || empty($body['request'])) {
return $this->response('消息body错误', false);
@ -496,6 +497,14 @@ class QimenWms extends BaseWms implements WmsInterface
return $result;
}
/**
* 奇门自测,仅验签
*/
public function onlyCheckSign($params)
{
return $this->callback($params, true);
}
/**
* 发货单确认
* @param $params