コード例 #1
0
 /**
  * This method processes the 3D Secure response from Saferpay .
  *
  *
  * @param Customweb_Saferpay_Authorization_Transaction $transaction
  * @param array $parameters
  */
 protected function process3DSecureResponse(Customweb_Saferpay_Authorization_Transaction $transaction, $parameters)
 {
     $transaction->setMpiSessionId($parameters['MPI_SESSIONID']);
     $additional = array();
     if (isset($parameters['sfCecD']) && !empty($parameters['sfCecD'])) {
         $additional['CVC'] = $transaction->decrypt($parameters['sfCecD']);
     }
     // The card is enrolled, but the authorization failed.
     if (isset($parameters['ECI']) && $parameters['ECI'] == '0') {
         $message = Customweb_I18n_Translation::__("The 3-D Secure authentication failed.");
         $transaction->setAuthorizationFailed($message);
         $this->redirect(null, $transaction, $this->getFailedUrl($transaction));
         return;
     }
     return $this->requestAuthorization($transaction, $additional);
 }