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);
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string  BillNo        = Request.QueryString["billno"];                    //订单编号
        string  Mercode       = Request.QueryString["mercode"];                   //商户号
        string  Currency_type = Request.QueryString["Currency_type"];             //币种
        decimal Amount        = Convert.ToDecimal(Request.QueryString["amount"]); //订单金额
        string  Date          = Request.QueryString["date"];                      //订单日期
        string  Succ          = Request.QueryString["succ"];                      //是否成功
        string  Msg           = Request.QueryString["msg"];
        string  Attach        = Request.QueryString["attach"];                    //商户数据包
        string  Ipsbillno     = Request.QueryString["ipsbillno"];                 //
        string  Retencodetype = Request.QueryString["retencodetype"];             //交易返回接口加密方式
        string  Signature     = Request.QueryString["signature"];
        string  Bankbillno    = Request.QueryString["bankbillno"];

        IFL.P9.CP901 ifl = new IFL.P9.CP901();
        ifl.FP90110(BillNo, Amount, Succ, Ipsbillno, Bankbillno, Attach);
    }