private function approveRefund($transactionId) { $transaction = new Pap_Common_Transaction(); $transaction->setId($transactionId); $refundTransaction = $transaction->getRefundOrChargebackTransaction(); if (is_null($refundTransaction)) { Gpf_Log::debug('Transacton id: ' . $transactionId . ' does not have refund transaction.' ); return; } if ($refundTransaction->getStatus() == Pap_Common_Constants::STATUS_PENDING) { $refundTransaction->setStatus(Pap_Common_Constants::STATUS_APPROVED); $refundTransaction->update(array(Pap_Db_Table_Transactions::R_STATUS)); Gpf_Log::debug('Refund commission (' . $refundTransaction->getId() . ') for transacton id: ' . $transactionId . ' is approved.' ); } }