1 | <?php |
||
13 | final class DefaultInstallationService implements InstallationService |
||
14 | { |
||
15 | /** |
||
16 | * @var ClientInterface |
||
17 | */ |
||
18 | private $httpClient; |
||
19 | |||
20 | /** |
||
21 | * @var CertificateStorage |
||
22 | */ |
||
23 | private $certificateStorage; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $apiKey; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | private $permittedIps; |
||
34 | |||
35 | /** |
||
36 | * The installation service requires a http client without the bunq middleware's |
||
37 | * |
||
38 | * @param ClientInterface $httpClient |
||
39 | * @param CertificateStorage $certificateStorage |
||
40 | * @param string $apiKey |
||
41 | * @param array $permittedIps |
||
42 | */ |
||
43 | public function __construct( |
||
54 | |||
55 | /** |
||
56 | * Registers your public key with the Bunq API. |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | public function install() |
||
80 | |||
81 | /** |
||
82 | * Registers a device with the Bunq API. |
||
83 | * |
||
84 | * @param Token $token |
||
85 | * |
||
86 | * return void |
||
87 | */ |
||
88 | public function registerDevice(Token $token) |
||
104 | |||
105 | /** |
||
106 | * Registers a session with the Bunq API. |
||
107 | * |
||
108 | * @param Token $token |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | public function createSession(Token $token) |
||
130 | |||
131 | /** |
||
132 | * Sends a post request using the installation HTTP Client |
||
133 | * |
||
134 | * @param $url |
||
135 | * @param array $options |
||
136 | * |
||
137 | * @return ResponseInterface |
||
138 | * @throws BunqException |
||
139 | */ |
||
140 | private function sendInstallationPostRequest($url, array $options = []) |
||
148 | } |
||
149 |