On the failure page, add the following code in the page body:
<pre><?php @session_start(); var_dump($_SESSION); ?></pre>
this will write the session contents, including the response from the gateway, the gateway response will include details on why the transaction failed.