From e6672fe38ce5d99f3b3f026154f777aded7361de Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 29 Jan 2026 17:36:53 +0000
Subject: [PATCH] =Starting refactor of Meta and Routes to fluent-style

---
 inc/integrations/Square.php |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/inc/integrations/Square.php b/inc/integrations/Square.php
index aab2903..4b9dd2a 100644
--- a/inc/integrations/Square.php
+++ b/inc/integrations/Square.php
@@ -379,8 +379,6 @@
 	 */
 	protected function exchangeOAuthCode(string $code): ?array
 	{
-		error_log('Exchanging tokens with credentials: '.print_r($this->credentials, true));
-
 		$this->ensureInitialized();
 
 		// Prepare the request body as an array
@@ -406,7 +404,6 @@
 		}
 
 		$data = json_decode(wp_remote_retrieve_body($response), true);
-		error_log('OAuth Response: '.print_r($data, true));
 		if (isset($data['access_token'])) {
 			return [
 				'access_token' => $data['access_token'],
@@ -468,7 +465,6 @@
 
 		$data = json_decode(wp_remote_retrieve_body($response), true);
 
-		error_log('RefreshAccessToken Response: '.print_r($data, true));
 		if (isset($data['access_token'])) {
 			$this->credentials['access_token'] = $data['access_token'];
 			$this->credentials['expires_at'] = time() + ($data['expires_in'] ?? 2592000); // 30 days
@@ -491,7 +487,6 @@
 	{
 		// Skip if we don't have credentials yet (during OAuth flow)
 		if (empty($this->credentials['access_token'])) {
-			error_log('[Square] Skipping loadLocations - no access token yet');
 			return;
 		}
 		try {
@@ -1083,7 +1078,6 @@
 	 */
 	protected function handleTheSavePost(int $postID, \WP_Post $post, bool $update, array $settings): void
 	{
-		error_log('Queuing Sync to Square');
 		// Queue the sync operation
 		$this->queueOperation('sync_to_square', [
 			'items' => [$postID],
@@ -2578,7 +2572,7 @@
 			update_user_meta($user->ID, BASE . '_square_customer_updated', current_time('mysql'));
 
 			// Clear cached customer data
-			$this->cache->delete('square_customer_' . $user->ID);
+			$this->cache->forget('square_customer_' . $user->ID);
 		}
 
 		return true;
@@ -2809,7 +2803,6 @@
 
 			// Validate environment setting
 			if (isset($credentials['environment'])) {
-				error_log('Environment: '.print_r($credentials['environment'], true));
 				$validEnvironments = ['sandbox', 'production'];
 				if (!in_array($credentials['environment'], $validEnvironments)) {
 					$this->logError('Invalid environment setting', [

--
Gitblit v1.10.0