protected void Page_Load(object sender, EventArgs e)
        {
            Log.Info(this.GetType().ToString(), "page load");

            NativePay nativePay = new NativePay();

            //生成扫码支付模式一url
            string url1 = nativePay.GetPrePayUrl("123456789");

            //生成扫码支付模式二url
            string url2 = nativePay.GetPayUrl("123456789");

            //将url生成二维码图片
            if (!url1.Contains("weixin"))
            {
                Response.Write("<span style='color:#FF0000;font-size:20px'>" + url1 + "</span>");
            }
            else
            {
                Image1.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url1);
            }

            if (!url2.Contains("weixin"))
            {
                Response.Write("<span style='color:#FF0000;font-size:20px'>" + url2 + "</span>");
            }
            else
            {
                Image2.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url2);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string    rid       = Request.QueryString["rid"].Filter();
                NativePay nativePay = new NativePay();

                //生成扫码支付模式二url
                string url = nativePay.GetPayUrl(rid);
                if (string.IsNullOrEmpty(url))
                {
                    ltlTips.Text   = "支付异常,请刷新页面重试";
                    Image2.Visible = false;
                }
                else
                {
                    //将url生成二维码图片
                    Image2.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url);
                }
            }
            catch (Exception)
            {
                ltlTips.Text   = "支付异常,请刷新页面重试err";
                Image2.Visible = false;
            }
        }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //此页面的ajax提交,全部采用了POST方式
     if (Request.ServerVariables["REQUEST_METHOD"] == "GET")
     {
         //初始化数据
         initData();
         //学员头像
         if (acc == null)
         {
             Response.Redirect("/student/index.ashx");
             return;
         }
         if (!System.IO.File.Exists(WeiSha.Common.Upload.Get["Accounts"].Physics + acc.Ac_Photo))
         {
             accphoto = WeiSha.Common.Upload.Get["Accounts"].Virtual + acc.Ac_Photo;
         }
         Song.Entities.MoneyAccount maccount = Business.Do <IAccounts>().MoneySingle(serial);
         if (maccount != null && maccount.Ma_IsSuccess)
         {
             return;
         }
         //开始生成二维码
         NativePay nativePay = new NativePay();
         //****生成扫码支付模式二url
         //付款方信息
         string buyer = string.Empty;
         if (acc != null)
         {
             buyer = string.IsNullOrWhiteSpace(acc.Ac_MobiTel1) ? acc.Ac_AccName : acc.Ac_MobiTel1;
         }
         //平台名称,会显示在支付界面(微信扫码后,在手机中显示)
         Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
         string url2 = nativePay.GetPayUrl(total_fee.ToString(), org.Org_PlatformName, serial, total_fee, appid, mchid, paykey, notify_url, buyer);
         //将url生成二维码图片
         //Image1.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url1);
         Image2.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url2);
     }
     //此页面的ajax提交,全部采用了POST方式
     if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
     {
         //监听充值是否完成,通过商户订号判断
         Song.Entities.MoneyAccount maccount = Business.Do <IAccounts>().MoneySingle(serial);
         int state = 0;
         Log.Info(this.GetType().ToString(), "商户流水号 : " + serial);
         if (maccount != null)
         {
             Log.Info(this.GetType().ToString(), "支付状态 : " + maccount.Ma_IsSuccess);
             if (maccount.Ma_IsSuccess)
             {
                 state = 1;
             }
         }
         Response.Write(state);
         Response.End();
     }
 }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Log.Info(this.GetType().ToString(), "page load");

            NativePay nativePay = new NativePay();

            //生成扫码支付模式一url
            string url1 = nativePay.GetPrePayUrl("123456789");

            //生成扫码支付模式二url
            string url2 = nativePay.GetPayUrl("123456789");

            //将url生成二维码图片
            Image1.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url1);
            Image2.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url2);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Log.Info(this.GetType().ToString(), "page load");

            NativePay nativePay = new NativePay();

            //生成扫码支付模式一url
            string url1 = nativePay.GetPrePayUrl("123456789");

            //生成扫码支付模式二url
            string url2 = nativePay.GetPayUrl("123456789");

            //将url生成二维码图片
            Image1.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url1);
            Image2.ImageUrl = "MakeQRCode.aspx?data=" + HttpUtility.UrlEncode(url2);
        }