//查询订单 private bool QueryOrder(OrderqueryInfo info) { // string logStr = @"D:\ppp\log\WXPay\wx_OrderQuery_" + DateTime.Today.ToString("yyyyMMdd") + ".txt"; WxPayDataTool result = new WxPayDataTool(); result = WxPayAction.Orderquery(info); if (!WxPayAction.CheckReturn(result)) { //Util.WriteFile(logStr, @"订单查询信息失败=============" + DateTime.Now.ToString()); //Util.WriteFile(logStr, result.ToJson()); return(false); } else { //Util.WriteFile(logStr, @"订单查询信息成功=============" + DateTime.Now.ToString()); //Util.WriteFile(logStr, result.ToJson()); return(true); } }
//微信(返回二维码链接扫码付)===原生支付 public static string GetQRCode(string body, string NotifyUrl, string orderid, string openid, decimal paymoney) { UnifiedOrderInfo info = new UnifiedOrderInfo() { Body = body, OutTradeNo = orderid, OpenId = "", TotalFee = (int)(Math.Round(paymoney, 2, MidpointRounding.AwayFromZero) * 100), NotifyUrl = NotifyUrl, Trade_type = "NATIVE" }; WxPayDataTool paytool = WxPayAction.UnifiedOrder(info); bool flag = WxPayAction.CheckReturn(paytool); if (flag) { return(paytool.GetValue("code_url").ToString());//获得统一下单接口返回的二维码链接 } else { return(""); } }
//检测返回结果 public static bool CheckReturn(WxPayDataTool result) { return(WxPayAction.CheckReturn(result)); }