Esempio n. 1
0
    public static string ebillingForm(string OrderID, string ChargeArm, string LoginName)
    {
        Tz888.BLL.Conn dal   = new Tz888.BLL.Conn();
        DataTable      dt    = dal.GetList("EbilingICPcodeTab", "Amount,CPCODE", "ID", 1, 1, 0, 1, "Amount=" + Convert.ToDouble(ChargeArm));
        string         PCode = "";

        if (dt.Rows.Count > 0)
        {
            PCode = dt.Rows[0]["CPCODE"].ToString().Trim();
        }
        else
        {
            return("");
        }
        string targetURL = DomainName.PayDomain() + "/ebiling/response.aspx?order_no=" + OrderID; //付费完成地址 使用者

        string Charge    = (Convert.ToDouble(ChargeArm) * 100).ToString();                        //付费金额 ----除以100即为真实额度
        string UId       = LoginName;                                                             //会员ID 使用ICP服务的使用者ID 注册会员 20个字以内
        string DateTime_ = DateTime.Now.ToString();                                               //传送时间

        string UIResize    = "0";                                                                 //窗口大小模式 0不能放大窗口 1可以放大
        string FormMethod  = "POST";                                                              //提交方式
        string Target      = "_self";                                                             //窗口位置
        string Corporation = "1";                                                                 //固定变量
        string billingURL  = DomainName.VipDomain() + "/PayManage/return_ebilling.aspx";          //付费结束URL 服务器

        string billingKind = "1";                                                                 //固定变量
        string Quote       = "0";                                                                 //固定变量
        string CpDemand    = OrderID;                                                             //订单号


        string txt = "";

        txt = txt + "targetURL=" + targetURL + ",";
        txt = txt + "PCode=" + PCode + ",";
        txt = txt + "Charge=" + Charge + ",";
        txt = txt + "UId=" + UId + ",";
        txt = txt + "DateTime=" + DateTime_ + ",";
        txt = txt + "UIResize=" + UIResize + ",";
        txt = txt + "FormMethod=" + FormMethod + ",";
        txt = txt + "Target=" + Target + ",";
        txt = txt + "Corporation=" + Corporation + ",";
        txt = txt + "billingURL=" + billingURL + ",";
        txt = txt + "billingKind=" + billingKind + ",";
        txt = txt + "Quote=" + Quote + ",";
        txt = txt + "CpDemand=" + CpDemand;
        string url    = "http://billing.ebilling.net.cn/ebilling.asp"; //正式地址
        string EncTxt = new SOFTFAMILYLib.PayClass().Encode(txt);      // 对输出数据加密

        string htmlCode = @"
							<form name=frmPay  action="""                             + url + @"""' method=post>
							<input type=""hidden"" name=""request""   value="""                             + EncTxt + @""">
						    <input type=""submit"" style=""display:none"" id=""submit""/>
							</form>
							<script language=""javascript"">
							document.all.submit.click();
							</script>"                            ;

        return(htmlCode);
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        wt("接受参数");
        try
        {
            string icpData = new SOFTFAMILYLib.PayClass().Decode(Request.Params["Data"]);
            wt(icpData);
            if (icpData.Length > 8)
            {
                //Get the parameters from a string
                pCode       = icpData.Substring(0, 8);    //产品编号
                dateTime    = icpData.Substring(8, 14);
                caller_id   = icpData.Substring(22, 16);  //付费电话号码
                loginname   = icpData.Substring(38, 20);  //充值帐户
                charge      = icpData.Substring(58, 9);   //金额
                demand_data = icpData.Substring(67, 40);  //订单号
                index_no    = icpData.Substring(107, 16); //eBilling服务器认证的付费序号
                string str        = icpData.Substring(23 - 1, 16) + icpData.Substring(59 - 1, 9) + icpData.Substring(108 - 1, 16);
                bool   cz_success = OnlineStrike.isSuccess(demand_data);
                if (!cz_success)//
                {
                    //开始充值
                    bool b = dal.StrikeSuccess(demand_data, "ebilling", index_no, loginname);
                    Response.Write((new SOFTFAMILYLib.PayClass()).Encode(str));
                    wt((new SOFTFAMILYLib.PayClass()).Encode(str));
                }
            }
            else
            {
                Response.Write("Error!");
            }
        }
        catch (Exception ex)
        {
            //Response.Write(ex.Message);
            wt(ex.Message);
        }

        //写入日志
    }