From 0dfe1d8afafc59c4a5559c498342668d5a58d6ef Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 23 Jul 2026 22:41:41 +0000
Subject: [PATCH] =Still working away at the Integrations overhaul
---
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