private function processPayoutStatus() {
     $transaction = new Pap_Common_Transaction();
     $transaction->setId($this->getTransactionID());
     try {
         $transaction->load();
     } catch (Gpf_DbEngine_NoRowException $e) {
     	$this->setPaymentStatus($this->getPaymentStatusFromMoneyBookersFormat());
     	return true;
     }
     
     if ($this->checkRefundChargeback()) {
     	return false;
     }
     
     $transaction->setPayoutStatus($this->getPaymentStatusFromMoneyBookersFormat());
     $transaction->save();
     $this->debug('ended - existing transaction updated, transactionID: ' . $this->getTransactionID());
     return false;
 }
    private function changeTransactionStatus($transactionId, $status, $note, $forOnlyPendingTransactions = false) {
        $transaction = new Pap_Common_Transaction();
        $transaction->setId($transactionId);
        $transaction->load();

        if ($transaction->getStatus() == $status) {
            return true;
        }
        if ($forOnlyPendingTransactions && $transaction->getStatus() != Pap_Common_Constants::STATUS_PENDING) {
            return false;
        }

        try {
            Gpf_Plugins_Engine::extensionPoint('PostAffiliate.TransactionForm.changeTransactionStatus', $transaction);
        } catch (Gpf_Exception $e) {
            return false;
        }

        $transaction->setStatus($status);
        $transaction->setMerchantNote($note);
        $transaction->update(array(Pap_Db_Table_Transactions::R_STATUS, Pap_Db_Table_Transactions::MERCHANTNOTE, Pap_Db_Table_Transactions::DATE_APPROVED));
        return true;
    }
 /** 
  * @return Pap_Common_Transaction
  */
 protected function getTransaction($id) {
     $transaction = new Pap_Common_Transaction();
     $transaction->setId($id);
     $transaction->load();
     return $transaction;
 }
 /**
  * @return Pap_Common_Transaction
  */
 public function getTransaction() {
     $transaction = new Pap_Common_Transaction();
     $transaction->setId($this->getTransactionId());
     $transaction->load();
     return $transaction;
 }