1 | <?php |
||
9 | class Authorize extends API { |
||
10 | |||
11 | /** |
||
12 | * Good Till Authentication |
||
13 | * |
||
14 | * @source https://apidoc.thegoodtill.com/#api-Authentication |
||
15 | */ |
||
16 | |||
17 | const LOGIN = 'login'; |
||
18 | const LOGOUT = 'logout'; |
||
19 | const REFRESH = 'refresh_token'; |
||
20 | |||
21 | const SUBDOMAIN = 'subdomain'; |
||
22 | const USERNAME = 'username'; |
||
23 | const PASSWORD = 'password'; |
||
24 | |||
25 | const CONFIG_ROUTE = 'goodtill.routes.api'; |
||
26 | const CONFIG_SUBDOMAIN = 'goodtill.authorize.subdomain'; |
||
27 | const CONFIG_USERNAME = 'goodtill.authorize.username'; |
||
28 | const CONFIG_PASSWORD = 'goodtill.authorize.password'; |
||
29 | |||
30 | /** |
||
31 | * Good Till System: Authorize |
||
32 | * |
||
33 | * @return array |
||
34 | * @source https://apidoc.thegoodtill.com/#api-Authentication-CreateToken |
||
35 | */ |
||
36 | public static function authorize(): array { |
||
39 | |||
40 | /** |
||
41 | * Good Till System: Revoke |
||
42 | * |
||
43 | * @return array |
||
44 | * @source https://apidoc.thegoodtill.com/#api-Authentication-InvalidateToken |
||
45 | */ |
||
46 | public static function revoke(): array { |
||
49 | |||
50 | /** |
||
51 | * Good Till System: Refresh |
||
52 | * |
||
53 | * @return array |
||
54 | * @source https://apidoc.thegoodtill.com/#api-Authentication-RefreshToken |
||
55 | */ |
||
56 | public static function refresh(): array { |
||
59 | |||
60 | /** |
||
61 | * Good Till System: Authorizer |
||
62 | * |
||
63 | * @param string $route |
||
64 | * @return array |
||
65 | */ |
||
66 | public static function authorizer(string $route): array { |
||
73 | } |