diff --git a/src/Etsy/EtsyClient.php b/src/Etsy/EtsyClient.php index 4213998..b146e4b 100644 --- a/src/Etsy/EtsyClient.php +++ b/src/Etsy/EtsyClient.php @@ -6,14 +6,14 @@ */ class EtsyClient { - private $base_url = "https://openapi.etsy.com/v2"; - private $base_path = "/private"; - private $oauth = null; - private $authorized = false; - private $debug = true; + protected $base_url = "https://openapi.etsy.com/v2"; + protected $base_path = "/private"; + protected $oauth = null; + protected $authorized = false; + protected $debug = true; - private $consumer_key = ""; - private $consumer_secret = ""; + protected $consumer_key = ""; + protected $consumer_secret = ""; function __construct($consumer_key, $consumer_secret) { @@ -68,7 +68,7 @@ public function request($path, $params = array(), $method = OAUTH_HTTP_METHOD_GE } } - public function getRequestToken(array $extra = array()) + public function getRequestToken(array $extra = array(), $method = 'POST') { $url = $this->base_url . "/oauth/request_token"; $callback = 'oob'; @@ -82,7 +82,7 @@ public function getRequestToken(array $extra = array()) $callback = $extra['callback']; } try { - return $this->oauth->getRequestToken($url, $callback); + return $this->oauth->getRequestToken($url, $callback, $method); } catch (\OAuthException $e) { throw new EtsyRequestException($e, $this->oauth); } @@ -93,7 +93,7 @@ public function getRequestToken(array $extra = array()) public function getAccessToken($verifier) { try { - return $this->oauth->getAccessToken($this->base_url . "/oauth/access_token", null, $verifier); + return $this->oauth->getAccessToken($this->base_url . "/oauth/access_token", null, $verifier, 'GET'); } catch (\OAuthException $e) { throw new EtsyRequestException($e, $this->oauth); }