url = config('fib.cancelPayment.url'); $this->channelName = ''; } public function setHeaders(): void { $this->headers = [ 'Authorization' => 'Bearer ' . $this->accessToken, 'Content-Type' => 'application/json', ]; } /** * @throws Exception */ public function run(): array { try { return $this->sendRequest(); } catch (Exception $e) { Log::channel($this->channelName) ->error(get_class($this), [ 'message' => $e->getMessage(), ] ); throw $e; } } /** * @throws ConnectionException */ public function sendRequest(): array { return Http::withHeaders($this->headers) ->throw() ->withoutVerifying() ->post($this->url) ->json(); } }