Files
isaaccladandCursor ffe0b9d877
Deploy Ladill Woo Manager / deploy (push) Failing after 2s
Scaffold Ladill Woo Manager for WooCommerce order fulfillment.
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>
2026-07-06 22:39:38 +00:00

42 lines
1.2 KiB
PHP

<?php
namespace App\Services\Woo;
use App\Models\WooOrder;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class FulfillmentSyncService
{
public function push(WooOrder $order): void
{
$order->loadMissing('store');
$store = $order->store;
if (! $store || ! $store->plugin_token_hash) {
return;
}
$site = rtrim((string) $store->site_url, '/');
$url = $site.'/wp-json/ladill-woo/v1/orders/'.$order->external_order_id.'/fulfillment';
try {
Http::acceptJson()
->asJson()
->timeout(12)
->withHeaders([
'X-Ladill-Store' => $store->public_id,
])
->post($url, [
'fulfillment_status' => $order->fulfillment_status,
'order_number' => $order->order_number,
]);
} catch (\Throwable $e) {
Log::warning('Woo fulfillment sync failed', [
'order_id' => $order->id,
'store_id' => $store->id,
'error' => $e->getMessage(),
]);
}
}
}