/**
  * This method checks the enrollment of the credit card in the 3D secure program.
  * If the card is enrolled the user is redirected to the 3D secure verification page
  * otherwise the transaction is authorized without 3D secure.
  *
  * @param Customweb_Saferpay_Authorization_Transaction $transaction
  */
 protected function request3DSecure(Customweb_Saferpay_Authorization_Transaction $transaction, $parameters)
 {
     $builder = new Customweb_Saferpay_Authorization_Hidden_ParameterBuilder($transaction, $this->getConfiguration(), $this->container);
     $sendParameters = $builder->buildVerifyEnrollmentParameters();
     $additionalParameters = array();
     if (isset($parameters['sfpCardCvc']) && !empty($parameters['sfpCardCvc'])) {
         $sendParameters['MPI_PA_BACKLINK'] = Customweb_Util_Url::appendParameters($sendParameters['MPI_PA_BACKLINK'], array('sfCecD' => $transaction->encrypt($parameters['sfpCardCvc'])));
         $additionalParameters['CVC'] = $parameters['sfpCardCvc'];
     }
     $requestUrl = Customweb_Saferpay_Util::addParametersToUrl($this->getVerifyEnrollmentUrl(), $sendParameters);
     $response = Customweb_Saferpay_Util::sendRequest($requestUrl);
     $parameters = $this->getXmlParameters($response);
     if ($this->is3DSecurePossible($transaction, $parameters)) {
         return $this->redirect(Customweb_Saferpay_Authorization_Transaction::STATE_3D_SECURE, $transaction, $parameters['MPI_PA_LINK']);
     } else {
         if (isset($parameters['MPI_SESSIONID'])) {
             $transaction->setMpiSessionId($parameters['MPI_SESSIONID']);
         }
         return $this->requestAuthorization($transaction, $additionalParameters);
     }
 }