client = new EcomZoneClient(); } public function testProductFetch() { try { // Get first page with one product $result = $this->client->getCatalog(1, 1); EcomZoneLogger::log("API Test Result", "INFO", [ "result" => $result, ]); return $result; } catch (Exception $e) { EcomZoneLogger::log("API Test Failed", "ERROR", [ "error" => $e->getMessage(), ]); throw $e; } } public function getProducts($page = 1, $perPage = 10) { try { $result = $this->client->getCatalog($page, $perPage); return [ "products" => $result["data"] ?? [], "total" => $result["total"] ?? 0, "current_page" => $page, "per_page" => $perPage, ]; } catch (Exception $e) { EcomZoneLogger::log("Failed to get products", "ERROR", [ "error" => $e->getMessage(), ]); throw $e; } } }