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/services/SquareOld.php | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/inc/integrations/services/SquareOld.php b/inc/integrations/services/SquareOld.php
index 1dd7da9..b5fd010 100644
--- a/inc/integrations/services/SquareOld.php
+++ b/inc/integrations/services/SquareOld.php
@@ -3,7 +3,9 @@
namespace JVBase\integrations\services;
use Exception;
use JVBase\integrations\Integrations;
+use JVBase\managers\Emails;
use JVBase\managers\queue\executors\IntegrationExecutor;
+use JVBase\managers\queue\Queue;
use JVBase\managers\queue\TypeConfig;
use JVBase\meta\Form;
use JVBase\meta\Meta;
@@ -51,7 +53,7 @@
protected string $environment = 'sandbox';
- private const PASSWORD_RESET_INTERVAL = 3; // Reset password every 3 logins, for customers
+ // Reset password every 3 logins, for customers
/**
* OAuth Configuration
@@ -235,9 +237,9 @@
? 'https://connect.squareup.com'
: 'https://connect.squareupsandbox.com';
- $this->oauth['authorize'] = $baseUrl . '/oauth2/authorize';
- $this->oauth['token'] = $baseUrl . '/oauth2/token';
- $this->oauth['revoke'] = $baseUrl . '/oauth2/revoke';
+ $this->oauth->getAuthorize() = $baseUrl . '/oauth2/authorize';
+ $this->oauth->getToken() = $baseUrl . '/oauth2/token';
+ $this->oauth->getRevoke() = $baseUrl . '/oauth2/revoke';
// Set up API endpoints with version
$this->apiEndpoints = [
@@ -406,7 +408,7 @@
'redirect_uri' => $this->getRedirectUri()
];
- $response = wp_remote_post($this->oauth['token'], [
+ $response = wp_remote_post($this->oauth->getToken(), [
'body' => json_encode($body),
'headers' => [
'Content-Type' => 'application/json',
@@ -462,7 +464,7 @@
return false;
}
- $response = wp_remote_post($this->oauth['token'], [
+ $response = wp_remote_post($this->oauth->getToken(), [
'body' => [
'client_id' => $this->credentials['client_id'],
'client_secret' => $this->credentials['client_secret'],
@@ -821,7 +823,7 @@
try {
// Revoke the token with Square
if (!empty($this->credentials['access_token'])) {
- wp_remote_post($this->oauth['revoke'], [
+ wp_remote_post($this->oauth->getRevoke(), [
'body' => [
'client_id' => $this->credentials['client_id'] ?? '',
'access_token' => $this->credentials['access_token']
--
Gitblit v1.10.0