Deploy Ladill Woo Manager / deploy (push) Failing after 2s
Standalone app with SSO shell, WordPress plugin connect flow, webhook ingest, fulfillment inbox, and plugin activation API — no payment processing. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
613 B
PHP
27 lines
613 B
PHP
<?php
|
|
|
|
namespace App\Services\Woo;
|
|
|
|
use App\Models\WooStore;
|
|
use Illuminate\Http\Request;
|
|
|
|
class WooWebhookVerifier
|
|
{
|
|
public function verify(Request $request, WooStore $store): bool
|
|
{
|
|
$signature = (string) $request->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);
|
|
}
|
|
}
|