Add catalog sync trigger, metrics, and shipping label actions to integrations.
Deploy Ladill Woo Manager / deploy (push) Successful in 1m5s
Deploy Ladill Woo Manager / deploy (push) Successful in 1m5s
Surfaces actionable controls in Ladill instead of status-only cards: sync catalogs via the plugin proxy, show channel metrics, and link to orders/labels for fulfillment. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -23,6 +23,43 @@ class PluginClient
|
||||
return $this->request($store, 'POST', $path, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $payload
|
||||
* @return array{reachable: bool, successful: bool, body: ?array<string, mixed>}
|
||||
*/
|
||||
public function postWithDetails(WooStore $store, string $path, array $payload = []): array
|
||||
{
|
||||
try {
|
||||
$response = $this->raw($store, 'POST', $path, $payload);
|
||||
} catch (ConnectionException $e) {
|
||||
$this->logConnectionFailure($store, 'POST', $path, $e);
|
||||
|
||||
return [
|
||||
'reachable' => false,
|
||||
'successful' => false,
|
||||
'body' => null,
|
||||
];
|
||||
}
|
||||
|
||||
/** @var array<string, mixed>|null $json */
|
||||
$json = $response->json();
|
||||
|
||||
if (! $response->successful()) {
|
||||
Log::warning('Woo plugin API request failed', [
|
||||
'store_id' => $store->id,
|
||||
'method' => 'POST',
|
||||
'path' => $path,
|
||||
'status' => $response->status(),
|
||||
]);
|
||||
}
|
||||
|
||||
return [
|
||||
'reachable' => true,
|
||||
'successful' => $response->successful(),
|
||||
'body' => is_array($json) ? $json : null,
|
||||
];
|
||||
}
|
||||
|
||||
/** @param array<string, mixed> $payload */
|
||||
public function put(WooStore $store, string $path, array $payload = []): ?array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user