/** * Payment method code setter. Also instantiates/updates config * * @param string $code * @param int|null $storeId */ public function setMethod($code, $storeId = null) { if (null === $this->_config) { $params = array($code); if (null !== $storeId) { $params[] = $storeId; } $this->_config = Mage::getModel($this->_configType, $params); } else { $this->_config->setMethod($code); if (null !== $storeId) { $this->_config->setStoreId($storeId); } } return $this; }