on the failure page add the following code:
<pre><?php @session_start(); var_dump($_SESSION); ?></pre>
this will write the contents of the session including the full request and full response from the gateway to help troubleshoot.
NOTE: The session contents will contain sensitive data that should be removed before posting here.