Beispiel #1
0
        /// <summary>
        /// 微信支付的代理服务
        /// </summary>
        /// <returns></returns>
        public void WeixinProxy()
        {
            string openId       = JsApiImplement.GetOpenId(); //获取当前openId
            string bussinessUrl = "";                         //业务网站支付地址

            if (!string.IsNullOrWhiteSpace(openId))
            {
                Redirect(bussinessUrl + "?openId=" + openId);
            }
        }
Beispiel #2
0
 /// <summary>
 /// 获取支付JSON串
 /// </summary>
 /// <param name="orderId"></param>
 /// <param name="money"></param>
 /// <param name="openId"></param>
 /// <returns></returns>
 public string GetPayJson(string orderId, int money, string openId)
 {
     try
     {
         Logger.LoggerFactory.Instance.Logger_Info("发送订单号=" + orderId + ",openID=" + openId);
         //JsApiImplement.GetOpenId();加到主页面上
         return(JsApiImplement.Send(money, orderId, openId));
     }
     catch (Exception ex)
     {
         Logger.LoggerFactory.Instance.Logger_Error(ex);
         return("出错了");
     }
 }
Beispiel #3
0
 //微信回调
 public void Notify()
 {
     JsApiImplement.Notify((model) =>
     {
         Logger.LoggerFactory.Instance.Logger_Info("回调订单号" + model.Out_Trade_No);
         if (model.IsSuccess)
         {
             //微信回调成功
             //更新领域订单状态
         }
         else
         {
             //微信回调失败
         }
     });
 }
Beispiel #4
0
 /// <summary>
 /// 支付页面:如何去拿到OpenId
 /// </summary>
 /// <returns></returns>
 public ActionResult PayPage()
 {
     ViewBag.OpenId = JsApiImplement.GetOpenId();
     return(View());
 }
Beispiel #5
0
 /// <summary>
 /// 第三方子网站通过这个方法拿到当前的code
 /// </summary>
 /// <param name="appid"></param>
 /// <param name="returnUrl"></param>
 public void GetCode(string appid)
 {
     JsApiImplement.GetCode(appid);
 }
Beispiel #6
0
 /// <summary>
 /// 单击支付按钮,斛发的动作
 /// </summary>
 /// <param name="orderId">当前订单号</param>
 /// <param name="money">价格</param>
 /// <param name="openId">主页上产生的openId</param>
 /// <returns></returns>
 public string Get(string orderId, int money, string openId)
 {
     Logger.LoggerFactory.Instance.Logger_Info("发送订单号" + orderId);
     //JsApiImplement.GetOpenId();加到主页面上
     return(JsApiImplement.Send(money, orderId, openId));
 }