Total Complexity | 5 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class MonzoProvider extends AbstractProvider implements ProviderInterface |
||
10 | { |
||
11 | /** |
||
12 | * Unique Provider Identifier. |
||
13 | */ |
||
14 | const IDENTIFIER = 'MONZO'; |
||
15 | |||
16 | /** |
||
17 | * {@inheritdoc} |
||
18 | */ |
||
19 | protected $scopes = []; |
||
20 | |||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | protected function getAuthUrl($state) |
||
25 | { |
||
26 | return $this->buildAuthUrlFromBase('https://auth.monzo.com/', $state); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | protected function getTokenUrl() |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | protected function getUserByToken($token) |
||
41 | { |
||
42 | $response = $this->getHttpClient()->get('https://api.monzo.com/ping/whoami', [ |
||
43 | 'headers' => [ |
||
44 | 'Authorization' => 'Bearer ' . $token, |
||
45 | ], |
||
46 | ]); |
||
47 | |||
48 | return json_decode($response->getBody(), true); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | protected function mapUserToObject(array $user) |
||
58 | ]); |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | protected function getTokenFields($code) |
||
71 |