@link http://business.skyscanner.net/portal/en-GB/Documentation/Referrals

@return string
486998
protected function getReferralUrl(): string
    {
        return str_replace($this->method, 'referral', $this->url) . '?apiKey=' . substr($this->apiKey, 0, 16);
    }
530531
public function getIata() : ?string 
    {
        if ( ! $this->hasIata()) {
            $this->setIata($this->getDefaultIata());
        }
        return $this->iata;
    }
973470
protected function calculateReturnUrl()
    {
        $currentUri = $this->util->getCurrentURI();

        /*
        // Referrer would be powerful when someone is usng multiple windows, but
        // the loop does not always provide a correct referrer.
        $referrer   = $_SERVER["HTTP_REFERER"];

        // If a referrer was specified and that referral is from the current site, then use it
        // as it is more dependable when the user has multiple windows open on the application.
        if ($referrer && (0 == strncasecmp($referrer, $currentUri, strlen($currentUri)))) {
            return $referrer;
            // \MUtil_Echo::track($referrer);
        } // */

        // Use the survey return if available.
        $surveyReturn = $this->currentUser->getSurveyReturn();
        if ($surveyReturn) {
            // Do not show the base url as it is in $currentUri
            $surveyReturn['NoBase'] = true;

            // Add route reset to prevet the current parameters to be
            // added to the url.
            $surveyReturn['RouteReset'] = true;

            // \MUtil_Echo::track($currentUri, \MUtil_Html::urlString($surveyReturn));
            return $currentUri . \MUtil_Html::urlString($surveyReturn);
        }

        // Ultimate backup solution for return
        return $currentUri . '/ask/forward/' . \MUtil_Model::REQUEST_ID . '/' . urlencode($this->getTokenId());
    }
946858
public function getHomeLink()
    {
        if (($sValue = $this->getViewConfigParam('homeLink')) === null) {
            $sValue = null;

            $blAddStartCl = $this->isStartClassRequired();
            if ($blAddStartCl) {
                $baseLanguage = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
                $sValue = \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->getStaticUrl($this->getSelfLink() . 'cl=start', $baseLanguage);
                $sValue = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->appendUrl(
                    $sValue,
                    \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->getBaseAddUrlParams()
                );
                $sValue = getStr()->preg_replace('/(\?|&(amp;)?)$/', '', $sValue);
            }

            if (!$sValue) {
                $sValue = getStr()->preg_replace('#index.php\??$#', '', $this->getSelfLink());
            }

            $this->setViewConfigParam('homeLink', $sValue);
        }

        return $sValue;
    }
55751
protected function generateReferral()
    {
        Factory::helper('string');
        $oDb       = Factory::service('Database');
        $sReferral = '';

        while (1 > 0) {

            $sReferral = random_string('alnum', 8);
            $oQuery    = $oDb->get_where($this->table, ['referral' => $sReferral]);

            if ($oQuery->num_rows() == 0) {
                break;
            }
        }

        return $sReferral;
    }
562777
public function open():string
	{
		if( isset($this->config['opener']) )
			{ return $this->config['opener']; }

		$this->parsePrivateAttributes();
		$this->parseCommonAttributes();

		if( isset($this->config['in_scope']) && isset($this->config['scope_function']) && is_callable($this->config['scope_function']) )
			{ $this->config['scope_function']->call($this,$this->document->scope); }

		$finisher= $this->isEmpty ? ' />' : '>';

		return "<{$this->tagName}{$this->attributesString}{$finisher}";
	}
464833
public function GetLinkForRegistrationGuest()
    {
        $oURLData = &TCMSSmartURLData::GetActive();
        $oShop = &TdbShop::GetInstance($oURLData->iPortalId);
        $sRegisterPath = $oShop->GetLinkToSystemPage(self::NAME_SYSTEM_PAGE);

        return $sRegisterPath;
    }
800524
public function getUrl()
    {
        if ($this->_url instanceof Closure) {
            return call_user_func($this->_url, $this);
        }

        return $this->_url ?: Yii::$app->request->referrer;
    }
1162286
public function getCustomerReference()
    {
        if (!$this->isRecurring()) {
            return '';
        }
        if (!$this->planResponse) {
            /** @var \Omnipay\AuthorizeNet\AIMGateway $gateway */
            $gateway = Omnipay::create('AuthorizeNet_AIM');
            $gateway->setApiLoginId($this->request->getApiLoginId());
            $gateway->setHashSecret($this->request->getHashSecret());
            $gateway->setTransactionKey($this->request->getTransactionKey());
            $data = array('recurringReference' => $this->getRecurringReference());
            $this->planResponse = $gateway->paymentPlanQuery($data)->send();
        }
        return $this->planResponse->getContactReference();
    }
786237
public function getCountryCode()
    {
        return (string) \OxidEsales\Eshop\Core\Str::getStr()->strtoupper(\OxidEsales\Eshop\Core\Str::getStr()->substr($this->_cleanUp($this->_sCompanyVatNumber), 0, 2));
    }
361624
public function getQrString(): string
    {
        $this->checkProperties();

        $qr = "SPD*1.0*";
        $qr .= sprintf("ACC:%s*", $this->getIBAN());
        $qr .= sprintf("AM:%.2f*", $this->amount);
        $qr .= sprintf("CC:%s*", strtoupper($this->currency));

        if ($this->repeat) {
            $qr .= sprintf("X-PER:%d*", $this->repeat);
        }
        if ($this->comment) {
            $qr .= sprintf("MSG:%.60s*", $this->comment);
        }
        if ($this->internalId) {
            $qr .= sprintf("X-ID:%s*", $this->internalId);
        }
        if ($this->variableSymbol) {
            $qr .= sprintf("X-VS:%d*", $this->variableSymbol);
        }
        if ($this->specificSymbol) {
            $qr .= sprintf("X-SS:%d*", $this->specificSymbol);
        }
        if ($this->constantSymbol) {
            $qr .= sprintf("X-KS:%d*", $this->constantSymbol);
        }
        if (($dueDate = $this->getDueDate())) {
            $qr .= sprintf("DT:%s*", $dueDate->format('Ymd'));
        }

        return substr($qr, 0, -1);
    }
336507
protected function getBatchRedirectUrl() : string
    {
        // default url
        $result = ['plugin' => $this->plugin, 'controller' => $this->name, 'action' => 'index'];

        $currentUrl = $this->request->getEnv('HTTP_ORIGIN') . $this->request->getRequestTarget();
        // if referer does not match current url, redirect to referer (delete action)
        if (false === strpos($this->referer(), $currentUrl)) {
            $result = $this->referer();
        }

        // use batch redirect url if provided (edit action)
        if ($this->request->getData('batch.redirect_url')) {
            $result = $this->request->getData('batch.redirect_url');
        }

        return Router::url($result);
    }
65445
public function getCountries()
    {
        if ($this->_aCountries === null) {
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $this->_aCountries = [];
            $sSelect = 'select oxobjectid from oxobject2payment where oxpaymentid=' . $oDb->quote($this->getId()) . ' and oxtype = "oxcountry" ';
            $rs = $oDb->getCol($sSelect);
            $this->_aCountries = $rs;
        }

        return $this->_aCountries;
    }
325900
public function getFullDescription()
    {
        if ($this->_description) {
            return $this->_description;
        }

        $descr        = $this->getRoundDescription();
        $hasDescr     = strlen(trim($descr));
        $order        = $this->getRoundOrder();
        $survey       = $this->getSurvey();
        $surveyExists = $survey ? $survey->exists : false;

        if ($order) {
            if ($hasDescr) {
                if ($surveyExists) {
                    $this->_description = sprintf($this->_('%d: %s - %s'), $order, $descr, $survey->getName());
                } else {
                    $this->_description = sprintf($this->_('%d: %s'), $order, $descr);
                }
            } elseif ($surveyExists) {
                $this->_description = sprintf($this->_('%d: %s'), $order, $survey->getName());
            } else {
                $this->_description = $order;
            }
        } elseif ($hasDescr) {
            if ($surveyExists) {
                $this->_description = sprintf($this->_('%s - %s'), $descr, $survey->getName());
            } else {
                $this->_description = $descr;
            }
        } else {
            if ($surveyExists) {
                $this->_description = $survey->getName();
            } else {
                $this->_description = '';
            }
        }

        return $this->_description;
    }
30386
public function getHelp()
	{
		$help='Usage: '.$this->getCommandRunner()->getScriptName().' '.$this->getName();
		$options=$this->getOptionHelp();
		if(empty($options))
			return $help."\n";
		if(count($options)===1)
			return $help.' '.$options[0]."\n";
		$help.=" <action>\nActions:\n";
		foreach($options as $option)
			$help.='    '.$option."\n";
		return $help;
	}
96904
public function viewLink()
    {
        $link   = null;
        $locale = $this->lang();
        if ($locale !== null) {
            $translator = $this->translator();
            $origLocale = $translator->getLocale();
            $translator->setLocale($this->lang());
            $link = $this->renderTemplate('{{# withBaseUrl }}{{ obj.url }}{{/ withBaseUrl }}');
            $translator->setLocale($origLocale);
        }

        return $link;
    }
884070
protected function getDSN():string {
		$dsn = $this->drivername.':dbname=';

		if($this->options->host !== null){
			$dsn .= $this->options->host;

			if(is_numeric($this->options->port)){
				$dsn .= '/'.$this->options->port;
			}

			$dsn .= ':';
		}

		$dsn .= $this->options->database;

		if($this->options->firebird_encoding !== null){
			$dsn .= ';encoding='.$this->options->firebird_encoding;
		}

		return $dsn;
	}