private static function serializePayload($payload = '') : string
    {
        // If the payload is already JSON, return it
        if (\is_string($payload)) {
            return $payload;
        }

        $data = '';

        if (!empty($payload)) {
            $data = \json_encode($payload, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION);
        }

        return $data;
    }
private static function serializePayload($payload = '') : string
    {
        // If the payload is already JSON, return it
        if (\is_string($payload)) {
            return $payload;
        }

        $data = '';

        if (!empty($payload)) {
            $data = \json_encode($payload, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION);
        }

        return $data;
    }
private static function serializePayload ( $ payload = '' ) : string { // If the payload is already JSON, return it if ( \ is_string ( $ payload ) ) { return $ payload ; } $ data = '' ; if ( ! empty ( $ payload ) ) { $ data = \ json_encode ( $ payload , JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION ) ; } return $ data ; }
Serializes the payload for signing

@param array|string $payload
@return string
Serializes the payload for signing