From fff721dd185f5b97f7ae7a6e64189e55887ff590 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 05 Jul 2026 18:36:57 +0000
Subject: [PATCH] =Cleaning up the Square integration (still a bit more to do yet). Also majorly overhauled /rest/ files to ignore a rest request 'user' paramater, and rely on get_current_user_id() instead.
---
JVBase.php | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/JVBase.php b/JVBase.php
index ea4f09c..90f903d 100644
--- a/JVBase.php
+++ b/JVBase.php
@@ -47,6 +47,7 @@
use JVBase\rest\routes\AdminRoutes;
use JVBase\rest\routes\IntegrationsRoutes;
use JVBase\base\SchemaHelper;
+use UserRoutes;
if (!defined('ABSPATH')) {
exit;
@@ -120,10 +121,11 @@
'queue' => new QueueRoutes(),
'settings' => new SettingsRoutes(),
'upload' => new UploadRoutes(),
- 'forms' => new FormRoutes()
+ 'forms' => new FormRoutes(),
+ 'user' => new UserRoutes()
];
- if (Site::has('magicLink')) {
+ if (Site::has('magic_link')) {
// $this->routes['magicLink'] = new MagicLinkRoutes();
$this->managers['magicLink'] = new MagicLinkManager();
}
@@ -212,7 +214,7 @@
protected function setupIntegrations(): void
{
foreach(array_keys(Site::getIntegrations()) as $integration) {
- $this->integrations[$integration] = new $this->serviceMap[$integration]();
+ $this->integrations[$integration] = $this->serviceMap[$integration]::getInstance();
}
}
@@ -302,7 +304,7 @@
if (!array_key_exists($service, $this->integrations)) {
return null;
}
- return new $this->serviceMap[$service]($userID);
+ return $this->serviceMap[$service]::getInstance($userID);
}
return (array_key_exists($service, $this->integrations)) ? $this->integrations[$service] : null;
}
@@ -374,10 +376,10 @@
?>
<section class="main-actions">
<div class="buttons col">
- <?= implode($buttons); ?>
+ <?= implode('', $buttons); ?>
</div>
<div class="actions">
- <?= implode($contents); ?>
+ <?= implode('', $contents); ?>
</div>
</section>
<?php
--
Gitblit v1.10.0