mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-22 20:07:20 +08:00
【优化】完善微信退款回调流程中如果微信端自己的退款业务出现异常的情况下我们对数据的更新处理。
This commit is contained in:
@@ -124,15 +124,20 @@ namespace CoreCms.Net.Web.WebApi.Controllers.PayNotify
|
|||||||
var notify = await _client.ExecuteAsync<WeChatPayRefundNotify>(Request, payOptions);
|
var notify = await _client.ExecuteAsync<WeChatPayRefundNotify>(Request, payOptions);
|
||||||
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.ReturnCode != WeChatPayCode.Success) return NoContent();
|
||||||
if (notify.RefundStatus == WeChatPayCode.Success)
|
{
|
||||||
{
|
var memo = JsonConvert.SerializeObject(notify);
|
||||||
//Console.WriteLine("OutTradeNo: " + notify.OutTradeNo);
|
|
||||||
var memo = JsonConvert.SerializeObject(notify);
|
var status = notify.RefundStatus == WeChatPayCode.Success
|
||||||
await _billRefundServices.UpdateAsync(p => new CoreCmsBillRefund { memo = memo }, p => p.refundId == notify.OutTradeNo);
|
? (int)GlobalEnumVars.BillRefundStatus.STATUS_REFUND
|
||||||
return WeChatPayNotifyResult.Success;
|
: (int)GlobalEnumVars.BillRefundStatus.STATUS_FAIL;
|
||||||
}
|
|
||||||
return NoContent();
|
await _billRefundServices.UpdateAsync(p => new CoreCmsBillRefund { memo = memo, updateTime = DateTime.Now, status = status }, p => p.refundId == notify.OutTradeNo);
|
||||||
|
|
||||||
|
//这个返回只是告诉回调这个业务我们接收到了。
|
||||||
|
return WeChatPayNotifyResult.Success;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user