Php Exceptions覆盖超类抛出异常函数

时间:2012-06-22 02:19:03

标签: php

我正在使用一个类,该类假设连接到银行支付网关并执行支付流程。

然而我很困惑,因为执行方法中的超类引发了几个例外。

     throw new Exception('Error: The CCV was incorrect for this card.',2);

它停在那里,

然而在我的课程功能中,我需要写入数据库作为拒绝付款。由于此函数在上面的代码中停止,我的错误报告不会被执行..

我的调用函数看起来像这样

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

任何想法......?

0 个答案:

没有答案
相关问题