public function getRedirectionUrl(Customweb_Payment_Authorization_ITransaction $transaction, array $formData) { try { if ($transaction->isUseExistingAlias()) { return $this->container->getBean('Customweb_Payment_Endpoint_IAdapter')->getUrl("process", 'index', array_merge($formData, array('cw_transaction_id' => $transaction->getExternalTransactionId()))); } else { if ($transaction->getRedirectUrl() == null) { $builder = $this->createParameterBuilder($transaction); $parameters = $builder->buildParameters(); $parameters = array_merge($parameters, $this->getPaymentMethodWrapper($transaction->getTransactionContext()->getOrderContext())->getAdditionalPaymentPageParameters()); $requestUrl = Customweb_Saferpay_Util::addParametersToUrl($this->getCreatePayInitUrl(), $parameters); $transaction->setRedirectUrl(Customweb_Saferpay_Util::sendRequest($requestUrl)); } return $transaction->getRedirectUrl(); } } catch (Exception $e) { $transaction->setAuthorizationFailed($e->getMessage()); return $transaction->getFailedUrlWithCustomParameters(); } }