How to verify Webhook Signature with PHP script

i read this document calculation signature and caculate signature

My source code like this

        $accessKey = <my_access_key>;
        $secretKey = <my_secret_key>;
        $urlPath =  <my_entire _url>; // example: https://test.com
        $salt = $request->header('salt', null);
        $timestamp = $request->header('timestamp', null);
        $body = $request->all();

        $bodyString = $body && !is_null($body) ? json_encode($body, JSON_UNESCAPED_SLASHES) : '';
        $signatureString = "$path$salt$timestamp$accessKey$secretKey$bodyString";
        $hashSignature = hash_hmac("sha256", $signatureString, $secretKey);
	    $signature = base64_encode($hashSignature);

But my caculator signature is not compare with signature of Rapyd webhook header. Please help me answer why?
Thank for support!

Thanks @Ha_Tr_n. This can happen if our body string is different. The $body_string format should be JSON format, but in the format of a string with no spaces.

For example, if the body is: { "hello": "world" }

It should encoded to a string as: {"hello":"world"}

I do suggest creating a ticket at https://support.rapyd.net and our support team can help you with all of your sensitive information.