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/integrations/Integrations.php |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/inc/integrations/Integrations.php b/inc/integrations/Integrations.php
index f2e8147..d6ff18f 100644
--- a/inc/integrations/Integrations.php
+++ b/inc/integrations/Integrations.php
@@ -247,7 +247,7 @@
 	public function testConnection(bool $force = false): bool
 	{
 		if (!$this->isSetUp()) {
-			return false;
+			return true;
 		}
 		$this->ensureInitialized();
 
@@ -255,13 +255,6 @@
 			return false;
 		}
 
-		// Cache test results to avoid excessive API calls
-		$cacheKey = "connection_test_$this->service_name" . ($this->userID ? "_$this->userID" : '');
-		$cached = $this->cache->get($cacheKey);
-
-		if ($cached !== false && !$force) {
-			return (bool)$cached;
-		}
 
 		try {
 			if (!$this->hasOAuthCredentials()){
@@ -272,11 +265,9 @@
 			}
 
 			$this->updateLastTestedTime();
-			$this->cache->set($cacheKey, $result, 300); // Cache for 5 minutes
 			return $result;
 		} catch (Exception $e) {
-			$this->logError('Connection test failed', ['error' => $e->getMessage()]);
-			$this->cache->set($cacheKey, false, 60); // Cache failure for 1 minute
+			$this->logError('testConnection', $e->getMessage());
 			return false;
 		}
 	}
@@ -634,4 +625,9 @@
 		return $this->icon;
 	}
 
+	public function getUserID():?int
+	{
+		return $this->userID;
+	}
+
 }

--
Gitblit v1.10.0