From 87809fce93d4ae1b2e311f8a19908bb564acd611 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Fri, 4 Aug 2023 15:50:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A8=8B=E5=BA=8F=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E3=80=91=E5=A4=84=E7=90=86=E9=80=80=E6=AC=BE=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/services/pay/storage/WechatPay.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crmeb/crmeb/services/pay/storage/WechatPay.php b/crmeb/crmeb/services/pay/storage/WechatPay.php index ef230cddc..1bfd02e44 100644 --- a/crmeb/crmeb/services/pay/storage/WechatPay.php +++ b/crmeb/crmeb/services/pay/storage/WechatPay.php @@ -111,18 +111,20 @@ class WechatPay extends BasePay implements PayInterface $refundAccount = $opt['refund_account'] ?? 'REFUND_SOURCE_UNSETTLED_FUNDS'; if (isset($opt['wechat'])) { $result = WechatService::refund($outTradeNo, $refundNo, $totalFee, $refundFee, $opUserId, $refundReason, $type, $refundAccount); - if(isset($result['return_code']) && $result['return_code'] != 'SUCCESS') throw new AdminException($result['return_msg']); - if(isset($result['status']) && $result['status'] != 'SUCCESS') throw new AdminException($result['status']); } else { if ($opt['pay_new_weixin_open']) { $result = MiniProgramService::miniRefund($outTradeNo, $totalFee, $refundFee, $opt); - if ($result['errcode'] != 0) throw new AdminException($result['errmsg']); } else { $result = MiniProgramService::refund($outTradeNo, $refundNo, $totalFee, $refundFee, $opUserId, $refundReason, $type, $refundAccount); - if(isset($result['return_code']) && $result['return_code'] != 'SUCCESS') throw new AdminException($result['return_msg']); - if(isset($result['status']) && $result['status'] != 'SUCCESS') throw new AdminException($result['status']); } } + if ($opt['pay_new_weixin_open']) { + if ($result['errcode'] != 0) throw new AdminException($result['errmsg']); + } else { + if (isset($result['return_code']) && $result['return_code'] != 'SUCCESS') throw new AdminException($result['return_msg']); + if (isset($result['result_code']) && $result['result_code'] != 'SUCCESS') throw new AdminException($result['err_code_des']); + if (isset($result['status']) && $result['status'] != 'SUCCESS') throw new AdminException($result['status']); + } } /**