This commit is contained in:
zpc 2025-09-27 15:13:04 +08:00
parent 361c24b063
commit 40e8e310ed
2 changed files with 18 additions and 3 deletions

View File

@ -470,6 +470,7 @@ namespace CoreCms.Net.Services
return res;
}
//生成支付单,只是单纯的生成了支付单
var result = await ToAdd(sourceStr, paymentCode, userId, type, @params);
if (result.status == false)
@ -604,9 +605,13 @@ namespace CoreCms.Net.Services
}
paymentRelData = paymentRel.data as CheckPayDTO;
}
var paymentId = CommonHelper.GetSerialNumberType((int)GlobalEnumVars.SerialNumberType.);
if (string.IsNullOrEmpty(sourceStr) && type == (int)GlobalEnumVars.BillPaymentsType.GeZiFei)
{
sourceStr = paymentId;
}
var billPayments = new CoreCmsBillPayments();
billPayments.paymentId = CommonHelper.GetSerialNumberType((int)GlobalEnumVars.SerialNumberType.);
billPayments.paymentId = paymentId;
billPayments.sourceId = sourceStr;
billPayments.money = paymentRelData.money;
billPayments.userId = userId;

View File

@ -114,8 +114,18 @@ namespace CoreCms.Net.Web.WebApi.Controllers.PayNotify
{
try
{
Request.EnableBuffering(); // 允许多次读取流
string body = "";
using (var reader = new StreamReader(Request.Body, Encoding.UTF8, leaveOpen: true))
{
body = await reader.ReadToEndAsync();
Request.Body.Position = 0; // 重置流指针,保证后续能再次读取
}
//打印原始请求内容(方便定位问题)
NLogUtil.WriteAll(LogLevel.Trace, LogType.Refund, "退款收到消息", body);
var notify = await _client.ExecuteAsync<WeChatPayRefundNotify>(Request, _optionsAccessor.Value);
NLogUtil.WriteAll(LogLevel.Trace, LogType.Refund, "微信退款结果通知", JsonConvert.SerializeObject(notify));
NLogUtil.WriteAll(LogLevel.Trace, LogType.Refund, "订单已全额退款", JsonConvert.SerializeObject(notify));
if (notify.ReturnCode == WeChatPayCode.Success)
if (notify.RefundStatus == WeChatPayCode.Success)