如何在payUMoney上成功完成交易?我的交易失败了

时间:2017-10-11 06:50:17

标签: c#

我正在创建PayUMoney支付网关并且即时发送参数到c#代码..然后测试网站打开..在委托测试卡号,CVV,测试名称我的交易流程开始但之后我的交易失败..我不知道它是怎么回事?请帮我解决我的问题。

enter code here

 public string Generatehash512(string text)  //this is Hash generate method
{

    byte[] message = Encoding.UTF8.GetBytes(text);

        UnicodeEncoding UE = new UnicodeEncoding();
        byte[] hashValue;
        SHA512Managed hashString = new SHA512Managed();
        string hex = "";
        hashValue = hashString.ComputeHash(message);
        foreach (byte x in hashValue)
        {
            hex += String.Format("{0:x2}", x);
        }
        return hex;

}

    if (!string.IsNullOrEmpty(hash1))   //all parameter that i sent.
    {
        hash.Value = hash1; 
        txnid.Value = txnid1;

        System.Collections.Hashtable data = new 
         System.Collections.Hashtable(); // adding values in gash table for data post
        data.Add("hash", hash.Value);
        data.Add("key", key.Value);
        data.Add("txnid", txnid.Value);

             string AmountForm = 
          Convert.ToDecimal(amount.Text.Trim()).ToString("g29");// eliminating trailing zeros

            amount.Text = AmountForm;
            data.Add("amount", amount.Text.Trim());
            data.Add("firstname", firstname.Text.Trim());
            data.Add("email", email.Text.Trim());
            data.Add("phone", phone.Text.Trim());
            data.Add("productinfo", productinfo.Text.Trim());
            data.Add("surl", surl.Text.Trim());
            data.Add("furl", furl.Text.Trim());
            data.Add("lastname", lastname.Text.Trim());
            data.Add("curl", curl.Text.Trim());
            data.Add("address1", address1.Text.Trim());
            data.Add("address2", address2.Text.Trim());
            data.Add("city", city.Text.Trim());
            data.Add("state", state.Text.Trim());
            data.Add("country", country.Text.Trim());
            data.Add("zipcode", zipcode.Text.Trim());
            data.Add("udf1", udf1.Text.Trim());
            data.Add("udf2", udf2.Text.Trim());
            data.Add("udf3", udf3.Text.Trim());
            data.Add("udf4", udf4.Text.Trim());
            data.Add("udf5", udf5.Text.Trim());
            data.Add("pg", pg.Text.Trim());
            data.Add("service_provider", service_provider.Text.Trim());
            data.Add("abc", hash_string);

            string strForm = PreparePOSTForm(action1, data);
        Page.Controls.Add(new LiteralControl(strForm));

    }

0 个答案:

没有答案