public function cancelTransaction($transaction_id, \Exception $error=null)
    {
        $params = array('status' => 'cancelling');
        if($error!=null)
        {
            $params['error'] = array('reason'=>$error->getMessage(), 'trace'=>$error->getTraceAsString());
        }

        $this->updateTransaction(
            array("_id" => $transaction_id),
            array('$set' => $params),
            array("w" => 1, 'upsert'=>true)
        );
    }
public function cancelTransaction($transaction_id, \Exception $error=null)
    {
        $params = array('status' => 'cancelling');
        if($error!=null)
        {
            $params['error'] = array('reason'=>$error->getMessage(), 'trace'=>$error->getTraceAsString());
        }

        $this->updateTransaction(
            array("_id" => $transaction_id),
            array('$set' => $params),
            array("w" => 1, 'upsert'=>true)
        );
    }
public function cancelTransaction ( $ transaction_id , \ Exception $ error = null ) { $ params = array ( 'status' => 'cancelling' ) ; if ( $ error != null ) { $ params [ 'error' ] = array ( 'reason' => $ error -> getMessage ( ) , 'trace' => $ error -> getTraceAsString ( ) ) ; } $ this -> updateTransaction ( array ( "_id" => $ transaction_id ) , array ( '$set' => $ params ) , array ( "w" => 1 , 'upsert' => true ) ) ; }
Updates the status of a transaction to cancelling.
If you passed in an Exception, the exception is logged in the transaction log.

@param string $transaction_id the id of the transaction you wish to cancel
@param \Exception $error pass in the exception you wish to log
Updates the status of a transaction to cancelling . If you passed in an Exception the exception is logged in the transaction log .