예제 #1
0
 protected function setTimeVariableValues($timeOffset = 0) {
     parent::setTimeVariableValues($timeOffset);
     $firstClickTime = Gpf_Common_DateUtils::getTimestamp($this->transaction->get(Pap_Db_Table_Transactions::FIRST_CLICK_TIME));
     $lastClickTime = Gpf_Common_DateUtils::getTimestamp($this->transaction->get(Pap_Db_Table_Transactions::LAST_CLICK_TIME));
     $this->setVariable('firstclicktime', Gpf_Common_DateUtils::getDateTime($firstClickTime + $timeOffset));
     $this->setVariable('lastclicktime', Gpf_Common_DateUtils::getDateTime($lastClickTime + $timeOffset));
 }
    public function getTransactionFieldValue($code) {
        if($this->transaction == null) {
            throw new Gpf_Exception("You have to set Transaction before getting transaction fields value!");
        }

        if($code == self::TRANSACTIONID) {
            return $this->transaction->get(Pap_Db_Table_Transactions::TRANSACTION_ID);
        } else if($code == self::COMMISSION) {
            return $this->transaction->getCommissionAsText();
        } else if($code == self::TOTALCOST) {
            return $this->transaction->getTotalCostAsText();
        } else if($code == self::ORDERID) {
            return $this->transaction->getOrderId();
        } else if($code == self::PRODUCTID) {
            return $this->transaction->getProductId();
        } else if($code == self::TIER) {
            return $this->transaction->getTier();
        } else if($code == self::CAMPAIGNID) {
            return $this->transaction->getCampaignId();
        } else if($code == self::CAMPAIGNNAME) {
            return $this->getCampaignName($this->transaction->getCampaignId());
        } else if($code == self::STATUS) {
            return $this->getStatus($this->transaction->getStatus());
        } else if($code == self::STATUSCODE) {
            return $this->transaction->getStatus();
        } else if($code == self::TYPE) {
            return $this->getType($this->transaction->getType());
        } else if($code == self::RAWTYPE) {
            return $this->transaction->getType();
        } else if($code == self::ACTIONNAME) {
            return $this->getActionName($this->transaction->getType(), $this->transaction->getCommissionTypeId());
        } else if($code == self::SALEDATA1) {
            return $this->transaction->getData1();
        } else if($code == self::SALEDATA2) {
            return $this->transaction->getData2();
        } else if($code == self::SALEDATA3) {
            return $this->transaction->getData3();
        } else if($code == self::SALEDATA4) {
            return $this->transaction->getData4();
        } else if($code == self::SALEDATA5) {
            return $this->transaction->getData5();
        } else if($code == self::ORIGINALCURRENCY) {
            return $this->getOriginalCurrencyName($this->transaction->get(Pap_Db_Table_Transactions::ORIGINAL_CURRENCY_ID));
        }
        try {
            return $this->transaction->get($code);
        } catch (Gpf_Exception $e) {
        }
        return '';
    }