Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //GetBankCode(Mer_code, Mer_code + SignMD5);
        Amount       = float.Parse(Request.QueryString["Amount"]).ToString("0.00");
        Attach       = "系统测试";
        DoCredit     = Request.QueryString["DoCredit"].Trim();
        Bankco       = Request.QueryString["Bankco"].Trim();
        Gateway_Type = Request.QueryString["Gateway_Type"].Trim();
        //BillNo = Request.QueryString["Billno"].Trim();
        //Attach = Request.QueryString["Attach"].Trim();
        IFL.P9.CP901 ifl = new IFL.P9.CP901();
        string       res = ifl.FP90102(Convert.ToDecimal(Amount), DoCredit, Bankco);

        BillNo = res.Split('%')[0];
        Attach = res.Split('%')[1];

        //Merchanturl = "http://www.vanch.cd/UIF/Pay/IPS/ReturnBridge.aspx?V=2.01";
        //FailUrl = "";
        //ServerUrl = "http://w.vanch.com:81/PAY/ReturnPay.aspx";
        Merchanturl = "http://www.vanch.co/UIF/Pay/IPS/ReturnBridge.aspx?V=2.01";
        FailUrl     = "";
        ServerUrl   = "http://w.vanch.com:82/PAY/ReturnPay.aspx";
        string Url = "http://pay.ips.net.cn/ipayment.aspx";

        SignMD5 = "billno" + BillNo + "currencytypeRMBamount" + Amount + "date" + Date + "orderencodetype" + OrderEncodeType + SignMD5;
        SignMD5 = FormsAuthentication.HashPasswordForStoringInConfigFile(SignMD5, "MD5").ToLower();

        //Post方式提交表单
        string postForm = "<form name=\"IPS\" id=\"IPS\" method=\"post\" action=\"" + Url + "\">";

        postForm += "<input type=\"hidden\" name=\"Mer_code\" value=\"" + Mer_code + "\" />";
        postForm += "<input type=\"hidden\" name=\"BillNo\" value=\"" + BillNo + "\" />";
        postForm += "<input type=\"hidden\" name=\"Amount\" value=\"" + Amount + "\" />";
        postForm += "<input type=\"hidden\" name=\"Date\" value=\"" + Date + "\" />";
        postForm += "<input type=\"hidden\" name=\"Currency_Type\" value=\"" + Currency_Type + "\" />";
        postForm += "<input type=\"hidden\" name=\"Gateway_Type\" value=\"" + Gateway_Type + "\" />";
        postForm += "<input type=\"hidden\" name=\"Lang\" value=\"" + Lang + "\" />";
        postForm += "<input type=\"hidden\" name=\"Merchanturl\" value=\"" + Merchanturl + "\" />";
        postForm += "<input type=\"hidden\" name=\"FailUrl\" value=\"" + FailUrl + "\" />";
        postForm += "<input type=\"hidden\" name=\"Attach\" value=\"" + Attach + "\" />";
        postForm += "<input type=\"hidden\" name=\"OrderEncodeType\" value=\"" + OrderEncodeType + "\" />";
        postForm += "<input type=\"hidden\" name=\"RetEncodeType\" value=\"" + RetEncodeType + "\" />";
        postForm += "<input type=\"hidden\" name=\"Rettype\" value=\"" + Rettype + "\" />";
        postForm += "<input type=\"hidden\" name=\"ServerUrl\" value=\"" + ServerUrl + "\" />";
        postForm += "<input type=\"hidden\" name=\"SignMD5\" value=\"" + SignMD5 + "\" />";
        postForm += "<input type=\"hidden\" name=\"DoCredit\" value=\"" + DoCredit + "\" />";
        postForm += "<input type=\"hidden\" name=\"Bankco\" value=\"" + Bankco + "\" />";
        postForm += "</form>";

        postForm += "<script language=\"javascript\"> window.parent.opener.P9.OrderSN = '" + BillNo + "';document.getElementById(\"IPS\").submit();</script>";

        Response.Write(postForm);
    }