_store = $store; return $this; } /** * Return store * * @return int|Mage_Core_Model_Store */ public function getStore() { return $this->_store; } /** * Return validation state class for card with type $cardType * * @param string $cardType * @return string */ public function getStateModelClass($cardType) { $node = Mage::getConfig()->getNode($this->_cardTypesConfigPath . '/' . $cardType . '/validator/centinel/state'); if (!$node) { return false; } return $node->asArray(); } /** * Return centinel processorId * * @return string */ public function getProcessorId() { return $this->_getServiceConfigValue('processor_id'); } /** * Return centinel merchantId * * @return string */ public function getMerchantId() { return $this->_getServiceConfigValue('merchant_id'); } /** * Return centinel transactionPwd * * @return string */ public function getTransactionPwd() { return Mage::helper('core')->decrypt($this->_getServiceConfigValue('password')); } /** * Return flag - is centinel mode test * * @return bool */ public function getIsTestMode() { return (bool)(int)$this->_getServiceConfigValue('test_mode'); } /** * Return value of node of centinel config section * * @param string $key * @return string */ private function _getServiceConfigValue($key) { return Mage::getStoreConfig($this->_serviceConfigPath . '/' . $key, $this->getStore()); } /** * Define if debugging is enabled * * @return bool */ public function getDebugFlag() { return $this->_getServiceConfigValue('debug'); } }