$this->publicKey,]; $headers = $this->getDefaultHeaders(); $response = $this->sendUnsignedBunqPost($uri, $data, $headers); Log::debug('Installation request response', $response); $this->installationId = $this->extractInstallationId($response); $this->serverPublicKey = $this->extractServerPublicKey($response); $this->installationToken = $this->extractInstallationToken($response); Log::debug(sprintf('Installation ID: %s', serialize($this->installationId))); Log::debug(sprintf('Installation token: %s', serialize($this->installationToken))); Log::debug(sprintf('server public key: %s', serialize($this->serverPublicKey))); return; } /** * @return InstallationId */ public function getInstallationId(): InstallationId { return $this->installationId; } /** * @return InstallationToken */ public function getInstallationToken(): InstallationToken { return $this->installationToken; } /** * @return string */ public function getPublicKey(): string { return $this->publicKey; } /** * @param string $publicKey */ public function setPublicKey(string $publicKey) { $this->publicKey = $publicKey; } /** * @param array $response * * @return InstallationId */ private function extractInstallationId(array $response): InstallationId { $installationId = new InstallationId; $data = $this->getKeyFromResponse('Id', $response); $installationId->setId(intval($data['id'])); return $installationId; } /** * @param array $response * * @return InstallationToken */ private function extractInstallationToken(array $response): InstallationToken { $data = $this->getKeyFromResponse('Token', $response); $installationToken = new InstallationToken($data); return $installationToken; } /** * @param array $response * * @return ServerPublicKey */ private function extractServerPublicKey(array $response): ServerPublicKey { $data = $this->getKeyFromResponse('ServerPublicKey', $response); $serverPublicKey = new ServerPublicKey($data); return $serverPublicKey; } }