From a6413da67a4579866f0fd0323ddb23a7b6b9654a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 18 Sep 2026 17:00:53 +0000
Subject: [PATCH] =Cleaning up the Integrations setup a bit, started the Helcim integration work too

---
 inc/managers/queue/executors/IntegrationExecutor.php |   26 +++++++++++---------------
 1 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/inc/managers/queue/executors/IntegrationExecutor.php b/inc/managers/queue/executors/IntegrationExecutor.php
index 9af8556..a44a4d0 100644
--- a/inc/managers/queue/executors/IntegrationExecutor.php
+++ b/inc/managers/queue/executors/IntegrationExecutor.php
@@ -3,6 +3,9 @@
 
 use JVBase\managers\queue\{Executor, Operation, Progress, Result};
 use Exception;
+use JVBase\inc\managers\ErrorHelper;
+use JVBase\integrations\ServiceMap;
+use JVBase\managers\Errors;
 
 if (!defined('ABSPATH')) {
 	exit;
@@ -28,11 +31,8 @@
  */
 final class IntegrationExecutor implements Executor
 {
-	/**
-	 * Map of integration service names to class identifiers.
-	 * Populated on first use from JVB()->connect().
-	 */
-	private array $integrationCache = [];
+	use ServiceMap, ErrorHelper;
+
 
 	public function execute(Operation $operation, Progress $progress): Result
 	{
@@ -60,15 +60,11 @@
 			};
 
 		} catch (Exception $e) {
-			JVB()->error()->log(
-				'[IntegrationExecutor]:execute',
-				$e->getMessage(),
-				[
-					'operation_id'   => $operation->id,
-					'operation_type' => $operation->type,
-					'user_id'        => $operation->userId,
-				]
-			);
+			$this->logError($e->getMessage(),'execute', [
+				'operation_id'   => $operation->id,
+				'operation_type' => $operation->type,
+				'user_id'        => $operation->userId,
+			]);
 
 			return new Result(
 				outcome: 'failed',
@@ -105,7 +101,7 @@
 		if ($userId === 0) {
 			$userId = null;
 		}
-		return JVB()->connect($serviceName, $userId);
+		return $this->getServiceUser($serviceName, $userId);
 	}
 
 	/*****************************************************************

--
Gitblit v1.10.0