/** * Validate authentication data passed in the request against configuration values * * @return bool */ protected function _auth() { $projectId = $this->_config->getProjectId(); $apiKey = $this->_config->getApiKey(); if ($this->_request->merchant_authentication->project_id == $projectId && $this->_request->merchant_authentication->api_key == $apiKey) { return true; } $this->_debugData['reason'] = 'Auth failed'; return false; }
/** * Model constructor * * @return void */ public function __construct() { $this->getConfig(); $this->_projectId = $this->_config->getProjectId(); $this->_apiKey = $this->_config->getApiKey(); $this->_language = $this->_config->getLanguage(); $this->_currency = $this->_config->getCurrentCurrency(); $this->_merchantId = $this->_config->getMerchantId(); $this->_customerType = $this->_config->getCustomerType(); $this->_countries = $this->_config->getCountries(); return parent::__construct(); }