Commit 2b22a78d authored by 吴春's avatar 吴春

提交

parent a93d5429
......@@ -46,7 +46,7 @@ namespace Mall.WebApi.App_Code
/// <param name="CustomerId"></param>
/// <param name="openid"></param>
/// <returns></returns>
public static string GetMinUnifiedOrder(string sOrderNo, string sProductName, decimal dPrice, string CustomerId, string openid,string notify_url, RB_MiniProgram_Extend model, IHttpContextAccessor _accessor, string IPAddress)
public static string GetMinUnifiedOrder(string sOrderNo, string sProductName, decimal dPrice, string CustomerId, string openid, string notify_url, RB_MiniProgram_Extend model, IHttpContextAccessor _accessor, string IPAddress)
{
var req = new Common.Pay.WeChatPat.RequestHandler();
req.SetKey(model.WeChatApiSecret);
......@@ -60,7 +60,7 @@ namespace Mall.WebApi.App_Code
req.SetParameter("spbill_create_ip", IPAddress);
req.SetParameter("time_start", DateTime.Now.ToString("yyyyMMddHHmmss"));
req.SetParameter("time_expire", DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss"));
req.SetParameter("notify_url", notify_url );
req.SetParameter("notify_url", notify_url);
req.SetParameter("trade_type", "JSAPI");
req.SetParameter("openid", openid);
req.SetParameter("sign", req.CreateMd5Sign(_accessor, model.WeChatApiSecret));
......@@ -76,7 +76,7 @@ namespace Mall.WebApi.App_Code
});
var xe = XElement.Parse(result, LoadOptions.SetLineInfo);
LogHelper.Write(null, "订单号【" + sOrderNo + "】支付错误:" + xe);
LogHelper.Write(null, "订单号【" + sOrderNo + "】成功回调:" + xe);
try
{
......@@ -324,7 +324,7 @@ namespace Mall.WebApi.App_Code
packageReq.SetParameter("refund_fee", param.RefundFee.Value.ToString(System.Globalization.CultureInfo.InvariantCulture));
packageReq.SetParameter("sign", packageReq.CreateMd5Sign(_accessor, model.WeChatApiSecret));
var reqXml = packageReq.ParseXml();
LogHelper.WriteInfo("退款正式路径" + Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data/Certs/WeChatApp/" + model.WeChatPayCertificateUrl));
var result = Common.Pay.WeChatPat.HttpHelper.Post(new HttpParam()
{
Url = "https://api.mch.weixin.qq.com/secapi/pay/refund",
......@@ -335,6 +335,7 @@ namespace Mall.WebApi.App_Code
});
var xe = XElement.Parse(result, LoadOptions.SetLineInfo);
LogHelper.Write(null, "退款申请【" + param.OrderNumber + "】回调接口:" + xe);
var returnCode = xe.GetElement("return_code").Value;
//退款成功
if (returnCode.Equals("SUCCESS"))
......@@ -395,6 +396,7 @@ namespace Mall.WebApi.App_Code
});
var xe = XElement.Parse(result, LoadOptions.SetLineInfo);
var returnCode = xe.GetElement("return_code").Value;
string outTradeNo = xe.GetElement("out_refund_no_0").Value;
if (returnCode.Equals("SUCCESS"))
......@@ -534,7 +536,7 @@ namespace Mall.WebApi.App_Code
var xe = XElement.Parse(result, LoadOptions.SetLineInfo);
var returnCode = xe.GetElement("return_code") == null ? "" : xe.GetElement("return_code").Value;
var returnMsg = xe.GetElement("return_msg") == null ? "" : xe.GetElement("return_msg").Value;
if (returnCode.Equals("SUCCESS") && returnCode.Equals("SUCCESS"))
{
var code_url = xe.GetElement("code_url") == null ? "" : xe.GetElement("code_url").Value;
......
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