/**
  * Disable block output if logo is turned off
  *
  * @return string
  */
 protected function _toHtml()
 {
     $logoUrl = $this->_config->getLogoImageUrl($this->_locale);
     if (!$logoUrl) {
         return '';
     }
     $this->setLogoImageUrl($logoUrl);
     return parent::_toHtml();
 }
 /**
  * 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;
 }
 /**
  * Check if current currency is supported by Rakuten Checkout
  *
  * @param  string|bool $currencyCode
  * @return bool
  */
 public function canUseForCurrency($currencyCode)
 {
     if (!$this->_config->isCurrencySupported($currencyCode)) {
         $supportedCurrencies = $this->_config->getSupportedCurrencyCodes();
         if (count($supportedCurrencies) == 1) {
             $supportedCurrencies = array_shift($supportedCurrencies);
             $supportedCurrencies = Mage::helper('rakuten')->__('Supported currency is %s.', $supportedCurrencies);
         } else {
             $supportedCurrencies = implode(', ', $supportedCurrencies);
             $supportedCurrencies = Mage::helper('rakuten')->__('Supported currencies are %s.', $supportedCurrencies);
         }
         $this->getCheckout()->addError(Mage::helper('rakuten')->__('Current currency %s isn\'t supported by Rakuten Checkout.', $currencyCode) . $supportedCurrencies);
         return false;
     }
     return true;
 }