예제 #1
0
 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.' );
     } 
 }
예제 #2
0
 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;
 }
예제 #3
0
 /** 
  * @return Pap_Common_Transaction
  */
 protected function getTransaction($id) {
     $transaction = new Pap_Common_Transaction();
     $transaction->setId($id);
     $transaction->load();
     return $transaction;
 }
    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
  */
 public function getTransaction() {
     $transaction = new Pap_Common_Transaction();
     $transaction->setId($this->getTransactionId());
     $transaction->load();
     return $transaction;
 }