Commit b27b92ea authored by 吴春's avatar 吴春

提交代码

parent 83958d86
......@@ -242,7 +242,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
public BaseResult Refund(PayParam param)
public BaseResult Refund(PayParam param, RB_MiniProgram_Extend model)
{
App_Code.PayUtil payUtil = new App_Code.PayUtil();
......@@ -251,8 +251,6 @@ namespace Mall.WebApi.Controllers.AppletWeChat
return new BaseResult() { IsSuccess = false, Message = "参数错误!" };
}
#region 微信退款
RB_MiniProgram_Extend model = new RB_MiniProgram_Extend();
var packageReq = new RequestHandler();
packageReq.SetKey(model.WeChatApiSecret);
packageReq.SetParameter("appid", model.MiniAppId);
......@@ -296,8 +294,30 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
}
else {//查询退款情况
packageReq = new RequestHandler();
packageReq.SetKey(model.WeChatApiSecret);
packageReq.SetParameter("appid", model.MiniAppId);
packageReq.SetParameter("mch_id", model.WeChatPayMerchants);
packageReq.SetParameter("nonce_str", payUtil.GetNoncestr());
packageReq.SetParameter("sign", packageReq.CreateMd5Sign(_accessor));
packageReq.SetParameter("out_refund_no", param.RefundNumber);
reqXml = packageReq.ParseXml();
result = Common.Pay.WeChatPat.HttpHelper.Post(new HttpParam()
{
Url = "https://api.mch.weixin.qq.com/pay/refundquery",
PostParam = reqXml,
Encoding = Common.Pay.WeChatPat.HttpHelper.GetRequestEncoding(_accessor.HttpContext.Request),
});
xe = XElement.Parse(result, LoadOptions.SetLineInfo);
returnCode = xe.GetElement("return_code").Value;
if (returnCode.Equals("SUCCESS"))
{
}
}
var errCodeDes = xe.GetElement("err_code_des") == null ? "" : xe.GetElement("err_code_des").Value;
var returnMsg = xe.GetElement("return_msg") == null ? "" : xe.GetElement("return_msg").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