/**
  * Constructor method
  *
  * Expects a configuration parameter.
  *
  * @param Enlight_Config $config
  */
 public function __construct($config)
 {
     if (!empty($config->paypalSandbox)) {
         $url = self::URL_SANDBOX;
     } else {
         $url = self::URL_LIVE;
     }
     $this->apiUsername = $config->get('paypalUsername');
     $this->apiPassword = $config->get('paypalPassword');
     $this->apiSignature = $config->get('paypalSignature');
     $this->apiVersion = $config->get('paypalVersion');
     parent::__construct($url);
     $this->setAdapter(RestClient::createAdapterFromConfig($config));
 }