优化微信支付、支付宝支付多种支付终端情况下的一一对应处理。

This commit is contained in:
jianweie
2023-04-26 10:27:06 +08:00
parent 04a8b30413
commit 8a12ab7ea5
5 changed files with 149 additions and 49 deletions

View File

@@ -180,13 +180,16 @@ namespace CoreCms.Net.Services
openId = user.openid;
}
var notifyUrl = config.notifyUrl.EndsWith("/") ? config.notifyUrl + "m-" + config.appId : config.notifyUrl + "/m-" + config.appId;
var orderRequest = new WeChatPayUnifiedOrderRequest
{
Body = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle,
OutTradeNo = entity.paymentId,
TotalFee = Convert.ToInt32(entity.money * 100),
SpBillCreateIp = entity.ip,
NotifyUrl = config.notifyUrl,
NotifyUrl = notifyUrl,
TradeType = tradeType,
//OpenId = openId
};
@@ -233,7 +236,7 @@ namespace CoreCms.Net.Services
jm.status = true;
jm.msg = "创建JSAPI支付环境成功";
jm.data = parameter;
//jm.otherData = response;
jm.otherData = response;
}
//扫码支付
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.NATIVE.ToString())