2Checkout will return credit_card_processed=Y
on all successful sales so your hash check should be firing. On demo sales the 2Checkout MD5 Hash will fail to validate because the returned hash is computed using a "1" for the order number. So in your code, you can match it like so:
if (Request.Params["demo"] == "Y")
{
string order_number = "1";
}
Your post indicates that you are having a problem fetching the returned parameters , not a problem validating the hash so I think the issue is outside of the code that you posted. Please contact 2Checkout tech support at techsupport@2co.com for assistance with troubleshooting the passback.