src/icepay_api_basic.php
public function readFolder($dir = null) {
        $this->setPaymentMethodsFolder(DIR . DS . 'paymentmethods');

        if ($dir)
            $this->setPaymentMethodsFolder($dir);

        $this->paymentMethods = array();
        try {
            $folder = $this->_folderPaymentMethods;
            $handle = is_dir($folder) ? opendir($folder) : false;

            if ($handle) {
                while (false !== ($file = readdir($handle))) {
                    if ($file != "." && $file != ".." && $file != ".svn") {
                        require_once (sprintf("%s/%s", $this->_folderPaymentMethods, $file));
                        $name = strtolower(substr($file, 0, strlen($file) - 4));
                        $className = "Icepay_Paymentmethod_" . ucfirst($name);
                        $this->paymentMethods[$name] = $className;
                    }
                }
            }
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
        return $this;
    }
public function readFolder($dir = null) {
        $this->setPaymentMethodsFolder(DIR . DS . 'paymentmethods');

        if ($dir)
            $this->setPaymentMethodsFolder($dir);

        $this->paymentMethods = array();
        try {
            $folder = $this->_folderPaymentMethods;
            $handle = is_dir($folder) ? opendir($folder) : false;

            if ($handle) {
                while (false !== ($file = readdir($handle))) {
                    if ($file != "." && $file != ".." && $file != ".svn") {
                        require_once (sprintf("%s/%s", $this->_folderPaymentMethods, $file));
                        $name = strtolower(substr($file, 0, strlen($file) - 4));
                        $className = "Icepay_Paymentmethod_" . ucfirst($name);
                        $this->paymentMethods[$name] = $className;
                    }
                }
            }
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
        return $this;
    }
public function readFolder ( $ dir = null ) { $ this -> setPaymentMethodsFolder ( DIR . DS . 'paymentmethods' ) ; if ( $ dir ) $ this -> setPaymentMethodsFolder ( $ dir ) ; $ this -> paymentMethods = array ( ) ; try { $ folder = $ this -> _folderPaymentMethods ; $ handle = is_dir ( $ folder ) ? opendir ( $ folder ) : false ; if ( $ handle ) { while ( false !== ( $ file = readdir ( $ handle ) ) ) { if ( $ file != "." && $ file != ".." && $ file != ".svn" ) { require_once ( sprintf ( "%s/%s" , $ this -> _folderPaymentMethods , $ file ) ) ; $ name = strtolower ( substr ( $ file , 0 , strlen ( $ file ) - 4 ) ) ; $ className = "Icepay_Paymentmethod_" . ucfirst ( $ name ) ; $ this -> paymentMethods [ $ name ] = $ className ; } } } } catch ( Exception $ e ) { throw new Exception ( $ e -> getMessage ( ) ) ; } return $ this ; }
Store the paymentmethod class names in the paymentmethods array.
@since version 1.0.0
@access public
@param string $dir Folder of the paymentmethod classes
Store the paymentmethod class names in the paymentmethods array .