1 | <?php namespace Bookingsync\OAuth2\Client\Provider; |
||
7 | class Bookingsync extends AbstractProvider |
||
8 | { |
||
9 | public $scopeSeparator = ' '; |
||
10 | public $scopes = ['public', 'bookings_write_owned', 'bookings_read', 'bookings_write', |
||
11 | 'clients_read', 'clients_write', |
||
12 | 'inquiries_read', 'inquiries_write', |
||
13 | 'payments_read', 'payments_write', |
||
14 | 'rates_read', 'rates_write', |
||
15 | 'rentals_read', 'rentals_write', |
||
16 | 'reviews_write']; |
||
17 | public $responseType = 'json'; |
||
18 | public $authorizationHeader = 'Bearer'; |
||
19 | public $version = 'v3'; |
||
20 | |||
21 | /** |
||
22 | * Get the URL that this provider uses to begin authorization. |
||
23 | * |
||
24 | * @return string |
||
25 | */ |
||
26 | public function urlAuthorize() |
||
30 | |||
31 | /** |
||
32 | * Get the URL that this provider users to request an access token. |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | public function urlAccessToken() |
||
40 | |||
41 | /** |
||
42 | * Get the URL that this provider uses to request user details. |
||
43 | * |
||
44 | * Since this URL is typically an authorized route, most providers will require you to pass the access_token as |
||
45 | * a parameter to the request. For example, the google url is: |
||
46 | * |
||
47 | * 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token='.$token |
||
48 | * |
||
49 | * @param AccessToken $token |
||
50 | * @return string |
||
51 | */ |
||
52 | public function urlUserDetails(AccessToken $token) |
||
56 | |||
57 | /** |
||
58 | * Given an object response from the server, process the user details into a format expected by the user |
||
59 | * of the client. |
||
60 | * |
||
61 | * @param object $response |
||
62 | * @param AccessToken $token |
||
63 | * @return mixed |
||
64 | */ |
||
65 | public function userDetails($response, AccessToken $token) |
||
79 | |||
80 | public function userUid($response, AccessToken $token) |
||
85 | |||
86 | public function userEmail($response, AccessToken $token) |
||
91 | |||
92 | public function userScreenName($response, AccessToken $token) |
||
97 | } |
||
98 |