1 | <?php |
||
27 | class Hubic extends AbstractService |
||
28 | { |
||
29 | |||
30 | // Scopes |
||
31 | const SCOPE_USAGE_GET = 'usage.r'; |
||
32 | const SCOPE_ACCOUNT_GET = 'account.r'; |
||
33 | const SCOPE_GETALLLINKS_GET = 'getAllLinks.r'; |
||
34 | const SCOPE_CREDENTIALS_GET = 'credentials.r'; |
||
35 | const SCOPE_SPONSORCODE_GET = 'sponsorCode.r'; |
||
36 | const SCOPE_ACTIVATE_POST = 'activate.w'; |
||
37 | const SCOPE_SPONSORED_GET = 'sponsored.r'; |
||
38 | const SCOPE_LINKS_GET = 'links.r'; |
||
39 | const SCOPE_LINKS_POST = 'links.rw'; |
||
40 | const SCOPE_LINKS_ALL = 'links.drw'; |
||
41 | |||
42 | public function __construct( |
||
43 | CredentialsInterface $credentials, |
||
44 | ClientInterface $httpClient, |
||
45 | TokenStorageInterface $storage, |
||
46 | $scopes = array(), |
||
47 | UriInterface $baseApiUri = null |
||
48 | ) { |
||
49 | parent::__construct( |
||
50 | $credentials, |
||
51 | $httpClient, |
||
52 | $storage, |
||
53 | $scopes, |
||
54 | $baseApiUri, |
||
55 | true |
||
56 | ); |
||
57 | |||
58 | if (null === $baseApiUri) { |
||
59 | $this->baseApiUri = new Uri('https://api.hubic.com/'); |
||
60 | } |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function getAuthorizationEndpoint() |
||
67 | { |
||
68 | return new Uri('https://api.hubic.com/oauth/auth'); |
||
69 | |||
70 | } |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function getAccessTokenEndpoint() |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | protected function getAuthorizationMethod() |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | protected function parseAccessTokenResponse($responseBody) |
||
119 | |||
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | */ |
||
124 | public function getAuthorizationUri(array $additionalParameters = array()) |
||
155 | } |
||
156 |