Commit 9fd31c84 authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents 1d129701 33cb5928
...@@ -92,6 +92,62 @@ namespace Mall.WebApi.Controllers.AppletWeChat ...@@ -92,6 +92,62 @@ namespace Mall.WebApi.Controllers.AppletWeChat
} }
/// <summary>
/// 订单支付回调
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
public string NotifyZhouTian()
{
var req = new RequestHandler();
App_Code.PayUtil PayUtil = new App_Code.PayUtil();
var result = PayUtil.NotifyZhouTian(_accessor);
if (result.IsSuccess)
{
var dic = ((Dictionary<string, string>)result.Data);
//开始回写订单状态
lock (_lock)
{
string sOrderNo = dic["sOrderNo"];//订单号 时间挫+OrderId
int OrderId = Convert.ToInt32(sOrderNo[17..]);
decimal dPaid = Convert.ToDecimal(dic["dPrice"]) / 100;
string sPayerOpenID = dic["sPayerOpenID"];
int UserId = Convert.ToInt32(dic["bIsRecharge"]);
string TransactionId = dic["sTradeNo"];
string PayType = dic["OrderPayType"];
DateTime PayDate = DateTime.ParseExact(dic["PayDate"], "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);//转换时间// Convert.ToDateTime(dic["PayDate"]);
#region 新增订单支付信息
userCommonModule.InsertOrderPayInfo(UserId, OrderId, sOrderNo, TransactionId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, PayType, dPaid, PayDate, 0);
#endregion
}
//告诉微信我们已经处理成功,不需要再调用我们的接口了
req.SetParameter("return_code", "SUCCESS");
req.SetParameter("return_msg", "OK");
var reqXml = req.ParseXml();
return reqXml;
// return ApiResult.Success("", reqXml);
}
else
{
req.SetParameter("return_code", "FAIL");
req.SetParameter("return_msg", "订单失败");
var reqXmlFAIL = req.ParseXml();
LogHelper.Write(null, "Notify返回信息:" + reqXmlFAIL);
return reqXmlFAIL;
// return ApiResult.Failed("", reqXmlFAIL);
}
}
/// <summary> /// <summary>
/// 会员充值支付回调 /// 会员充值支付回调
/// </summary> /// </summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment