From 9f274808609980f66e85f0a994e178ebeb920018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 25 Sep 2024 13:08:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WeChat/Contracts/BasicWePay.php | 2 +- WePay/Refund.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WeChat/Contracts/BasicWePay.php b/WeChat/Contracts/BasicWePay.php index 7af01a4..097b0ab 100644 --- a/WeChat/Contracts/BasicWePay.php +++ b/WeChat/Contracts/BasicWePay.php @@ -92,7 +92,7 @@ public static function instance(array $config) /** * 获取微信支付通知 - * @param string $xml + * @param string|array $xml * @return array * @throws \WeChat\Exceptions\InvalidResponseException */ diff --git a/WePay/Refund.php b/WePay/Refund.php index 14c61b0..4f068cb 100644 --- a/WePay/Refund.php +++ b/WePay/Refund.php @@ -57,14 +57,14 @@ public function query(array $options) /** * 获取退款通知 - * @param string $xml + * @param string|array $xml * @return array * @throws \WeChat\Exceptions\InvalidDecryptException * @throws \WeChat\Exceptions\InvalidResponseException */ public function getNotify($xml = '') { - $data = Tools::xml2arr(empty($xml) ? Tools::getRawInput() : $xml); + $data = is_array($xml) ? $xml : Tools::xml2arr(empty($xml) ? Tools::getRawInput() : $xml); if (!isset($data['return_code']) || $data['return_code'] !== 'SUCCESS') { throw new InvalidResponseException('获取退款通知XML失败!'); }