Php Exceptions Overwriting super class throw exception function
<p>I am using a class which is suppose to connect to a bank payment gateway and execute the payment process.</p>

<p>However i am confused as that super class in the execution methord throws several exceptions. </p>

<pre><code>     throw new Exception('Error: The CCV was incorrect for this card.',2);
</code></pre>

<p><strong>AND it stops there,</strong> </p>

<p>however in my class function i need writes  to the DB as declined payment. Since i this function stops in the above code, my error reporting doesn't get executed..</p>

<p>my calling function looks like this</p>

<pre><code>try{
    $dt = new ProcessCreditCardPayment($data);
        $dr = $dt-&gt;getReceipt();
        //print_r($dr);
    $response_code=$dr['txnResponseCode'];
    $this-&gt;successPayment($customer,$payment_ref,$response_code);
}
catch(Exception e){
    $response_code=$e-&gt;getCode();
    $this-&gt;declinedPayment($customer,$payment_ref,$response_code);  
}
</code></pre>

<p>any ideas ... ?</p>
