修复Senparc组件引入后支付bug;调整在线支付单号和订单单号一致;增加支付流水号,方便对账

This commit is contained in:
2019-09-14 23:51:39 +08:00
parent fcca7f76fd
commit 0e679e2d62
9 changed files with 237 additions and 149 deletions
@@ -42,7 +42,7 @@ namespace COMCMS.Web.Controllers
string wxmchId = cfg.MCHId;// ConfigurationManager.AppSettings["WeixinMCHId"];
string wxmchKey = cfg.MCHKey;// ConfigurationManager.AppSettings["WeixinMCHKey"];
TenPayV3Info TenPayV3Info = new TenPayV3Info(appId, appSecrect, wxmchId, wxmchKey, Utils.GetServerUrl() + "/wxpayment/notify", Utils.GetServerUrl() + "/wxpayment/notify");
TenPayV3Info TenPayV3Info = new TenPayV3Info(appId, appSecrect, wxmchId, wxmchKey,"","", Utils.GetServerUrl() + "/wxpayment/notify", Utils.GetServerUrl() + "/wxpayment/notify");
string res = null;
resHandler.SetKey(TenPayV3Info.Key);
@@ -54,7 +54,7 @@ namespace COMCMS.Web.Controllers
string out_trade_no = resHandler.GetParameter("out_trade_no");//商户订单号
XTrace.WriteLine("微信异步通知订单号:" + out_trade_no + ";" + JsonConvert.SerializeObject(resHandler));
OnlinePayOrder payOrder = OnlinePayOrder.Find(OnlinePayOrder._.PayOrderNum == out_trade_no);
OnlinePayOrder payOrder = OnlinePayOrder.Find(OnlinePayOrder._.OrderNum == out_trade_no);
if (payOrder == null)
{
XTrace.WriteLine($"支付成功,但是支付订单不存在:{out_trade_no}");
@@ -67,6 +67,7 @@ namespace COMCMS.Web.Controllers
//更新支付订单
payOrder.PaymentStatus = Utils.PaymentState[1];
payOrder.ReceiveTime = DateTime.Now;
payOrder.OutTradeNo = out_trade_no;
payOrder.IsOK = 1;
payOrder.Update();
@@ -76,6 +77,8 @@ namespace COMCMS.Web.Controllers
{
order.PaymentStatus = Utils.PaymentState[1];
order.PayType = "微信支付";
order.OutTradeNo = out_trade_no;
if (order.MyType == (int)Utils.MyType.分销商认证)
{
order.OrderStatus = Utils.OrdersState[2];