/// <summary> /// 实名验证(1分钱) /// </summary> /// <param name="openid"></param> /// <param name="realname"></param> /// <param name="cardid"></param> /// <returns></returns> public JsonResult CheckRealName(string openid, string nickname, string realname, string cardid, string city) { city = "杭州市"; var bus = new Bus(this.DataSource); var isSign = bus.isSign(openid, WxPayConfig.APPID(city), city); var user = bus.GetUserInfo(openid, WxPayConfig.APPID(city)); nickname = (string.IsNullOrEmpty(nickname)) ? "" : nickname; var exdata = bus.Sign(openid, nickname, Request.UserHostAddress, city); var pay = new NativePay(); var paydata = pay.GetPay(openid, realname, cardid, city); if (user != null) { user.DataDriver = this.DataSource; user.Realname = realname; user.Creid = cardid; user.RNameChecked = 0; user.out_trade_no = paydata.GetValue("out_trade_no").ToString(); user.RCheckTime = DateTime.Now; user.Store(); } string timeStamp = paydata.IsSet("timeStamp")? paydata.GetValue("timeStamp").ToString():""; string nonceStr = paydata.IsSet("nonceStr") ? paydata.GetValue("nonceStr").ToString() : ""; string package = paydata.IsSet("package") ? paydata.GetValue("package").ToString() : ""; string signType = paydata.IsSet("signType") ? paydata.GetValue("signType").ToString() : ""; string paySign = paydata.IsSet("paySign") ? paydata.GetValue("paySign").ToString() : ""; return(Json(new { exdata = exdata, isSign = isSign, timeStamp = timeStamp, nonceStr = nonceStr, package = package, signType = signType, paySign = paySign, realname = realname }, JsonRequestBehavior.AllowGet)); }