示例#1
0
        /*
         * 仅支持支付单
         */
        protected void Page_Load(object sender, EventArgs e)
        {
            B_User.CheckIsLogged(Request.RawUrl);
            M_UserInfo mu = buser.GetLogin(false);

            if (string.IsNullOrEmpty(SiteConfig.SiteInfo.SiteUrl))
            {
                function.WriteErrMsg("错误,管理员未定义网站地址,SiteUrl");
            }
            string siteurl = (SiteConfig.SiteInfo.SiteUrl.TrimEnd('/') + "/PayOnline/");

            if (string.IsNullOrEmpty(PayNo))
            {
                function.WriteErrMsg("请传入支付单号");
            }
            pinfo = paymentBll.SelModelByPayNo(PayNo);
            if (pinfo == null || pinfo.PaymentID < 1)
            {
                function.WriteErrMsg("支付单不存在");
            }
            M_PayPlat payPlat = payPlatBll.SelReturnModel(pinfo.PayPlatID);

            if (!IsPostBack)
            {
                #region 母版页中信息
                logged_div.Visible = true;
                #endregion
                if (pinfo.Status != (int)M_Payment.PayStatus.NoPay)
                {
                    function.WriteErrMsg("支付单不能重复付款");
                }
                Rurl_Href.NavigateUrl = "/Extend/order.aspx";//返回我的订单
                if (pinfo.PaymentNum.Contains("IDC"))
                {
                    Rurl_Href.NavigateUrl = "/Plugins/Domain/ViewHave.aspx";
                }
                string url = Request.CurrentExecutionFilePath;
                urlReq1 = Request.Url.AbsoluteUri.ToString().Substring(0, Request.Url.AbsoluteUri.ToString().LastIndexOf('/'));
                double vmoney   = pinfo.MoneyReal;                //支付金额
                string v_amount = pinfo.MoneyReal.ToString("f2"); //实际支付金额
                if (string.IsNullOrEmpty(PayMethod))
                {
                    #region 现金支付
                    DataTable orderDB1  = orderBll.GetOrderbyOrderNo(pinfo.PaymentNum);//订单表,ZL_OrderInfo
                    int       orderType = 0;
                    if (orderDB1.Rows.Count > 0)
                    {
                        orderType = DataConvert.CLng(orderDB1.Rows[0]["OrderType"]);
                    }
                    DataTable ordertable = orderBll.GetOrderbyOrderNo(pinfo.PaymentNum);
                    if (pinfo.PayPlatID == 0 && !string.IsNullOrEmpty(pinfo.PlatformInfo))//支付宝网银支付
                    {
                        payPlat = payPlatBll.SelModelByClass(M_PayPlat.Plat.Alipay_Bank);
                        alipayBank(pinfo.PlatformInfo);
                    }
                    if (payPlat.PayClass == 99)//线下支付
                    {
                        function.WriteSuccessMsg("信息已记录,请等待商家联系完成线下付款", Rurl_Href.NavigateUrl);
                    }
                    if (payPlat == null || payPlat.PayPlatID < 1)
                    {
                        function.WriteErrMsg("没有找到对应的支付平台信息!");
                    }
                    if (payPlat.PayClass == 100)//货到付款
                    {
                        payinfo_div.Visible = false;
                        AfterPay_Tb.Visible = true;
                        Title = "下单成功!";
                    }
                    else
                    {
                        payinfo_div.Visible = true;
                        AfterPay_Tb.Visible = false;
                    }
                    switch ((M_PayPlat.Plat)payPlat.PayClass)//现仅开通 12:支付宝即时到账和支付宝网银服务,15支付宝网银服务(上方代码中处理),银币与余额服务
                    {
                        #region 各种支付方式
                    case M_PayPlat.Plat.UnionPay:
                        #region 银联在线
                        //gateway = "https://pay3.chinabank.com.cn/PayGate?encoding=UTF-8";
                        //必要的交易信息
                        string wv_amount    = v_amount;                              // 订单金额
                        string wv_moneytype = "CNY";                                 // 币种
                        string wv_md5info;                                           // 对拼凑串MD5私钥加密后的值
                        string wv_mid = payPlat.AccountID;                           // 商户号
                        //v_urlBuilder.Append("http://localhost:86/PayOnline/PayReceive.aspx?PayID=" +payid);
                        string wv_url = urlReq1 + "/PayReceive.aspx?PayNo=" + PayNo; // 返回页地址
                        string wv_oid = pinfo.PayNo;                                 // 推荐订单号构成格式为 年月日-商户号-小时分钟秒
                        //两个备注

                        // wv_mid = "1001";				 商户号,这里为测试商户号20000400,替换为自己的商户号即可
                        // wv_url = "http://localhost/chinabank/Receive.aspx";  商户自定义返回接收支付结果的页面
                        // MD5密钥要跟订单提交页相同,如Send.asp里的 key = "test" ,修改""号内 test 为您的密钥
                        string wkey = payPlat.MD5Key;                                    // 如果您还没有设置MD5密钥请登录我们为您提供商户后台,地址:https://merchant3.chinabank.com.cn/
                        // 登录后在上面的导航栏里可能找到“B2C”,在二级导航栏里有“MD5密钥设置”
                        // 建议您设置一个16位以上的密钥或更高,密钥最多64位,但设置16位已经足够了
                        wv_amount    = v_amount;    // 订单金额
                        wv_moneytype = "CNY";       // 币种
                        //对拼凑串MD5私钥加密后的值
                        wv_mid = payPlat.AccountID; // 商户号
                        wv_oid = pinfo.PayNo;       // 推荐订单号构成格式为 年月日-商户号-小时分钟秒

                        if (wv_oid == null || wv_oid.Equals(""))
                        {
                            DateTime dt       = DateTime.Now;
                            string   wv_ymd   = dt.ToString("yyyyMMdd"); // yyyyMMdd
                            string   wtimeStr = dt.ToString("HHmmss");   // HHmmss
                            wv_oid = wv_ymd + wv_mid + wtimeStr;
                        }
                        string text = wv_amount + wv_moneytype + wv_oid + wv_mid + wv_url + wkey;     // 拼凑加密串
                        wv_md5info = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(text, "md5").ToUpper();
                        //strHiddenField.Append("<input type='hidden' name='v_md5info' value='" + wv_md5info + "'>\n");
                        //strHiddenField.Append("<input type='hidden' name='v_mid' value='" + wv_mid + "'>\n");
                        //strHiddenField.Append("<input type='hidden' name='v_oid' value='" + wv_oid + "'>\n");
                        //strHiddenField.Append("<input type='hidden' name='v_amount' value='" + wv_amount + "' >\n");
                        //strHiddenField.Append("<input type='hidden' name='v_moneytype' value='" + wv_moneytype + "'>\n");
                        //strHiddenField.Append("<input type='hidden' name='v_url' value='" + wv_url + "'>\n");
                        //    //以下几项只是用来记录客户信息,可以不用,不影响支付
                        //    strHiddenField.Append("<input type='hidden' name='v_rcvname' value='" + "" + "'>\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_rcvaddr' value='" + "" + "'>\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_rcvtel' value='" + "" + "'>\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_rcvpost' value='" + "" + "' >\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_rcvemail' value='" + "" + "'>\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_rcvmobile' value='" + "" + "'>\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_ordername' value='" + "" + "' >\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_orderaddr' value='" + "" + "'>\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_ordertel' value='" + "" + "'>\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_orderpost' value='" + "" + "' >\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_orderemail' value='" + "" + "'>\n");
                        //    strHiddenField.Append("<input type='hidden' name='v_ordermobile' value='" + "" + "'>\n");
                        //    strHiddenField.Append("<input type='hidden' name='Package' value='" + Request.QueryString["Package"] + "'>\n");
                        #endregion
                        break;

                    case M_PayPlat.Plat.ChinaUnionPay:
                    {
                        #region 中国银联
                        Dictionary <string, string> param = new Dictionary <string, string>();

                        //以下信息非特殊情况不需要改动
                        param["version"]      = "5.0.0";                                      //版本号
                        param["encoding"]     = "UTF-8";                                      //编码方式
                        param["txnType"]      = "01";                                         //交易类型
                        param["txnSubType"]   = "01";                                         //交易子类
                        param["bizType"]      = "000201";                                     //业务类型
                        param["signMethod"]   = "01";                                         //签名方法
                        param["channelType"]  = "08";                                         //渠道类型
                        param["accessType"]   = "0";                                          //接入类型
                        param["frontUrl"]     = siteurl + "/Return/ChinaUnionPay.aspx";       //前台通知地址
                        param["backUrl"]      = siteurl + "/Return/ChinaUnionPayNotify.aspx"; //后台通知地址
                        param["currencyCode"] = "156";                                        //交易币种

                        //TODO 以下信息需要填写
                        param["merId"]           = payPlat.AccountID;                         //商户号,请改自己的测试商户号,此处默认取demo演示页面传递的参数
                        param["orderId"]         = pinfo.PayNo;                               //商户订单号,8-32位数字字母,不能含“-”或“_”,此处默认取demo演示页面传递的参数,可以自行定制规则
                        param["txnTime"]         = DateTime.Now.ToString("yyyyMMddHHmmss");   //订单发送时间,格式为YYYYMMDDhhmmss,取北京时间,此处默认取demo演示页面传递的参数,参考取法: DateTime.Now.ToString("yyyyMMddHHmmss")
                        param["txnAmt"]          = ((int)(pinfo.MoneyReal * 100)).ToString(); //交易金额,单位分,此处默认取demo演示页面传递的参数
                        LblHiddenValue.InnerHtml = PayHelper.BuildForm("https://101.231.204.80:5000/gateway/api/frontTransReq.do", param);
                        Alipay_Btn.Visible       = true;
                        #endregion
                    }
                    break;

                    case M_PayPlat.Plat.Alipay_Instant:
                        #region 支付宝[即时到帐]
                        string input_charset1 = "utf-8";
                        string notify_url1    = urlReq1 + "/Return/AlipayNotify.aspx"; //付完款后服务器AJAX通知的页面 要用 http://格式的完整路径,不允许加?id=123这类自定义参数
                        string return_url1    = urlReq1 + "/Return/AlipayReturn.aspx"; //付完款后跳转的页面 要用 http://格式的完整路径,不允许加?id=123这类自定义参数
                        string show_url1      = "";
                        string sign_type1     = "MD5";
                        ///////////////////////以下参数是需要通过下单时的订单数据传入进来获得////////////////////////////////
                        //必填参数
                        string price1             = pinfo.MoneyReal.ToString("f2");  //订单总金额,显示在支付宝收银台里的“商品单价”里
                        string logistics_fee1     = "0.00";                          //物流费用,即运费。
                        string logistics_type1    = "POST";                          //物流类型,三个值可选:EXPRESS(快递)、POST(平邮)、EMS(EMS)
                        string logistics_payment1 = "SELLER_PAY";                    //物流支付方式,两个值可选:SELLER_PAY(卖家承担运费)、BUYER_PAY(买家承担运费)
                        string out_trade_no1      = pinfo.PayNo;                     //请与贵网站订单系统中的唯一订单号匹配
                        string subject1           = pinfo.Remark;                    //订单名称,显示在支付宝收银台里的“商品名称”里,显示在支付宝的交易管理的“商品名称”的列表里。
                        string body1            = pinfo.Remark;                      //订单描述、订单详细、订单备注,显示在支付宝收银台里的“商品描述”里
                        string quantity1        = "1";                               //商品数量,建议默认为1,不改变值,把一次交易看成是一次下订单而非购买一件商品。
                        string receive_name1    = "";                                //收货人姓名,如:张三
                        string receive_address1 = "";                                //收货人地址,如:XX省XXX市XXX区XXX路XXX小区XXX栋XXX单元XXX号
                        string receive_zip1     = "";                                //收货人邮编,如:123456
                        string receive_phone1   = "";                                //收货人电话号码,如:0571-81234567
                        string receive_mobile1  = "";                                //收货人手机号码,如:13312341234
                        //---------------------
                        string receive_name    = orderDB1.Rows[0]["Reuser"] + "";    //收货人姓名,如:张三
                        string receive_address = orderDB1.Rows[0]["Jiedao"] + "";    //收货人地址,如:XX省XXX市XXX区XXX路XXX小区XXX栋XXX单元XXX号
                        string receive_zip     = orderDB1.Rows[0]["ZipCode"] + "";   //收货人邮编,如:123456
                        string receive_phone   = orderDB1.Rows[0]["Phone"] + "";     //收货人电话号码,如:0571-81234567
                        string receive_mobile  = orderDB1.Rows[0]["MobileNum"] + ""; //收货人手机号码,如:13312341234
                        //扩展参数——第二组物流方式
                        //物流方式是三个为一组成组出现。若要使用,三个参数都需要填上数据;若不使用,三个参数都需要为空
                        //有了第一组物流方式,才能有第二组物流方式,且不能与第一个物流方式中的物流类型相同,
                        //即logistics_type="EXPRESS",那么logistics_type_1就必须在剩下的两个值(POST、EMS)中选择
                        string logistics_fee_3     = "";                                                    //物流费用,即运费。
                        string logistics_type_3    = "";                                                    //物流类型,三个值可选:EXPRESS(快递)、POST(平邮)、EMS(EMS)
                        string logistics_payment_3 = "";                                                    //物流支付方式,两个值可选:SELLER_PAY(卖家承担运费)、BUYER_PAY(买家承担运费)

                        //扩展参数——第三组物流方式
                        //物流方式是三个为一组成组出现。若要使用,三个参数都需要填上数据;若不使用,三个参数都需要为空
                        //有了第一组物流方式和第二组物流方式,才能有第三组物流方式,且不能与第一组物流方式和第二组物流方式中的物流类型相同,
                        //即logistics_type="EXPRESS"、logistics_type_1="EMS",那么logistics_type_2就只能选择"POST"
                        string logistics_fee_4     = "";                                                        //物流费用,即运费。
                        string logistics_type_4    = "";                                                        //物流类型,三个值可选:EXPRESS(快递)、POST(平邮)、EMS(EMS)
                        string logistics_payment_4 = "";                                                        //物流支付方式,两个值可选:SELLER_PAY(卖家承担运费)、BUYER_PAY(买家承担运费)
                        //扩展功能参数——其他
                        string buyer_email1 = "";                                                               //默认买家支付宝账号
                        string discount1    = "";                                                               //折扣,是具体的金额,而不是百分比。若要使用打折,请使用负数,并保证小数点最多两位数
                        /////////////////////////////////////////////////////////////////////////////////////////////////////
                        //构造请求函数,无需修改
                        B_AliPay_trades_Services aliService1 = new B_AliPay_trades_Services(
                            payPlat.AccountID,
                            payPlat.SellerEmail,
                            return_url1,
                            notify_url1,
                            show_url1,
                            out_trade_no1,
                            subject1,
                            body1,
                            price1,
                            logistics_fee1,
                            logistics_type1,
                            logistics_payment1,
                            quantity1,
                            receive_name1,
                            receive_address1,
                            receive_zip1,
                            receive_phone1,
                            receive_mobile1,
                            logistics_fee_3,
                            logistics_type_3,
                            logistics_payment_3,
                            logistics_fee_4,
                            logistics_type_4,
                            logistics_payment_4,
                            buyer_email1,
                            discount1,
                            payPlat.MD5Key,
                            input_charset1,
                            sign_type1);
                        Alipay_Btn.Visible       = true;
                        LblHiddenValue.InnerHtml = aliService1.Build_Form();
                        #endregion
                        break;

                    case M_PayPlat.Plat.Alipay_H5:
                    {
                        Response.Redirect("/API/Pay/Alipay_H5.aspx?Payno=" + PayNo);
                    }
                    break;

                    case M_PayPlat.Plat.Alipay_Bank:    //支付宝网银,已上方处理
                        break;

                    case M_PayPlat.Plat.Bill:
                        #region 快钱支付
                    {
                        //人民币网关账户号
                        ///请登录快钱系统获取用户编号,用户编号后加01即为人民币网关账户号。
                        string merchantAcctId = payPlat.AccountID;
                        //人民币网关密钥
                        ///区分大小写.请与快钱联系索取
                        String key = payPlat.MD5Key;
                        //字符集.固定选择值。可为空。
                        ///只能选择1、2、3.
                        ///1代表UTF-8; 2代表GBK; 3代表gb2312
                        ///默认值为1
                        string inputCharset = "1";
                        //接受支付结果的页面地址.与[bgUrl]不能同时为空。必须是绝对地址。
                        ///如果[bgUrl]为空,快钱将支付结果Post到[pageUrl]对应的地址。
                        ///如果[bgUrl]不为空,并且[bgUrl]页面指定的<redirecturl>地址不为空,则转向到<redirecturl>对应的地址
                        ///
                        ///快钱通过服务器连接的方式将交易结果发送到[bgUrl]对应的页面地址,在商户处理完成后输出的<result>如果为1,页面会转向到<redirecturl>对应的地址。
                        ///如果快钱未接收到<redirecturl>对应的地址,快钱将把支付结果post到[pageUrl]对应的页面。
                        string bgUrl = "PayOnline/PayResultAlipayInstant.aspx?";
                        //网关版本.固定值
                        ///快钱会根据版本号来调用对应的接口处理程序。
                        ///本代码版本号固定为v2.0
                        string version = "v2.0";
                        //语言种类.固定选择值。
                        ///只能选择1、2、3
                        ///1代表中文;2代表英文
                        ///默认值为1
                        string language = "1";
                        //签名类型.固定值
                        ///1代表MD5签名
                        ///当前版本固定为1
                        string signType = "1";
                        //支付人姓名
                        ///可为中文或英文字符
                        string payerName = "payerName";
                        //支付人联系方式类型.固定选择值
                        ///只能选择1
                        ///1代表Email
                        string payerContactType = "1";
                        //支付人联系方式
                        ///只能选择Email或手机号
                        string payerContact = "";
                        //商户订单号
                        ///由字母、数字、或[-][_]组成
                        string orderId = pinfo.PayNo;        // DateTime.Now.ToString("yyyyMMddHHmmss");
                                                             //订单金额
                        ///以分为单位,必须是整型数字
                        ///比方2,代表0.02元
                        double moneys = DataConverter.CDouble(v_amount);
                        moneys = moneys * 100;
                        string orderAmount = DataConverter.CLng(moneys).ToString();

                        //订单提交时间
                        ///14位数字。年[4位]月[2位]日[2位]时[2位]分[2位]秒[2位]
                        ///如;20080101010101
                        string orderTime = DateTime.Now.ToString("yyyyMMddHHmmss");
                        //商品名称
                        ///可为中文或英文字符
                        string productName = "product";
                        //商品数量
                        ///可为空,非空时必须为数字
                        string productNum = "1";
                        //商品代码
                        ///可为字符或者数字
                        string productId = "1";
                        //商品描述
                        string productDesc = pinfo.Remark;
                        //扩展字段1
                        ///在支付结束后原样返回给商户
                        string ext1 = "";
                        //扩展字段2
                        ///在支付结束后原样返回给商户
                        string ext2 = "";
                        //支付方式.固定选择值
                        ///只能选择00、10、11、12、13、14
                        ///00:组合支付(网关支付页面显示快钱支持的各种支付方式,推荐使用)10:银行卡支付(网关支付页面只显示银行卡支付).11:电话银行支付(网关支付页面只显示电话支付).12:快钱账户支付(网关支付页面只显示快钱账户支付).13:线下支付(网关支付页面只显示线下支付方式).14:B2B支付(网关支付页面只显示B2B支付,但需要向快钱申请开通才能使用)
                        string payType = "00";

                        //银行代码
                        ///实现直接跳转到银行页面去支付,只在payType=10时才需设置参数
                        ///具体代码参见 接口文档银行代码列表
                        string bankId = "";

                        //同一订单禁止重复提交标志
                        ///固定选择值: 1、0
                        ///1代表同一订单号只允许提交1次;0表示同一订单号在没有支付成功的前提下可重复提交多次。默认为0建议实物购物车结算类商户采用0;虚拟产品类商户采用1
                        string redoFlag = "0";

                        //快钱的合作伙伴的账户号
                        ///如未和快钱签订代理合作协议,不需要填写本参数
                        string pid = "";
                        //生成加密签名串
                        ///请务必按照如下顺序和规则组成加密串!
                        String signMsgVal = "";
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "inputCharset", inputCharset);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "pageUrl", siteurl + "Return/Bill99Notify.aspx");
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "bgUrl", bgUrl);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "version", version);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "language", language);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "signType", signType);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "merchantAcctId", merchantAcctId);        //merchantAcctId
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "payerName", payerName);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "payerContactType", payerContactType);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "payerContact", payerContact);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "orderId", orderId);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "orderAmount", orderAmount);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "orderTime", orderTime);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "productName", productName);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "productNum", productNum);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "productId", productId);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "productDesc", productDesc);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "ext1", ext1);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "ext2", ext2);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "payType", payType);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "bankId", bankId);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "redoFlag", redoFlag);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "pid", pid);
                        signMsgVal = Bill99Helper.appendParam(signMsgVal, "key", key);
                        string signMsg = StringHelper.MD5(signMsgVal).ToUpper();

                        Dictionary <string, string> payform_dics = new Dictionary <string, string>();
                        payform_dics.Add("inputCharset", inputCharset);
                        payform_dics.Add("bgUrl", bgUrl);
                        payform_dics.Add("pageUrl", siteurl + "Return/Bill99Notify.aspx");        //服务器接受支付结果的后台地址.与[pageUrl]不能同时为空。必须是绝对地址。
                        payform_dics.Add("version", version);
                        payform_dics.Add("language", language);
                        payform_dics.Add("signType", signType);
                        payform_dics.Add("signMsg", signMsg);
                        payform_dics.Add("merchantAcctId", merchantAcctId);
                        payform_dics.Add("payerName", payerName);
                        payform_dics.Add("payerContactType", payerContactType);
                        payform_dics.Add("orderId", orderId);
                        payform_dics.Add("orderAmount", orderAmount);
                        payform_dics.Add("orderTime", orderTime);
                        payform_dics.Add("productName", productName);
                        payform_dics.Add("productNum", productNum);
                        payform_dics.Add("productId", productId);
                        payform_dics.Add("productDesc", productDesc);
                        payform_dics.Add("ext1", ext1);
                        payform_dics.Add("ext2", ext2);
                        payform_dics.Add("payType", payType);
                        payform_dics.Add("bankId", bankId);
                        payform_dics.Add("redoFlag", redoFlag);
                        payform_dics.Add("pid", pid);
                        payform_dics.Add("Package", Request.QueryString["Package"]);
                        LblHiddenValue.InnerHtml = PayHelper.BuildForm("https://www.99bill.com/gateway/recvMerchantInfoAction.htm", payform_dics);
                        Alipay_Btn.Visible       = true;
                    }
                        #endregion
                        break;

                    case M_PayPlat.Plat.WXPay:
                        #region 微信扫码支付
                    {
                        if (DeviceHelper.GetBrower() == DeviceHelper.Brower.Micro)
                        {
                            Response.Redirect("/PayOnline/wxpay_mp.aspx?payno=" + pinfo.PayNo);
                            return;
                        }
                        pinfo.PlatformInfo = "0";
                        paymentBll.Update(pinfo);
                        WxPayData wxdata = new WxPayData();
                        wxdata.SetValue("out_trade_no", pinfo.PayNo);
                        wxdata.SetValue("body", string.IsNullOrEmpty(pinfo.Remark) ? "微信支付" : pinfo.Remark);
                        wxdata.SetValue("total_fee", Convert.ToInt32(pinfo.MoneyReal * 100));
                        wxdata.SetValue("trade_type", "NATIVE");
                        wxdata.SetValue("notify_url", urlReq1 + "/Return/WxPayReturn.aspx");
                        wxdata.SetValue("product_id", "1");
                        WxPayData result = WxPayApi.UnifiedOrder(wxdata, WxPayApi.Pay_GetByID());
                        if (result.GetValue("return_code").ToString().Equals("FAIL"))
                        {
                            function.WriteErrMsg("商户" + result.GetValue("return_msg"));
                        }
                        Response.Redirect("/PayOnline/WxCodePay.aspx?PayNo=" + pinfo.PayNo + "&wxcode=" + result.GetValue("code_url"));
                    }
                        #endregion
                        break;

                    case M_PayPlat.Plat.Ebatong:
                        #region Ebatong
                    {
                        Dictionary <string, string> ebatong_dics = new Dictionary <string, string>();
                        ebatong_dics.Add("sign_type", "MD5");
                        ebatong_dics.Add("service", "create_direct_pay_by_user");
                        ebatong_dics.Add("partner", payPlat.AccountID);
                        ebatong_dics.Add("input_charset", "UTF-8");
                        ebatong_dics.Add("notify_url", siteurl + "Return/EbatongNotify.aspx");        //服务器异步通知页面路径
                        ebatong_dics.Add("return_url", siteurl + "Return/EbatongReturn.aspx");        //服务器跳转页面
                        ebatong_dics.Add("out_trade_no", pinfo.PayNo);
                        ebatong_dics.Add("subject", pinfo.Remark);
                        ebatong_dics.Add("exter_invoke_ip", Request.UserHostAddress);
                        ebatong_dics.Add("payment_type", "1");
                        ebatong_dics.Add("seller_id", payPlat.AccountID);
                        ebatong_dics.Add("total_fee", pinfo.MoneyReal.ToString("f2"));
                        ebatong_dics.Add("error_notify_url", "");
                        ebatong_dics.Add("anti_phishing_key", new ZoomLa.BLL.Ebatong.AskForTimestamp().askFor(payPlat.AccountID, payPlat.MD5Key));
                        ebatong_dics.Add("seller_email", "");
                        ebatong_dics.Add("buyer_email", "");
                        ebatong_dics.Add("buyer_id", "");
                        ebatong_dics.Add("price", "");
                        ebatong_dics.Add("quantity", "");
                        ebatong_dics.Add("body", "");
                        ebatong_dics.Add("show_url", "");
                        ebatong_dics.Add("pay_method", "bankPay");
                        ebatong_dics.Add("extra_common_para", "");
                        ebatong_dics.Add("extend_param", "");
                        ebatong_dics.Add("it_b_pay", "");
                        ebatong_dics.Add("royalty_type", "");
                        ebatong_dics.Add("royalty_parameters", "");
                        ebatong_dics.Add("default_bank", "");
                        string[] paramts = new string[ebatong_dics.Keys.Count]; //参数排序数组
                        ebatong_dics.Keys.CopyTo(paramts, 0);
                        Array.Sort(paramts);                                    //参数排序操作
                        string paramstr = "";
                        foreach (string item in paramts)
                        {
                            paramstr += string.Format("{0}={1}&", item, ebatong_dics[item]);
                        }
                        //throw new Exception(paramstr.Trim('&'));
                        string md5md5 = new ZoomLa.BLL.Ebatong.CommonHelper().md5("UTF-8", paramstr.Trim('&') + payPlat.MD5Key).ToLower();
                        ebatong_dics.Add("sign", md5md5);
                        LblHiddenValue.InnerHtml = PayHelper.BuildForm("https://www.ebatong.com/direct/gateway.htm", ebatong_dics);
                        Alipay_Btn.Visible       = true;
                    }
                        #endregion
                        break;

                    case M_PayPlat.Plat.CCB:
                        #region 江西建行
                    {
                        Dictionary <string, string> ccb_dics = new Dictionary <string, string>();
                        ccb_dics.Add("MERCHANTID", payPlat.AccountID);    //商户代码
                        ccb_dics.Add("POSID", payPlat.PrivateKey);        //柜台代码
                        ccb_dics.Add("BRANCHID", payPlat.PublicKey);      //分行代码
                        ccb_dics.Add("ORDERID", pinfo.PayNo);
                        ccb_dics.Add("PAYMENT", pinfo.MoneyReal.ToString("f2"));
                        ccb_dics.Add("CURCODE", "01");
                        ccb_dics.Add("REMARK1", "");        //备注信息1(具体信息待测试)
                        ccb_dics.Add("REMARK2", "");        //备注信息2
                        ccb_dics.Add("TXCODE", "520100");
                        string ccb_paramstr = "";
                        foreach (String item in ccb_dics.Keys)
                        {
                            ccb_paramstr += string.Format("{0}={1}&", item, ccb_dics[item]);
                        }
                        string md5str = new ZoomLa.BLL.Ebatong.CommonHelper().md5("UTF-8", ccb_paramstr.Trim('&')).ToLower();
                        ccb_dics.Add("MAC", md5str);
                        LblHiddenValue.InnerHtml = PayHelper.BuildForm("https://ibsbjstar.ccb.com.cn/app/ccbMain", ccb_dics);
                        Alipay_Btn.Visible       = true;
                        //Response.Redirect("https://ibsbjstar.ccb.com.cn/app/ccbMain?" + ccb_paramstr + "MAC=" + md5str);
                    }
                        #endregion
                        break;

                    case M_PayPlat.Plat.ECPSS:
                        #region 汇潮支付
                    {
                        Dictionary <string, string> payData = new Dictionary <string, string>();
                        payData.Add("OrderDesc", "test");                              //订单描述
                        payData.Add("Remark", "汇潮支付");                                 //备注
                        payData.Add("AdviceURL", siteurl + "Return/ECPSSNotfy.aspx");  //回调通知地址
                        payData.Add("ReturnURL", siteurl + "Return/ECPSSResult.aspx"); //返回地址
                        payData.Add("BillNo", pinfo.PayNo);                            //订单号
                        payData.Add("MerNo", payPlat.AccountID);                       //商户号
                        payData.Add("Amount", pinfo.MoneyReal.ToString("f2"));         //交易价格
                        string md5key = payPlat.MD5Key;
                        string md5str = payData["MerNo"] + "&" + payData["BillNo"] + "&" + payData["Amount"] + "&" + payData["ReturnURL"] + "&" + md5key;
                        payData.Add("SignInfo", System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(md5str, "MD5")); //签名
                        payData.Add("defaultBankNumber", "");                                                                               //银行代码(选填)
                        payData.Add("orderTime", DateTime.Now.ToString("yyyyMMddHHmmss"));                                                  //交易时间yyyyMMddHHmmss
                        payData.Add("products", pinfo.Remark);                                                                              //物品信息
                        LblHiddenValue.InnerHtml = PayHelper.BuildForm("https://pay.ecpss.com/sslpayment", payData);
                        Alipay_Btn.Visible       = true;
                    }
                        #endregion
                        break;

                    case M_PayPlat.Plat.ICBC_NC:
                        #region 南昌工行
                    {
                        function.WriteErrMsg("工行支付组件未注册,请联系管理员");
                        //ICBCHelper icbc = new ICBCHelper();
                        //infosecapiLib.infosecClass obj = new infosecapiLib.infosecClass();
                        //Dictionary<string, string> dics = new Dictionary<string, string>();
                        //string posturl = "https://B2C.icbc.com.cn/servlet/ICBCINBSEBusinessServlet";
                        //---Debug
                        //payPlat.AccountID = "1502EC24392836";
                        //payPlat.SellerEmail = "1502201009004747554";
                        //payPlat.PrivateKey = "/Cert/cs.key";
                        //payPlat.PublicKey = "/Cert/cs.cer";
                        //posturl = "https://myipad.dccnet.com.cn/servlet/NewB2cMerPayReqServlet";
                        //throw new Exception(payPlat.PrivateKey + ":" + payPlat.PublicKey + ":" + payPlat.AccountID + ":" + payPlat.SellerEmail);
                        //Debug End
                        //*.z01.com根据需要更改如*.hx008.com
                        //string data = icbc.SpliceTranData(pinfo, payPlat.AccountID.Trim(), payPlat.SellerEmail.Trim(), "*.z01.com", siteurl + "ICBCNotify.aspx");
                        //string sign = obj.sign(data, Server.MapPath(payPlat.PrivateKey), payPlat.MD5Key.Trim());//私钥虚拟路径与私钥密钥
                        //dics.Add("interfaceName", "ICBC_PERBANK_B2C");
                        //dics.Add("interfaceVersion", "1.0.0.11");
                        //dics.Add("tranData", obj.base64enc(data));
                        //dics.Add("merSignMsg", sign);
                        //dics.Add("merCert", icbc.ReadCertToBase64(payPlat.PublicKey));//公钥路径
                        //LblHiddenValue.InnerHtml = new Pay_BaoFa().BuildForm(posturl, dics);
                        //Alipay_Btn.Visible = true;
                    }
                        #endregion
                        break;

                    case M_PayPlat.Plat.CashOnDelivery:
                        #region 货到付款
                        zfpt.Text      = payPlat.PayPlatName;
                        ddh.Text       = pinfo.PaymentNum;
                        PayNum_L2.Text = Convert.ToDecimal(vmoney).ToString("F2") + " 元";
                        sxf.Text       = payPlat.Rate.ToString() + " %";
                        sjhbje.Text    = v_amount + " 元";
                        #endregion
                        break;

                    case M_PayPlat.Plat.PayPal:
                    {
                        Response.Redirect("PP/Pay.aspx?Payno=" + pinfo.PayNo);
                    }
                    break;

                    default:
                        throw new Exception("错误:支付方式不存在:" + payPlat.PayClass);
                        #endregion
                    }
                    VMoneyPayed_L.Text = payPlat.PayPlatName;
                    OrderNo_L.Text     = pinfo.PaymentNum;
                    LblRate.Text       = payPlat.Rate.ToString() + " %";
                    #endregion
                }
                else//非现金支付,给用户显示确认支付页,实际支付行为在Confirm_Click
                {
                    spwd_div.Visible    = (!string.IsNullOrEmpty(mu.PayPassWord));
                    nospwd_div.Visible  = string.IsNullOrEmpty(mu.PayPassWord);//如未设定,则不需要输入二级密码
                    payinfo_div.Visible = true;
                    AfterPay_Tb.Visible = false;
                    OrderNo_L.Text      = pinfo.PaymentNum;
                    DataTable ordertable = orderBll.GetOrderbyOrderNo(pinfo.PaymentNum);
                    if (ordertable != null && ordertable.Rows.Count > 0)
                    {
                        switch (PayMethod)
                        {
                        case "Purse":
                            //Titles.Text = "余额支付操作(确认支付款项)";
                            Fee.Text           = "帐户余额:";
                            LblRate.Text       = mu.Purse + " 元";
                            VMoneyPayed_L.Text = "帐户余额";
                            break;

                        case "SilverCoin":
                            //Titles.Text = "银币支付操作(确认支付款项)";
                            Fee.Text           = "帐户银币:";
                            LblRate.Text       = mu.SilverCoin + " 个";
                            VMoneyPayed_L.Text = "账户银币";
                            break;

                        case "Score":
                            //Titles.Text = "积分支付操作(确认支付款项)";
                            Fee.Text           = "帐户积分:";
                            LblRate.Text       = mu.UserExp + " 分";
                            VMoneyPayed_L.Text = "账户积分";
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        payinfo_div.Visible = false;
                        AfterPay_Tb.Visible = false;
                        function.WriteErrMsg("订单不存在");
                    }
                }
                //显示金额信息
                LblPayMoney.Text = pinfo.MoneyReal.ToString("F2") + " 元";//应付金额
            }
            //------------------检测End;
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      formString2 = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder()
            {
                OrderID = PayHelper.GetOrderIDByPrefix("th")
            };

            if (Fetch.GetUserCookie() != null)
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            else
            {
                onLineOrder.OperUserID = 0;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string str1 = formString2;
            string str2 = str1;

            if (str2 != null)
            {
                switch (str2)
                {
                case "alipay":
                {
                    onLineOrder.ShareID = 2;
                    break;
                }

                case "weixin":
                {
                    onLineOrder.ShareID = 3;
                    break;
                }

                case "alipay-scan":
                {
                    this.paytype        = "支付宝";
                    onLineOrder.ShareID = 4;
                    break;
                }

                case "weixin-scan":
                {
                    this.paytype        = "微信";
                    onLineOrder.ShareID = 5;
                    break;
                }

                case "qq":
                {
                    onLineOrder.ShareID = 6;
                    break;
                }

                case "kuaijie":
                {
                    onLineOrder.ShareID = 7;
                    break;
                }

                case "qq-scan":
                {
                    this.paytype        = "QQ";
                    onLineOrder.ShareID = 8;
                    break;
                }

                case "jd":
                {
                    onLineOrder.ShareID = 9;
                    break;
                }

                case "baidu":
                {
                    onLineOrder.ShareID = 10;
                    break;
                }

                default:
                {
                    goto Label0;
                }
                }
            }
            else
            {
                goto Label0;
            }
Label1:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string gateway = ApplicationSettings.Get("url_th");
            string value   = ApplicationSettings.Get("parter_th");
            string str     = ApplicationSettings.Get("key_th");
            string text    = ApplicationSettings.Get("pay_url");

            if (text == "")
            {
                text = string.Concat("http://", base.Request.Url.Host);
            }
            string orderID = onLineOrder.OrderID;
            string value2  = string.Concat(text, "/pay/tonghui/notify_url.aspx");
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["versionId"]     = "1";
            dictionary["orderAmount"]   = (formInt * 100).ToString();
            dictionary["orderDate"]     = DateTime.Now.ToString("yyyyMMddHHmmss");
            dictionary["currency"]      = "RMB";
            dictionary["accountType"]   = "0";
            dictionary["transType"]     = "008";
            dictionary["asynNotifyUrl"] = value2;
            dictionary["synNotifyUrl"]  = value2;
            dictionary["signType"]      = "MD5";
            dictionary["merId"]         = value;
            dictionary["prdOrdNo"]      = orderID;
            dictionary["payMode"]       = "0";
            dictionary["prdName"]       = "shop";
            dictionary["prdDesc"]       = "shop";
            dictionary["pnum"]          = "1";
            dictionary = (
                from p in dictionary
                orderby p.Key
                select p).ToDictionary <KeyValuePair <string, string>, string, string>((KeyValuePair <string, string> p) => p.Key, (KeyValuePair <string, string> o) => o.Value);
            string password = string.Concat(PayHelper.PrepareSign(dictionary), "&key=", str);

            dictionary["signData"] = TextEncrypt.EncryptPassword(password);
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
            return;

Label0:
            onLineOrder.ShareID = 1;
            goto Label1;
        }
示例#3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            decimal num = GameRequest.GetFormInt("amount", 0);

            if (num < 6m)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("hyf");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = num;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            if (text == "alipay-scan")
            {
                text = "4";
                onLineOrder.ShareID = 4;
            }
            else
            {
                if (text == "weixin-scan")
                {
                    onLineOrder.ShareID = 5;
                }
                else
                {
                    if (text == "kuaijie")
                    {
                        text = "10";
                        onLineOrder.ShareID = 7;
                    }
                }
            }
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string gateway = ApplicationSettings.Get("url_heyifu");
            string value   = ApplicationSettings.Get("partner_heyifu");
            string str     = ApplicationSettings.Get("key_heyifu");
            string text2   = ApplicationSettings.Get("pay_url");

            this.ordernumber = onLineOrder.OrderID;
            this.paymoney    = num.ToString();
            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string value2 = text2 + "/pay/heyifu/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["apiName"]      = "WEB_PAY_B2C";
            dictionary["apiVersion"]   = "1.0.0.0";
            dictionary["platformID"]   = value;
            dictionary["merchNo"]      = value;
            dictionary["orderNo"]      = this.ordernumber;
            dictionary["tradeDate"]    = System.DateTime.Now.ToString("yyyyMMdd");
            dictionary["amt"]          = this.paymoney;
            dictionary["merchUrl"]     = value2;
            dictionary["merchParam"]   = "";
            dictionary["tradeSummary"] = "1|1";
            string str2   = PayHelper.PrepareSign(dictionary);
            string value3 = TextEncrypt.EncryptPassword(str2 + str);

            dictionary["bankCode"]      = "";
            dictionary["choosePayType"] = text;
            dictionary["signMsg"]       = value3;
            dictionary["overTime"]      = "";
            dictionary["customerIP"]    = GameRequest.GetUserIP();
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
            base.Response.End();
        }
示例#4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = base.Request["type"];
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("wsf");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string value = "";
            string text4 = text;

            switch (text4)
            {
            case "alipay":
                text  = "4";
                value = "2";
                onLineOrder.ShareID = 2;
                goto IL_23F;

            case "weixin":
                text  = "3";
                value = "2";
                onLineOrder.ShareID = 3;
                goto IL_23F;

            case "alipay-scan":
                text  = "4";
                value = "1";
                onLineOrder.ShareID = 4;
                goto IL_23F;

            case "weixin-scan":
                text  = "3";
                value = "1";
                onLineOrder.ShareID = 5;
                goto IL_23F;

            case "qq":
                text = "qq-wap";
                onLineOrder.ShareID = 6;
                goto IL_23F;

            case "qq-scan":
                text = "qqsm";
                onLineOrder.ShareID = 8;
                goto IL_23F;

            case "kuaijie":
                text = "wangyin-kj";
                onLineOrder.ShareID = 7;
                goto IL_23F;
            }
            onLineOrder.ShareID = 1;
IL_23F:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string text2 = ApplicationSettings.Get("pay_url");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string value2  = text2 + "/pay/wsfpay/notify_url.aspx";
            string value3  = ApplicationSettings.Get("parter_wsf");
            string str     = ApplicationSettings.Get("key_wsf");
            string gateway = ApplicationSettings.Get("url_wsf");

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["p1_usercode"]  = value3;
            dictionary["p2_order"]     = onLineOrder.OrderID;
            dictionary["p3_money"]     = onLineOrder.OrderAmount.ToString();
            dictionary["p4_returnurl"] = value2;
            dictionary["p5_notifyurl"] = value2;
            dictionary["p6_ordertime"] = System.DateTime.Now.ToString("yyyyMMddHHmmss");
            string text3 = "";

            foreach (System.Collections.Generic.KeyValuePair <string, string> current in dictionary)
            {
                text3 = text3 + current.Value + "&";
            }
            text3 = text3.Remove(text3.Length - 1);
            string value4 = TextEncrypt.EncryptPassword(text3 + str);

            dictionary["p7_sign"]      = value4;
            dictionary["p8_signtype"]  = "1";
            dictionary["p9_paymethod"] = text;
            dictionary["p18_product"]  = "productname";
            dictionary["p25_terminal"] = value;
            dictionary["p26_iswappay"] = value;
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
            base.Response.End();
        }
示例#5
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            decimal num = GameRequest.GetFormInt("amount", 0);

            if (num < 6m)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("jfb");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = num;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            if (text == "alipay")
            {
                text = "1";
                onLineOrder.ShareID = 2;
            }
            if (text == "weixin")
            {
                text = "2";
                onLineOrder.ShareID = 3;
            }
            if (text == "qq")
            {
                text = "3";
                onLineOrder.ShareID = 6;
            }
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string gateway = ApplicationSettings.Get("url_jifubao");
            string value   = ApplicationSettings.Get("partner_jifubao");
            string str     = ApplicationSettings.Get("key_jifubao");
            string text2   = ApplicationSettings.Get("pay_url");

            this.ordernumber = onLineOrder.OrderID;
            this.paymoney    = num.ToString();
            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string value2 = text2 + "/pay/jifubao/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["service"]    = "TRADE.H5PAY";
            dictionary["version"]    = "1.0.0.0";
            dictionary["merId"]      = value;
            dictionary["typeId"]     = text;
            dictionary["tradeNo"]    = this.ordernumber;
            dictionary["tradeDate"]  = System.DateTime.Now.ToString("yyyyMMdd");
            dictionary["amount"]     = this.paymoney;
            dictionary["notifyUrl"]  = value2;
            dictionary["extra"]      = "";
            dictionary["summary"]    = "shop";
            dictionary["expireTime"] = "";
            dictionary["clientIp"]   = GameRequest.GetUserIP();
            string str2   = PayHelper.PrepareSign(dictionary);
            string value3 = TextEncrypt.EncryptPassword(str2 + str).ToLower();

            dictionary["sign"] = value3;
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
            base.Response.End();
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string @string = GameRequest.GetString("account");
            var    @int    = GameRequest.GetFloat("amount", 0);
            int    num     = GameRequest.GetInt("qudaoId", 0);

            if (@int <= 0 || num <= 0 || @string == "")
            {
                base.Response.Write("参数错误");
                base.Response.End();
            }
            string text = ApplicationSettings.Get("pay_url");

            if (text == "")
            {
                text = "http://" + base.Request.Url.Host;
            }
            System.Data.DataTable payInfo = FacadeManage.aideTreasureFacade.GetPayInfo(num);
            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["account"] = @string;
            dictionary["amount"]  = @int.ToString();
            if (payInfo.Rows.Count > 0)
            {
                dictionary["type"]    = payInfo.Rows[0]["QudaoCode"].ToString();
                dictionary["qudaoId"] = payInfo.Rows[0]["qudaoId"].ToString();
                base.Response.Write(PayHelper.BuildForm(dictionary, string.Concat(new object[]
                {
                    text,
                    "/pay/",
                    payInfo.Rows[0]["PlatformCode"],
                    "/send.aspx"
                })));
                base.Response.End();
            }
            else
            {
                if (num == 9)
                {
                    num     = 13;
                    payInfo = FacadeManage.aideTreasureFacade.GetPayInfo(num);
                    if (payInfo.Rows.Count > 0)
                    {
                        dictionary["type"] = payInfo.Rows[0]["QudaoCode"].ToString();
                        base.Response.Write(PayHelper.BuildForm(dictionary, string.Concat(new object[]
                        {
                            text,
                            "/pay/",
                            payInfo.Rows[0]["PlatformCode"],
                            "/send.aspx"
                        })));
                        base.Response.End();
                    }
                    else
                    {
                        base.Response.Write("该通道维护中1");
                        base.Response.End();
                    }
                }
                base.Response.Write("该通道维护中2");
                base.Response.End();
            }
        }
示例#7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("hfht");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text3 = text;

            switch (text3)
            {
            case "alipay":
                text = "alipaywap";
                onLineOrder.ShareID = 2;
                goto IL_289;

            case "weixin":
                text = "wxwap";
                onLineOrder.ShareID = 3;
                goto IL_289;

            case "alipay-scan":
                text                = "alipay";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_289;

            case "weixin-scan":
                text                = "weixin";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_289;

            case "qq":
                text = "qqwap";
                onLineOrder.ShareID = 6;
                goto IL_289;

            case "kuaijie":
                text = "bank";
                onLineOrder.ShareID = 7;
                goto IL_289;

            case "qq-scan":
                text                = "qqcode";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_289;

            case "jd":
                text = "6";
                onLineOrder.ShareID = 9;
                goto IL_289;

            case "baidu":
                text = "5";
                onLineOrder.ShareID = 10;
                goto IL_289;
            }
            text = "4";
            onLineOrder.ShareID = 1;
IL_289:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string gateway = ApplicationSettings.Get("url_hfht");
            string value   = ApplicationSettings.Get("parter_hfht");
            string aKey    = ApplicationSettings.Get("key_hfht");
            string text2   = ApplicationSettings.Get("pay_url");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string orderID = onLineOrder.OrderID;
            string value2  = text2 + "/pay/hfht/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["p0_Cmd"]          = "Buy";
            dictionary["p1_MerId"]        = value;
            dictionary["p2_Order"]        = orderID;
            dictionary["p3_Amt"]          = formInt.ToString();
            dictionary["p4_Cur"]          = "CNY";
            dictionary["p5_Pid"]          = "shop";
            dictionary["p6_Pcat"]         = "shop";
            dictionary["p7_Pdesc"]        = "shop";
            dictionary["p8_Url"]          = value2;
            dictionary["pa_MP"]           = "shop";
            dictionary["pd_FrpId"]        = text;
            dictionary["pr_NeedResponse"] = "1";
            string signSource = PayHelper.GetSignSource(dictionary);

            dictionary["hmac"] = Encrypt.HmacSign(signSource, aKey);
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
        }
示例#8
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string formString = GameRequest.GetFormString("account");

            if (formString == "")
            {
                base.Response.Write("充值账号错误");
                base.Response.End();
            }
            int formInt = GameRequest.GetFormInt("amount", 0);

            if (formInt < 6)
            {
                base.Response.Write("充值金额不能低于6元");
                base.Response.End();
            }
            string      text        = GameRequest.GetFormString("type");
            OnLineOrder onLineOrder = new OnLineOrder();

            onLineOrder.OrderID = PayHelper.GetOrderIDByPrefix("ymf");
            if (Fetch.GetUserCookie() == null)
            {
                onLineOrder.OperUserID = 0;
            }
            else
            {
                onLineOrder.OperUserID = Fetch.GetUserCookie().UserID;
            }
            onLineOrder.Accounts    = formString;
            onLineOrder.OrderAmount = formInt;
            onLineOrder.IPAddress   = GameRequest.GetUserIP();
            string text3 = text;

            switch (text3)
            {
            case "alipay":
                text = "9";
                onLineOrder.ShareID = 2;
                goto IL_283;

            case "weixin":
                text = "13";
                onLineOrder.ShareID = 3;
                goto IL_283;

            case "alipay-scan":
                text                = "4";
                this.paytype        = "支付宝";
                onLineOrder.ShareID = 4;
                goto IL_283;

            case "weixin-scan":
                text                = "5";
                this.paytype        = "微信";
                onLineOrder.ShareID = 5;
                goto IL_283;

            case "qq":
                text = "15";
                onLineOrder.ShareID = 6;
                goto IL_283;

            case "qq-scan":
                text                = "6";
                this.paytype        = "QQ";
                onLineOrder.ShareID = 8;
                goto IL_283;

            case "jd":
                text = "21";
                onLineOrder.ShareID = 9;
                goto IL_283;

            case "jd-scan":
                text = "8";
                onLineOrder.ShareID = 13;
                goto IL_283;

            case "kuaijie":
                text = "1";
                onLineOrder.ShareID = 7;
                goto IL_283;
            }
            onLineOrder.ShareID = 1;
IL_283:
            Message message = FacadeManage.aideTreasureFacade.RequestOrder(onLineOrder);

            if (!message.Success)
            {
                base.Response.Write(message.Content);
                base.Response.End();
            }
            string value   = ApplicationSettings.Get("parter_ymf");
            string key2    = ApplicationSettings.Get("key_ymf");
            string text2   = ApplicationSettings.Get("pay_url");
            string gateway = ApplicationSettings.Get("url_ymf");

            if (text2 == "")
            {
                text2 = "http://" + base.Request.Url.Host;
            }
            string value2 = text2 + "/pay/youmifu/notify_url.aspx";

            System.Collections.Generic.Dictionary <string, string> dictionary = new System.Collections.Generic.Dictionary <string, string>();
            dictionary["apiName"] = "WAP_PAY_B2C";
            if (text == "wangyin")
            {
                dictionary["apiName"] = "WEB_PAY_B2C";
            }
            dictionary["apiVersion"]   = "1.0.0.1";
            dictionary["platformID"]   = value;
            dictionary["merchNo"]      = value;
            dictionary["orderNo"]      = onLineOrder.OrderID;
            dictionary["tradeDate"]    = System.DateTime.Now.ToString("yyyyMMdd");
            dictionary["amt"]          = formInt.ToString() + ".00";
            dictionary["merchUrl"]     = value2;
            dictionary["merchParam"]   = TextUtility.CreateAuthStr(20, false);
            dictionary["tradeSummary"] = "shop";
            dictionary["customerIP"]   = GameRequest.GetUserIP();
            string sourceData = PayHelper.PrepareSign(dictionary);
            string value3     = Jiami.sign(sourceData, key2);

            dictionary["signMsg"]       = value3;
            dictionary["choosePayType"] = text;
            if (text == "wangyin")
            {
                dictionary["choosePayType"] = "1";
            }
            dictionary["bankCode"] = "";
            base.Response.Write(PayHelper.BuildForm(dictionary, gateway));
            base.Response.End();
        }