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']); + } } /**