Post by giantherbs » Thu Oct 03, 2024 1:35 pm

Hi All,

I am here in desperation. I have contacted Isense, and have yet to hear back from them.

My build is Opencart 3.0.2.0' Square 3.1.7. Square released an update on September 19th.
My square extension had previously worked fine.

After the update, it first made the link to my square extension white screen. I checked my server logs found a php error pointing to line 1235 system/library/squareup/api.php I commented this out //throw new \Squareup\Exception\Network("Temporary network error. Please try again later.");
That allowed my extension screen to load.

Then I began to get an error here:
PHP Warning: array_filter() expects parameter 1 to be array, null given in /var/www/vhosts/12LLC.com/httpsdocs/store/system/library/squareup/api.php on line 69

This is the code that has to do with that area:

Code: Select all

 public function verifyToken($access_token, &$first_location_id) {
        $locations = null;

        try {
            $request_data = array(
                'method' => 'GET',
                'endpoint' => self::ENDPOINT_LOCATIONS,
                'auth_type' => 'Bearer',
                'token' => $access_token
            );

            $api_result = $this->api($request_data);

            $locations = array_filter($api_result['locations'], array($this, 'filterLocation'));

            if (!empty($locations)) {
                $first_location = current($locations);
                $first_location_id = $first_location['id'];
            } else {
                $first_location_id = null;
            }
        } catch (\Squareup\Exception\Api $e) {
            if ($e->isAccessTokenRevoked() || $e->isAccessTokenExpired()) {
                return null;
            }

            // In case some other error occurred
            throw $e;
        }

        return $locations;
    }
As you might guess, this is stopping me from verifying my token.
"An error occurred when trying to refresh the extension's connection to your Square account. Please verify your application credentials and try again. "

There is a further error here: 2024-10-02 22:53:38 - PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/12LLC.com/httpsdocs/store/admin/model/extension/payment/squareup.php on line 201

Lastly, on my store, I am then getting this error: The expected currency is not supported on this store.
And in my attempt at a cron, I am getting the following error:
Here is a list of all CRON tasks performed by your Square extension:

Refresh of access token:
Error: Access token could not get refreshed. Please connect your Square Payment extension via the OpenCart admin panel.

Sync between Square and OpenCart:
Sync failed. Errors:
Your default store currency is different than your Square location currency, therefore the catalog was not synced. In order for Catalog Sync to work, your default OpenCart currency must be .

Hopefully that is enough info for someone to be able to tell me how to fix this. I can dive into the code, that is not a problem per se, I just don't know how this gets fixed...

As the great Princess Leia said: "Help Me Obi Wan Kanobi, Your My Only Hope!" My token expires on the 6th, but I suspect that it won't take payments as long as it is having the currency bug. I reached out to square and they said they couldn't help me because it wasn't part of their system (3rd party app). I don't know what else to do.
Thanks,
Jonathan

Newbie

Posts

Joined
Fri Apr 26, 2019 11:15 am

Post by Cue4cheap » Thu Oct 03, 2024 11:01 pm

giantherbs wrote:
Thu Oct 03, 2024 1:35 pm
Hi All,

I am here in desperation. I have contacted Isense, and have yet to hear back from them.

My build is Opencart 3.0.2.0' Square 3.1.7. Square released an update on September 19th.
My square extension had previously worked fine.

After the update, it first made the link to my square extension white screen. I checked my server logs found a php error pointing to line 1235 system/library/squareup/api.php I commented this out //throw new \Squareup\Exception\Network("Temporary network error. Please try again later.");
That allowed my extension screen to load.

Then I began to get an error here:
PHP Warning: array_filter() expects parameter 1 to be array, null given in /var/www/vhosts/12LLC.com/httpsdocs/store/system/library/squareup/api.php on line 69
Well WHY did you comment out that line? What does the line do? What IS that line 1235????
The next error probably is because you commented out that line. That line might just fill in the parameter that is sent to array_filter() .
So my suggestion is to post the line that is erroring and let us take a guess at what the issue is. BUT as you wrote it is the developer that should be the one that could fix their extension and you may have to wait for them.

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am
Who is online

Users browsing this forum: No registered users and 6 guests