mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:13:26 +08:00
【优化】优化微信支付/支付宝支付回调日志记录可能存在失效的问题。
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
/* 重写样式 */
|
||||
</style>
|
||||
<script type="text/html" template lay-type="Post" lay-url="{{ layui.setter.apiUrl }}Api/SysNLogRecords/GetIndex" lay-done="layui.data.done(d);">
|
||||
|
||||
|
||||
</script>
|
||||
<div class="table-body">
|
||||
<table id="LAY-app-SysNLogRecords-tableBox" lay-filter="LAY-app-SysNLogRecords-tableBox"></table>
|
||||
@@ -86,7 +86,7 @@
|
||||
, util = layui.util
|
||||
, view = layui.view;
|
||||
|
||||
|
||||
|
||||
var searchwhere;
|
||||
//监听搜索
|
||||
form.on('submit(LAY-app-SysNLogRecords-search)',
|
||||
@@ -115,7 +115,7 @@
|
||||
{ type: "checkbox", fixed: "left" },
|
||||
{ field: 'id', title: '序列', width: 70, sort: false },
|
||||
{ field: 'logDate', title: '时间', width: 130, sort: false },
|
||||
{ field: 'logLevel', title: '级别', sort: false, width: 85 },
|
||||
{ field: 'logLevel', title: '级别', sort: false, templet: '#switch_type', width: 105 },
|
||||
{ field: 'logTitle', title: '标题', sort: false, width: 200 },
|
||||
{ field: 'logType', title: '类型', sort: false, width: 150 },
|
||||
//{ field: 'logger', title: '记录器名字', sort: false, width: 105 },
|
||||
@@ -290,4 +290,23 @@
|
||||
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/html" id="switch_type">
|
||||
{{# if(d.logLevel=='Trace'){ }}
|
||||
<button type="button" class="layui-btn layui-btn-xs layui-btn-primary">Trace</button>
|
||||
{{# } else if(d.logLevel=='Debug') { }}
|
||||
<button type="button" class="layui-btn layui-btn-xs layui-btn-normal">Debug</button>
|
||||
{{# } else if(d.logLevel=='Info') { }}
|
||||
<button type="button" class="layui-btn layui-btn-xs layui-btn-disabled">Info</button>
|
||||
{{# } else if(d.logLevel=='Warn') { }}
|
||||
<button type="button" class="layui-btn layui-btn-xs layui-btn-warm">Warn</button>
|
||||
{{# } else if(d.logLevel=='Error') { }}
|
||||
<button type="button" class="layui-btn layui-btn-xs layui-btn-danger">Error</button>
|
||||
{{# } else if(d.logLevel=='Fatal') { }}
|
||||
<button type="button" class="layui-btn layui-btn-xs layui-btn-danger">Fatal</button>
|
||||
{{# } else { }}
|
||||
<button class="layui-btn layui-btn-xs layui-btn-primary layui-border-black">未知</button>
|
||||
{{# } }}
|
||||
</script>
|
||||
@@ -75,19 +75,22 @@ namespace CoreCms.Net.Web.WebApi.Controllers.PayNotify
|
||||
};
|
||||
|
||||
var notify = await _client.ExecuteAsync<AlipayTradeAppPayNotify>(Request, payOptions);
|
||||
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "支付宝支付回调支付宝返回的参数", JsonConvert.SerializeObject(notify));
|
||||
if (notify.TradeStatus == AlipayTradeStatus.Success)
|
||||
{
|
||||
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "支付宝支付回调开始处理订单业务,队列名称:", RedisMessageQueueKey.AliPayNotice);
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.AliPayNotice, JsonConvert.SerializeObject(notify));
|
||||
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "支付宝支付成功回调", JsonConvert.SerializeObject(notify));
|
||||
return AlipayNotifyResult.Success;
|
||||
}
|
||||
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "支付宝支付成功回调", JsonConvert.SerializeObject(notify));
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(LogLevel.Error, LogType.Order, "支付宝支付成功回调异常", JsonConvert.SerializeObject(notify));
|
||||
|
||||
}
|
||||
return NoContent();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "支付宝支付成功回调", "统一下单支付结果通知", ex);
|
||||
NLogUtil.WriteAll(LogLevel.Error, LogType.Order, "支付宝支付成功回调异常", "统一下单支付结果通知", ex);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,16 +82,19 @@ namespace CoreCms.Net.Web.WebApi.Controllers.PayNotify
|
||||
var notify = await _client.ExecuteAsync<WeChatPayUnifiedOrderNotify>(Request, payOptions);
|
||||
if (notify.ReturnCode == WeChatPayCode.Success)
|
||||
{
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.WeChatPayNotice,
|
||||
JsonConvert.SerializeObject(notify));
|
||||
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.WeChatPayNotice, JsonConvert.SerializeObject(notify));
|
||||
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "微信支付成功回调", JsonConvert.SerializeObject(notify));
|
||||
return WeChatPayNotifyResult.Success;
|
||||
}
|
||||
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "微信支付成功回调", JsonConvert.SerializeObject(notify));
|
||||
else
|
||||
{
|
||||
NLogUtil.WriteAll(LogLevel.Error, LogType.Order, "微信支付成功回调", JsonConvert.SerializeObject(notify));
|
||||
}
|
||||
return NoContent();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "微信支付成功回调", "统一下单支付结果通知", ex);
|
||||
NLogUtil.WriteAll(LogLevel.Error, LogType.Order, "微信支付成功回调异常", "统一下单支付结果通知", ex);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user