Ejemplo n.º 1
0
    private function replaceTransactionConstants($text,Pap_Common_Transaction $transaction) {
        $transactionFields = Pap_Common_TransactionFields::getInstance();
        $transactionFields->setTransaction($transaction);

        $text = $transactionFields->replaceTransactionConstantsInText($text);
        $text = $transactionFields->removeTransactionCommentsInText($text);

        return $text;
    }
Ejemplo n.º 2
0
    protected function setVariableValues() {
        parent::setVariableValues();

        $transactionFields = Pap_Common_TransactionFields::getInstance();
        $this->updateTransactionFields($transactionFields);
        $transactionValues = $transactionFields->getTransactionFieldsValues();
        foreach($transactionValues as $code => $value) {
            if ($code == Pap_Common_TransactionFields::CAMPAIGNNAME) {
                $value = Gpf_Lang::_localizeRuntime($value, $this->getRecipientLanguage());
            }
            if ($code == Pap_Common_TransactionFields::STATUS) {
                $value = Gpf_Lang::_($value, null, $this->getRecipientLanguage());
            }
            $this->setVariable($code, $value);
        }
    }
    /**
     * returns array of transaction fields
     *
     * @return unknown
     */
    public function getTransactionFields() {
        if (is_array(self::$transactionFields)) {
            return self::$transactionFields;
        }

        self::$transactionFields = array();
        $this->addField(self::TRANSACTIONID, $this->_('Transaction ID'));
        $this->addField(self::COMMISSION, $this->_('Commission'));
        $this->addField(self::TOTALCOST, $this->_('TotalCost'));
        $this->addField(self::ORDERID, $this->_('Order ID'));
        $this->addField(self::PRODUCTID, $this->_('Product ID'));
        $this->addField(self::TIER, $this->_('Tier'));
        $this->addField(self::CAMPAIGNID, $this->_('Campaign ID'));
        $this->addField(self::CAMPAIGNNAME, $this->_('Campaign name'));
        $this->addField(self::STATUS, $this->_('Status'));
        $this->addField(self::STATUSCODE, $this->_('Status'));
        $this->addField(self::TYPE, $this->_('Type'));
        $this->addField(self::RAWTYPE, $this->_('RawType'));
        $this->addField(self::ACTIONNAME, $this->_('Action name'));

        $this->addField(self::REFERERURL, $this->_('Referer URL'));
        $this->addField(self::IP, $this->_('IP'));
        $this->addField(self::COUNTRYCODE, $this->_('Country code'));
        $this->addField(self::FIRSTCLICKTIME, $this->_('First click - time'));
        $this->addField(self::FIRSTCLICKREFERER, $this->_('First click - referer'));
        $this->addField(self::FIRSTCLICKIP, $this->_('First click - IP'));
        $this->addField(self::FIRSTCLICKDATA1, $this->_('First click - data1'));
        $this->addField(self::FIRSTCLICKDATA2, $this->_('First click - data2'));
        $this->addField(self::LASTCLICKTIME, $this->_('Last click - time'));
        $this->addField(self::LASTCLICKREFERER, $this->_('Last click - referer'));
        $this->addField(self::LASTCLICKIP, $this->_('Last click - IP'));
        $this->addField(self::LASTCLICKDATA1, $this->_('Last click - data1'));
        $this->addField(self::LASTCLICKDATA2, $this->_('Last click - data2'));
        $this->addField(self::SALEDATA1, $this->_('Transaction data1'));
        $this->addField(self::SALEDATA2, $this->_('Transaction data2'));
        $this->addField(self::SALEDATA3, $this->_('Transaction data3'));
        $this->addField(self::SALEDATA4, $this->_('Transaction data4'));
        $this->addField(self::SALEDATA5, $this->_('Transaction data5'));
        $this->addField(self::MERCHANTNOTE, $this->_('Note to merchant'));
        $this->addField(self::SYSTEMNOTE, $this->_('Note to affiliate'));
        $this->addField(self::ORIGINALCURRENCY, $this->_('Original currency'));
        $this->addField(self::ORIGINALCURRENCYVALUE, $this->_('Original currency value'));
        $this->addField(self::ORIGINALCURRENCYRATE, $this->_('Original currency rate'));

        return self::$transactionFields;
    }