Source/SimpleBase.php
public function merchantByCurrency($config = array(), $currency = '')
    {
        if (!is_array($config)) {
            $this->errorMessage[] = 'config is not array!';
            return false;
        } elseif (count($config) == 0) {
            $this->errorMessage[] = 'Empty config array!';
            return false;
        }

        $config['CURRENCY'] = str_replace(' ', '', $currency);
        $variables = array('MERCHANT', 'SECRET_KEY');

        foreach ($variables as $var) {
            if (isset($config[$currency . '_' . $var])) {
                $config[$var] = str_replace(' ', '', $config[$currency . '_' . $var]);
            } elseif (!isset($config[$currency . '_' . $var])) {
                $config[$var] = 'MISSING_' . $var;
                $this->errorMessage[] = 'Missing ' . $var;
            }
        }

        if ($this->debug) {
            foreach ($config as $configKey => $configValue) {
                if (strpos($configKey, 'SECRET_KEY') !== true) {
                    $this->debugMessage[] = $configKey . '=' . $configValue;
                }
            }
        }
        return $config;
    }
public function merchantByCurrency($config = array(), $currency = '')
    {
        if (!is_array($config)) {
            $this->errorMessage[] = 'config is not array!';
            return false;
        } elseif (count($config) == 0) {
            $this->errorMessage[] = 'Empty config array!';
            return false;
        }

        $config['CURRENCY'] = str_replace(' ', '', $currency);
        $variables = array('MERCHANT', 'SECRET_KEY');

        foreach ($variables as $var) {
            if (isset($config[$currency . '_' . $var])) {
                $config[$var] = str_replace(' ', '', $config[$currency . '_' . $var]);
            } elseif (!isset($config[$currency . '_' . $var])) {
                $config[$var] = 'MISSING_' . $var;
                $this->errorMessage[] = 'Missing ' . $var;
            }
        }

        if ($this->debug) {
            foreach ($config as $configKey => $configValue) {
                if (strpos($configKey, 'SECRET_KEY') !== true) {
                    $this->debugMessage[] = $configKey . '=' . $configValue;
                }
            }
        }
        return $config;
    }
public function merchantByCurrency ( $ config = array ( ) , $ currency = '' ) { if ( ! is_array ( $ config ) ) { $ this -> errorMessage [ ] = 'config is not array!' ; return false ; } elseif ( count ( $ config ) == 0 ) { $ this -> errorMessage [ ] = 'Empty config array!' ; return false ; } $ config [ 'CURRENCY' ] = str_replace ( ' ' , '' , $ currency ) ; $ variables = array ( 'MERCHANT' , 'SECRET_KEY' ) ; foreach ( $ variables as $ var ) { if ( isset ( $ config [ $ currency . '_' . $ var ] ) ) { $ config [ $ var ] = str_replace ( ' ' , '' , $ config [ $ currency . '_' . $ var ] ) ; } elseif ( ! isset ( $ config [ $ currency . '_' . $ var ] ) ) { $ config [ $ var ] = 'MISSING_' . $ var ; $ this -> errorMessage [ ] = 'Missing ' . $ var ; } } if ( $ this -> debug ) { foreach ( $ config as $ configKey => $ configValue ) { if ( strpos ( $ configKey , 'SECRET_KEY' ) !== true ) { $ this -> debugMessage [ ] = $ configKey . '=' . $ configValue ; } } } return $ config ; }
Initialize MERCHANT, SECRET_KEY and CURRENCY

@param string $config   Config array
@param string $currency Currency

@return array $this->config Initialized config array
Initialize MERCHANT SECRET_KEY and CURRENCY