getConfig()->getValue(static::CONFIG_NAME) === static::CONFIG_OFF) { return true; } if ($this->isMatchCvv($response)) { return true; } if ($this->isNotMatchCvv($response)) { $response->setRespmsg(static::ERROR_MESSAGE); return false; } if ($this->isCvvDoNotExists($response)) { return true; } $response->setRespmsg(static::ERROR_MESSAGE); return false; } /** * Matching card CVV (positive) * * @param DataObject $response * @return bool */ protected function isMatchCvv(DataObject $response) { $cvvMatch = strtolower((string) $response->getData(static::CVV2MATCH)); return $cvvMatch === static::RESPONSE_YES || $cvvMatch === static::RESPONSE_NOT_SUPPORTED; } /** * Matching card CVV (negative) * * @param DataObject $response * @return bool */ protected function isNotMatchCvv(DataObject $response) { return strtolower((string) $response->getData(static::CVV2MATCH)) === static::RESPONSE_NO; } /** * Checking that the CVV does not exist in the response * * @param DataObject $response * @return bool */ protected function isCvvDoNotExists(DataObject $response) { return $response->getData(static::CVV2MATCH) == ''; } }