header('X-WC-Webhook-Signature', ''); if ($signature === '') { return false; } $secret = (string) $store->webhook_secret; if ($secret === '') { return false; } $expected = base64_encode(hash_hmac('sha256', $request->getContent(), $secret, true)); return hash_equals($expected, $signature); } }