client = $client ?? new Client([ 'base_uri' => $config->endpoint, 'timeout' => 5.0, ]); } public function post(string $uri, array $payload, string $token): ResponseInterface { return $this->client->post($uri, [ 'headers' => [ 'Authorization' => "Bearer {$token}", 'Content-Type' => 'application/json', 'Idempotency-Key' => (string) Str::uuid(), ], 'json' => $payload, ]); } public function get(string $uri, string $token): ResponseInterface { return $this->client->get($uri, [ 'headers' => [ 'Authorization' => "Bearer {$token}", 'Content-Type' => 'application/json', ], ]); } public function postForm(string $uri, array $formParams): ResponseInterface { return $this->client->post($uri, [ 'form_params' => $formParams, ]); } }