From 7a3735bc0d4bea8da65e59e16550d0698cac2473 Mon Sep 17 00:00:00 2001 From: ZweiCD <416931358@qq.com> Date: Fri, 17 Jul 2020 12:00:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A5=87=E9=97=A8=E8=87=AA?= =?UTF-8?q?=E6=B5=8B=E9=AA=8C=E7=AD=BE=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/QimenWms.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/QimenWms.php b/src/QimenWms.php index bc799d9..e07c2e0 100644 --- a/src/QimenWms.php +++ b/src/QimenWms.php @@ -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