From 4089ba01e0881c89a72332e13bc3a80b6bddec2a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 29 Jun 2026 22:15:55 +0000
Subject: [PATCH] =DashboardManager overhaul. A bit easier to modify the output of pages. Still have to get the account pages to work as expected, as well as verify the integrations and others are working - but registrar/content pages work as expected. Also fixed up the table generation in CRUD.js and CRUDSkeleton.php

---
 assets/js/concise/CheckoutSquare.js |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/assets/js/concise/CheckoutSquare.js b/assets/js/concise/CheckoutSquare.js
index f1fb448..4d64210 100644
--- a/assets/js/concise/CheckoutSquare.js
+++ b/assets/js/concise/CheckoutSquare.js
@@ -37,6 +37,7 @@
 		}
 
 		try {
+			this.isActive = true;
 			this.payments = window.Square.payments(
 				this.config.application_id,
 				this.config.location_id
@@ -51,8 +52,7 @@
 			}));
 
 		} catch (error) {
-			console.error('Failed to initialize Square payments:', error);
-			this.handleError(error);
+			this.isActive = false;
 		}
 	}
 
@@ -156,11 +156,10 @@
 			throw new Error('Store is currently closed');
 		}
 
-		const response = await fetch(this.config.api_url + 'process-payment', {
+		const response = await window.auth.fetch(`${this.api}process-payment`, {
 			method: 'POST',
 			headers: {
 				'Content-Type': 'application/json',
-				'X-WP-Nonce': this.config.nonce,
 			},
 			body: JSON.stringify({
 				source_id:     sourceToken,
@@ -215,9 +214,8 @@
 
 	async loadSavedCards() {
 		try {
-			const response = await fetch(this.config.api_url + 'saved-cards', {
-				method: 'GET',
-				headers: { 'X-WP-Nonce': this.config.nonce },
+			const response = await window.auth.fetch(`${this.api}saved-cards`, {
+				method: 'POST',
 			});
 
 			const result = await response.json();

--
Gitblit v1.10.0