Fix Woo sync: exempt webhooks from CSRF and backfill on connect.
Deploy Ladill Woo Manager / deploy (push) Successful in 39s
Deploy Ladill Woo Manager / deploy (push) Successful in 39s
Auto-import catalog and orders after store activation, add manual order sync, and allow WooCommerce webhooks without CSRF tokens. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\WooStore;
|
||||
use App\Services\Woo\StoreSyncService;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class StoreBootstrapSync
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct(public int $storeId) {}
|
||||
|
||||
public function handle(StoreSyncService $sync): void
|
||||
{
|
||||
$store = WooStore::query()
|
||||
->whereKey($this->storeId)
|
||||
->where('status', WooStore::STATUS_ACTIVE)
|
||||
->first();
|
||||
|
||||
if (! $store) {
|
||||
return;
|
||||
}
|
||||
|
||||
$counts = $sync->syncAll($store);
|
||||
|
||||
Log::info('Woo store bootstrap sync completed', [
|
||||
'store_id' => $store->id,
|
||||
'counts' => $counts,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user