1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* 500px service. |
4
|
|
|
* |
5
|
|
|
* @author Pedro Amorim <[email protected]> |
6
|
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License |
7
|
|
|
* @link https://developers.500px.com/ |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
namespace OAuth\OAuth1\Service; |
11
|
|
|
|
12
|
|
|
use OAuth\OAuth1\Signature\SignatureInterface; |
13
|
|
|
use OAuth\OAuth1\Token\StdOAuth1Token; |
14
|
|
|
use OAuth\Common\Http\Exception\TokenResponseException; |
15
|
|
|
use OAuth\Common\Http\Uri\Uri; |
16
|
|
|
use OAuth\Common\Consumer\CredentialsInterface; |
17
|
|
|
use OAuth\Common\Http\Uri\UriInterface; |
18
|
|
|
use OAuth\Common\Storage\TokenStorageInterface; |
19
|
|
|
use OAuth\Common\Http\Client\ClientInterface; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* 500px service. |
23
|
|
|
* |
24
|
|
|
* @author Pedro Amorim <[email protected]> |
25
|
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License |
26
|
|
|
* @link https://developers.500px.com/ |
27
|
|
|
*/ |
28
|
|
|
class FiveHundredPx extends AbstractService |
29
|
|
|
{ |
30
|
|
|
public function __construct( |
31
|
|
|
CredentialsInterface $credentials, |
32
|
|
|
ClientInterface $httpClient, |
33
|
|
|
TokenStorageInterface $storage, |
34
|
|
|
SignatureInterface $signature, |
35
|
|
|
UriInterface $baseApiUri = null |
36
|
|
|
) { |
37
|
|
|
parent::__construct( |
38
|
|
|
$credentials, |
39
|
|
|
$httpClient, |
40
|
|
|
$storage, |
41
|
|
|
$signature, |
42
|
|
|
$baseApiUri |
43
|
|
|
); |
44
|
|
|
|
45
|
|
|
if (null === $baseApiUri) { |
46
|
|
|
$this->baseApiUri = new Uri('https://api.500px.com/v1/'); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* {@inheritDoc} |
52
|
|
|
*/ |
53
|
|
|
public function getRequestTokenEndpoint() |
54
|
|
|
{ |
55
|
|
|
return new Uri('https://api.500px.com/v1/oauth/request_token'); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* {@inheritdoc} |
60
|
|
|
*/ |
61
|
|
|
public function getAuthorizationEndpoint() |
62
|
|
|
{ |
63
|
|
|
return new Uri('https://api.500px.com/v1/oauth/authorize'); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* {@inheritdoc} |
68
|
|
|
*/ |
69
|
|
|
public function getAccessTokenEndpoint() |
70
|
|
|
{ |
71
|
|
|
return new Uri('https://api.500px.com/v1/oauth/access_token'); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
} |
75
|
|
|
|