$query * @return array */ protected function request(string $path, array $query = []): array { $this->assertConfigured(); try { $response = $this->httpClient->request('GET', $this->baseUrl.$path, [ 'headers' => [ 'X-API-KEY' => $this->apiKey, ], 'query' => $query, ]); return $response->toArray(); } catch (ExceptionInterface $e) { $this->logger->error('BpnConnect request failed', [ 'path' => $path, 'query' => $query, 'error' => $e->getMessage(), ]); throw new BpnConnectException('BpnConnect request failed: '.$e->getMessage(), 0, $e); } } private function assertConfigured(): void { if (null === $this->baseUrl || null === $this->apiKey) { throw new BpnConnectException('BpnConnect client is not configured (missing BPN_CONNECT_BASE_URL or BPN_CONNECT_API_KEY).'); } } }