protected void BtnAlipay_Click(object sender, EventArgs e) { AliWapPay pay = new AliWapPay("VYIGO"); string call_back_url = GetNotifyUrl("/Payment/Demo/AliWapPayCallBackDemo.aspx"); string notify_url = GetNotifyUrl("/Payment/Demo/AliWapPayNotifyDemo.aspx"); pay.DirectAliWayPay(this.Response, WIDsubject.Text.Trim(), WIDout_trade_no.Text.Trim(), WIDtotal_fee.Text.Trim(), "001", call_back_url, notify_url); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { errormsg = ""; #region ------------获取请求信息---------------- if (Request["pname"] != null && Request["pname"] != "") { pname = Request["pname"]; } if (Request["ordernum"] != null && Request["ordernum"] != "") { ordernum = Request["ordernum"]; } if (Request["countcost"] != null && Request["countcost"] != "") { countcost = Request["countcost"]; } if (Request["customid"] != null && Request["customid"] != "") { customid = Request["customid"]; } #endregion #region -获取用户openid if (Session["OpenID"] == null || Session["OpenID"].ToString() == "") { if (customid != null && customid != "") { MSCustomersDAL customerDal = new MSCustomersDAL(); try { strOpenID = customerDal.GetCustomerValueByID("OpenID", customid).ToString(); } catch (Exception) { } } } else { strOpenID = Session["OpenID"].ToString(); } #endregion if (Request["action"] != null && Request["action"] != "") { action = Request["action"]; string strSiteCode = "VYIGO"; WXJSAPIPay wxpay = new WXJSAPIPay(strSiteCode); MSProductOrderDAL ptitleDal = new MSProductOrderDAL(); switch (action.Trim().ToLower()) { case "alipay": //ptitleDal.UpdateOrderPayWay(ordernum, "alipay"); //payway= WapPayHelper.BuildRequest(pname, ordernum, countcost, customid); AliWapPay pay = new AliWapPay("VYIGO"); string notify_url = "http://www.vgo2013.com/PalmShop/ShopCode/NotifyUrl.aspx"; string call_back_url = "http://www.vgo2013.com/PalmShop/ShopCode/Alipayreturn.aspx"; pay.DirectAliWayPay(this.Response, pname, ordernum, countcost, customid, call_back_url, notify_url); break; case "wxpay": ptitle = ptitleDal.GetOrderTitleByOID(ordernum); strIP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; decimal countcostx = decimal.Parse(countcost); int v = (Int32)Math.Round(countcostx * 100, 0); try { wxpay.DirectWXJSAPIPay(this.Response, ptitle, ordernum, v, strIP, strOpenID, "http://www.vgo2013.com/PalmShop/ShopCode/PayState.aspx", null, ""); } catch (Exception emsg) { errormsg = JQDialog.alertOKMsgBox(5, emsg.Message, "", "error"); } break; } } GetHtmlPage(); } }