【程序目录】处理退款错误提示

This commit is contained in:
evoxwht 2023-08-04 15:50:47 +08:00
parent b58f5f50cf
commit 87809fce93

View File

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