diff --git a/src/Client.php b/src/Client.php index 8f7391c..f112fe4 100644 --- a/src/Client.php +++ b/src/Client.php @@ -99,13 +99,6 @@ public function verifyOneTimePassword(OtpRequestInterface $otpRequest, string $p */ private function performRequest(HttpMethodEnum $method, string $uri, array $data): ResponseInterface { - $options = [ - \GuzzleHttp\RequestOptions::HTTP_ERRORS => false, - \GuzzleHttp\RequestOptions::HEADERS => [ - 'Accept' => 'application/json', - ], - ]; - $data['api_key'] = $this->config->getPublicKey(); $option = match($method) { @@ -113,7 +106,13 @@ private function performRequest(HttpMethodEnum $method, string $uri, array $data default => \GuzzleHttp\RequestOptions::JSON, }; - $options[$option] = $data; + $options = [ + \GuzzleHttp\RequestOptions::HTTP_ERRORS => false, + \GuzzleHttp\RequestOptions::HEADERS => [ + 'Accept' => 'application/json', + ], + $option => $data, + ]; if ($this->getSourceModel()) { $options[RequestOptions::SOURCE_MODEL] = $this->getSourceModel();