更新 Admin.NET/Admin.NET.Core/Service/Wechat/SysWechatPayService.cs

解决“订单改价”后无法再次发起支付的问题。
再次提交时,商户交易单号相同,但金额不同,微信会拒绝发起支付。
This commit is contained in:
coolcalf 2025-07-12 09:57:40 +08:00
parent 022c197d46
commit b7bb1ccb2e

View File

@ -92,7 +92,7 @@ public class SysWechatPayService : IDynamicApiController, ITransient
SysWechatPay wechatPay = null; SysWechatPay wechatPay = null;
if (!string.IsNullOrEmpty(input.OrderId)) if (!string.IsNullOrEmpty(input.OrderId))
{ {
wechatPay = await _sysWechatPayRep.GetFirstAsync(u => u.OrderId == input.OrderId && u.OrderStatus == input.OrderStatus); wechatPay = await _sysWechatPayRep.GetFirstAsync(u => u.OrderId == input.OrderId && u.OrderStatus == input.OrderStatus && input.Total == u.Total);
if (wechatPay != null) if (wechatPay != null)
{ {
outTradeNumber = wechatPay.OutTradeNumber; outTradeNumber = wechatPay.OutTradeNumber;