In our asp.net website use pay u intigraiton for payment, but as per requirement EMI option is not required for payment so how to remove
how to pass drop_category value to pay u hash_sequence
i use like following code , but error occured Transaction failed due to incorrectly calculated hash parameter.
if we remove drop_category then online payment work but i want to pass drop_category for to remove EMI option to pay u transaction using asp.net
Asht TPosted Nov 29, 2023, 11:08 AM
@jayraj Chhaya : Thank u....
but if All functionality will not work if my hash parameter is not calculated correctly
but this is not happening if i remove
drop_category functionality work proper if add drop_category then error occured
Please help me what is mistake in my code...
hashVarsSeq = ConfigurationManager.AppSettings["hashSequence"].Split('|'); // spliting hash sequence from config
hash_string = "";
foreach (string hash_var in hashVarsSeq)
{
if (hash_var == "key")
{
hash_string = hash_string + ConfigurationManager.AppSettings["MERCHANT_KEY"];
hash_string = hash_string + '|';
}
else if (hash_var == "txnid")
{
hash_string = hash_string + txnid1;
hash_string = hash_string + '|';
}
else if (hash_var == "amount")
{
hash_string = hash_string + Convert.ToDecimal(lblFeeon.Text).ToString("g29");
hash_string = hash_string + '|';
}
else if (hash_var == "firstname")
{
hash_string = hash_string + lblNameon.Text.ToString();
hash_string = hash_string + '|';
}
else if (hash_var == "productinfo")
{
hash_string = hash_string + productinfo;
hash_string = hash_string + '|';
}
else if (hash_var == "email")
{
hash_string = hash_string + lblEmailIdon.Text;
hash_string = hash_string + '|';
}
//else if (hash_var == "phone")
//{
// hash_string = hash_string + lblMobileNo.Text;
// hash_string = hash_string + '|';
//}
else if (hash_var == "udf1")
{
hash_string = hash_string + lbls.Text;
hash_string = hash_string + '|';
}
else if (hash_var == "udf2")
{
hash_string = hash_string + lblAdmForm.Text;
hash_string = hash_string + '|';
}
else if (hash_var == "udf3")
{
hash_string = hash_string + txtBr.Text;
hash_string = hash_string + '|';
}
else if (hash_var == "udf4")
{
hash_string = hash_string + lblRName.Text;
hash_string = hash_string + '|';
}
else if (hash_var == "udf5")
{
hash_string = hash_string + txtCrName;
hash_string = hash_string + '|';
}
else if (hash_var == "drop_category")
{
hash_string = hash_string + "EMI";
hash_string = hash_string + '|';
}
//If I remove this code then functionality work proper
}
Jayraj ChhayaPosted Nov 29, 2023, 6:03 AM
To pass the
drop_categoryvalue in the hash sequence for PayU integration in an ASP.NET website, you need to ensure that the hash parameter is correctly calculated. The error you encountered, "Transaction failed due to incorrectly calculated hash parameter," suggests that there might be an issue with the way you are calculating the hash.Here's an example of how you can pass the
drop_categoryvalue in the hash sequence:Make sure to replace
'your_drop_category_value'with the actual value you want to pass fordrop_category. Additionally, ensure that theCalculateHashmethod is implemented correctly to calculate the hash based on the provided hash string.