Update dependencies
This commit is contained in:
10
vendor/OAuth/OAuth1/Service/AbstractService.php
vendored
10
vendor/OAuth/OAuth1/Service/AbstractService.php
vendored
@@ -82,10 +82,6 @@ abstract class AbstractService extends BaseAbstractService implements ServiceInt
|
||||
}
|
||||
$this->signature->setTokenSecret($tokenSecret);
|
||||
|
||||
$extraAuthenticationHeaders = array(
|
||||
'oauth_token' => $token,
|
||||
);
|
||||
|
||||
$bodyParams = array(
|
||||
'oauth_verifier' => $verifier,
|
||||
);
|
||||
@@ -207,10 +203,8 @@ abstract class AbstractService extends BaseAbstractService implements ServiceInt
|
||||
}
|
||||
|
||||
$parameters = array_merge($parameters, array('oauth_token' => $token->getAccessToken()));
|
||||
|
||||
$mergedParams = (is_array($bodyParams)) ? array_merge($parameters, $bodyParams) : $parameters;
|
||||
|
||||
$parameters['oauth_signature'] = $this->signature->getSignature($uri, $mergedParams, $method);
|
||||
$parameters = (is_array($bodyParams)) ? array_merge($parameters, $bodyParams) : $parameters;
|
||||
$parameters['oauth_signature'] = $this->signature->getSignature($uri, $parameters, $method);
|
||||
|
||||
$authorizationHeader = 'OAuth ';
|
||||
$delimiter = '';
|
||||
|
||||
38
vendor/OAuth/OAuth1/Service/Etsy.php
vendored
38
vendor/OAuth/OAuth1/Service/Etsy.php
vendored
@@ -13,6 +13,9 @@ use OAuth\Common\Http\Client\ClientInterface;
|
||||
|
||||
class Etsy extends AbstractService
|
||||
{
|
||||
|
||||
protected $scopes = array();
|
||||
|
||||
public function __construct(
|
||||
CredentialsInterface $credentials,
|
||||
ClientInterface $httpClient,
|
||||
@@ -32,7 +35,14 @@ class Etsy extends AbstractService
|
||||
*/
|
||||
public function getRequestTokenEndpoint()
|
||||
{
|
||||
return new Uri($this->baseApiUri . 'oauth/request_token');
|
||||
$uri = new Uri($this->baseApiUri . 'oauth/request_token');
|
||||
$scopes = $this->getScopes();
|
||||
|
||||
if (count($scopes)) {
|
||||
$uri->setQuery('scope=' . implode('%20', $scopes));
|
||||
}
|
||||
|
||||
return $uri;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,4 +103,30 @@ class Etsy extends AbstractService
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the scopes for permissions
|
||||
* @see https://www.etsy.com/developers/documentation/getting_started/oauth#section_permission_scopes
|
||||
* @param array $scopes
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setScopes(array $scopes)
|
||||
{
|
||||
if (!is_array($scopes)) {
|
||||
$scopes = array();
|
||||
}
|
||||
|
||||
$this->scopes = $scopes;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the defined scopes
|
||||
* @return array
|
||||
*/
|
||||
public function getScopes()
|
||||
{
|
||||
return $this->scopes;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user