API Invalid Signature on Routes with Request Query Parameters in Laravel PHP

I’m currently integrating Rapyd into our system and testing out different routes. I’ve used the base code from one of the tutorials for PHP and modified it to be more inline with our framework.

When visiting GET routes that do not have query parameters, the request is successful. It also works for sending POST requests. But on GET requests that have query parameters, I am currently getting an error code of UNAUTHENTICATED_API_CALL.

Here is the code for the service of connecting to Rapyd API.

class RapydService
{
    protected string $baseUrl;
    protected string $secretKey;
    protected string $accessKey;

    public function __construct()
    {
        $this->baseUrl = config('services.external.rapyd.api_url');
        $this->secretKey = config('services.external.rapyd.api_secret');
        $this->accessKey = config('services.external.rapyd.api_key');
    }

    private function generateString(int $length = 12): string
    {
        return Str::random($length);
    }

    public function makeRequest(string $method, string $path, array $body = []): array
    {
        $idempotency = $this->generateString();
        $salt        = $this->generateString();
        $timestamp   = now()->timestamp;

        $bodyString    = !empty($body) ? json_encode($body, JSON_UNESCAPED_SLASHES) : '';
        $sigString     = "{$method}{$path}{$salt}{$timestamp}{$this->accessKey}{$this->secretKey}{$bodyString}";
        $hashSigString = hash_hmac("sha256", $sigString, $this->secretKey);
        $signature     = base64_encode($hashSigString);

        $response = Http::withHeaders([
            'Content-Type'  => 'application/json',
            'access_key'    => $this->accessKey,
            'salt'          => $salt,
            'timestamp'     => $timestamp,
            'signature'     => $signature,
            'idempotency'   => $idempotency
        ])->{$method}("{$this->baseUrl}{$path}", $body);

        if ($response->failed()) {
            throw new Exception("HTTP Request failed: " . $response->body());
        }

        return $response->json();
    }
}