the error is happening because the the following code at lines 14 - 20
//WA eCart Include
needs to be at line 8
to determine why the transaction is failing, add the following code in the body:
<?php @session_start(); var_dump($_SESSION); ?>
this will dump the session contents and will include the full response from paypal.