/**
  * @param string $data
  * @return Response
  */
 protected function createResponse($data)
 {
     if ($this->getApplyThreeDSecure()) {
         $response = new ThreeDSecureResponse($this, $data);
         if (!$response->isSuccessful() || $response->isRedirect()) {
             return $response;
         } else {
             $this->setApplyThreeDSecure(false);
             $this->setCard(null);
             $this->setCardReference($response->getTransactionReference());
             return $this->send();
         }
     } else {
         return parent::createResponse($data);
     }
 }