From ed865422de92a360365a875428684e5d31bb0398 Mon Sep 17 00:00:00 2001 From: Ivan Stasiuk Date: Sat, 25 Dec 2021 17:25:13 +0200 Subject: [PATCH] fix!: make it breaking --- src/Client.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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();