Jake Vanderwerf
5 days ago 0dfe1d8afafc59c4a5559c498342668d5a58d6ef
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();