Get the redirect error url on payment execute.

@return string $sURL
428369
protected function GetResponseURL()
    {
        $sReturnURLBase = $this->getActivePageService()->getActivePage()->GetRealURLPlain(array(), true);
        if ('.html' === substr($sReturnURLBase, -5)) {
            $sReturnURLBase = substr($sReturnURLBase, 0, -5);
        }
        if ('/' !== substr($sReturnURLBase, -1)) {
            $sReturnURLBase .= '/';
        }

        return $sReturnURLBase;
    }
682
public function callback($request)
    {
        // If post data exists, process. Otherwise provide error
        if ($this->payment_handler === null) {
            // Redirect to error page
            return $this->redirect(Controller::join_links(
                Director::BaseURL(),
                $this->config()->url_segment,
                'complete',
                'error'
            ));
        }
        
        // Hand the request over to the payment handler
        return $this
            ->payment_handler
            ->handleRequest($request, $this->model);
    }
1088288
public function getRedirect()
    {
        if (!$this->isRedirect())
            return null;

        if ($this->isPermanentRedirect())
            return substr($this->name, 19);

        return substr($this->name, 9);
    }
793405
public static function forError(): OutputStream
    {
        if (null === self::$err) {
            self::$err = self::create('php://stderr');
        }

        return self::$err;
    }
1126625
public function getPayURedirectUrl()
    {
        $mode = parent::$apiContext->get('mode');
        $reference = $this->return->payUReference;

        if (!$mode || !$reference)
            return null;

        $url = sprintf(self::REDIRECT_URL, $mode === 'sandbox' ? 'staging' : 'secure', $reference);

        return $url;
    }
782706
public function error() : String
    {
        if( ! is_resource($this->init) )
        {
            throw new InvalidArgumentException(NULL, '$this->init');
        }

        return curl_error($this->init);
    }
1343087
private String getRedirectUrl(RequestParametersHolder requestHolder) throws AlipayApiException {
        StringBuffer urlSb = new StringBuffer(serverUrl);
        try {
            Map<String, String> sortedMap = AlipaySignature.getSortedMap(requestHolder);
            String sortedQuery = WebUtils.buildQuery(sortedMap, charset);
            urlSb.append("?");
            urlSb.append(sortedQuery);
        } catch (IOException e) {
            throw new AlipayApiException(e);
        }

        return urlSb.toString();
    }
1009320
public function getRedirectData()
    {
        if ($this->isRedirect()) {
            return array(
                'PaReq' => $this->getDataItem('PAReq'),
                'TermUrl' => $this->getRequest()->getReturnUrl(),
                'MD' => $this->getDataItem('MD'),
            );
        }
    }
812885
public function showErrorWrongDomain()
    {
        $this->checkSitePermission();
        Piwik::checkUserHasViewAccess($this->idSite);

        $url = Common::getRequestVar('url', '');
        $url = Common::unsanitizeInputValue($url);

        $message = Piwik::translate('Overlay_RedirectUrlError', array($url, "\n"));
        $message = nl2br(htmlentities($message, ENT_COMPAT | ENT_HTML401, 'UTF-8'));

        $view = new View('@Overlay/showErrorWrongDomain');
        $this->addCustomLogoInfo($view);
        $view->message = $message;

        if (Piwik::isUserHasWriteAccess($this->idSite)) {
            // TODO use $idSite to link to the correct row. This is tricky because the #rowX ids don't match
            // the site ids when sites have been deleted.
            $url = 'index.php?module=SitesManager&action=index';
            $troubleshoot = htmlentities(Piwik::translate('Overlay_RedirectUrlErrorAdmin'), ENT_COMPAT | ENT_HTML401, 'UTF-8');
            $troubleshoot = sprintf($troubleshoot, '<a href="' . $url . '" target="_top">', '</a>');
            $view->troubleshoot = $troubleshoot;
        } else {
            $view->troubleshoot = htmlentities(Piwik::translate('Overlay_RedirectUrlErrorUser'), ENT_COMPAT | ENT_HTML401, 'UTF-8');
        }

        $this->outputCORSHeaders();
        return $view->render();
    }
175118
public final function getPath(): string
   {
       return ltrim((!$this->redirect
            ? parent::getPath()
            : $this->redirect), self::SEPARATOR);
   }
876564
protected function get_error()
    {
        $query = $this->database->getQueryCollection()->findQuery($this->strQuery);

        if ($query) {
            return $query->error();
        }

        return '';
    }
953955
private function getIndexRedirectionResponse()
    {
        $response = new Redirection($this->getRequest());
        $url = sprintf('/%s/', $this->getCollectionName());
        // If a particular view was being shown, honour it.
        $view = $this->getRequest()->getParameter('view');
        if (!empty($view)) {
            $url .= '?view=' . $view;
        }
        $response->setNextUrl($url);

        return $response;
    }
1338888
protected function getCancelUrl()
    {
        $cancelURLFromRequest = $this->getRequest()->getRequestParameter('oePayPalCancelURL');
        $cancelUrl = $this->getSession()->processUrl($this->getBaseUrl() . "&cl=basket");

        if ($cancelURLFromRequest) {
            $cancelUrl = html_entity_decode(urldecode($cancelURLFromRequest));
        } elseif ($requestedControllerKey = $this->getRequestedControllerKey()) {
            $cancelUrl = $this->getSession()->processUrl($this->getBaseUrl() . '&cl=' . $requestedControllerKey);
        }

        return $cancelUrl;
    }
1258216
public function getErrorMessageFromHandle()
    {
        $errorMessage = null;

        if ($this->handle !== null) {
            $errorMessage = curl_errno($this->handle);
        }

        return $errorMessage === '' ? null : $errorMessage;
    }
1018864
protected function _vcl_sub_https_redirect_fix() {

        $hostRegex = array();
        foreach ($this->_getHostNames() as $host) {
            $hostRegex[] = 'req.http.host ~ "^(?i)'.$host.'"';
        }
        $hostRegex = implode(' || ', $hostRegex);

        switch (Mage::getStoreConfig('turpentine_varnish/servers/version')) {
            case 4.0:
            case 4.1:
                $tpl = <<<EOS
if ( ($hostRegex) && req.http.X-Forwarded-Proto !~ "(?i)https") {
        return (synth(750, ""));
    }
EOS;
                break;
            default:
                $tpl = <<<EOS
if ( ($hostRegex) && req.http.X-Forwarded-Proto !~ "(?i)https") {
        error 750 "https://" + req.http.host + req.url;
    }
EOS;
        }

        return $tpl;
    }
870662
public function getError() {
		switch ($this->error_code) {
			case UPLOAD_ERR_OK:
				return false;
			case UPLOAD_ERR_NO_FILE:
				$error = 'upload:error:no_file';
			case UPLOAD_ERR_INI_SIZE:
			case UPLOAD_ERR_FORM_SIZE:
				$error = 'upload:error:file_size';
			default:
				$error = 'upload:error:unknown';
		}
		return elgg_echo($error);
	}
1041149
protected function _getFromUrl()
    {
        try {
            $http = new Client(['redirect' => 3]); // follow up to 3 redirections
            $response = $http->get($this->params['source'], [], [
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest'
                ]
            ]);
        } catch (\Exception $ex) {
            $response = false;
            $this->err(__d('installer', 'Could not download the package. Details: {0}', $ex->getMessage()));

            return false;
        }

        if ($response && $response->isOk()) {
            $this->params['source'] = TMP . substr(md5($this->params['source']), 24) . '.zip';
            $file = new File($this->params['source']);
            $responseBody = $response->body();

            if (is_readable($file->pwd())) {
                $file->delete();
            }

            if (!empty($responseBody) &&
                $file->create() &&
                $file->write($responseBody, 'w+', true)
            ) {
                $file->close();

                return $this->_getFromFile();
                $this->err(__d('installer', 'Unable to extract the package.'));

                return false;
            }

            $this->err(__d('installer', 'Unable to download the file, check write permission on "{0}" directory.', [TMP]));

            return false;
        }

        $this->err(__d('installer', 'Could not download the package, no .ZIP file was found at the given URL.'));

        return false;
    }