src/Factory/RequestBase.php
public function setDriver($sDriverSlug)
    {
        //  Validate the driver
        $aDrivers = $this->oDriverService->getEnabled();
        $oDriver  = null;

        foreach ($aDrivers as $oDriverConfig) {
            if ($oDriverConfig->slug == $sDriverSlug) {
                $oDriver = $this->oDriverService->getInstance($oDriverConfig->slug);
                break;
            }
        }

        if (empty($oDriver)) {
            throw new RequestException('"' . $sDriverSlug . '" is not a valid payment driver.');
        }

        $this->oDriver = $oDriver;
        return $this;
    }
public function setDriver($sDriverSlug)
    {
        //  Validate the driver
        $aDrivers = $this->oDriverService->getEnabled();
        $oDriver  = null;

        foreach ($aDrivers as $oDriverConfig) {
            if ($oDriverConfig->slug == $sDriverSlug) {
                $oDriver = $this->oDriverService->getInstance($oDriverConfig->slug);
                break;
            }
        }

        if (empty($oDriver)) {
            throw new RequestException('"' . $sDriverSlug . '" is not a valid payment driver.');
        }

        $this->oDriver = $oDriver;
        return $this;
    }
public function setDriver ( $ sDriverSlug ) { //  Validate the driver $ aDrivers = $ this -> oDriverService -> getEnabled ( ) ; $ oDriver = null ; foreach ( $ aDrivers as $ oDriverConfig ) { if ( $ oDriverConfig -> slug == $ sDriverSlug ) { $ oDriver = $ this -> oDriverService -> getInstance ( $ oDriverConfig -> slug ) ; break ; } } if ( empty ( $ oDriver ) ) { throw new RequestException ( '"' . $ sDriverSlug . '" is not a valid payment driver.' ) ; } $ this -> oDriver = $ oDriver ; return $ this ; }
Set the driver to be used for the request

@param string $sDriverSlug The driver's slug

@return $this
@throws RequestException
Set the driver to be used for the request