Post by Cue4cheap » Thu Aug 14, 2025 11:56 am

All,
I am running condor's version of OC 2.3.0.2 with php 8.2. I get about 1/2 of my orders with customers using square but at times I have a customer unable to process an order. I am using isenselabs squareup extension for OC 2.3.0.2.
Every once in a while I get this in the error log and the customer isn't able to process an order through square.

- SQUAREUP RESULT: {"errors": [{"code": "EXPECTED_STRING","detail": "Expected a string value (line 1, character 108)","field": "reference_id","category": "INVALID_REQUEST_ERROR"}]}

- EXPECTED_STRING Field: reference_id

I have tried over and over using our credit cards and never have an issue but when I ask the customer they say they get just an error.

Anyone seen this before or have a guess?
Thank you,
Mike
Last edited by Cue4cheap on Fri Aug 15, 2025 11:22 am, edited 1 time in total.

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by JNeuhoff » Thu Aug 14, 2025 4:19 pm

OpenCart 2.3.0.2 doesn't support PHP 8.2. it only support PHP 7.3, or maybe PHP 7.4. The same is probably true with your iSenseLabs extension, you should ask them. It might be good idea to do a fresh install of the stable OpenCart 3.0.4.1 which supports PHP 8.2.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Cue4cheap » Thu Aug 14, 2025 11:32 pm

JNeuhoff wrote:
Thu Aug 14, 2025 4:19 pm
OpenCart 2.3.0.2 doesn't support PHP 8.2. it only support PHP 7.3, or maybe PHP 7.4. The same is probably true with your iSenseLabs extension, you should ask them. It might be good idea to do a fresh install of the stable OpenCart 3.0.4.1 which supports PHP 8.2.
Condor's version does.
I am also checking with them but was checking to see if anyone in the community has seen this.
Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by Cue4cheap » Fri Aug 15, 2025 11:21 am

Ok I think I found it:
in /system/library/vendor/isenselabs/squareup/api.php
There is these lines which what matches what is logged:

Code: Select all

    public function addLoggedInCustomer() {
        $request_data = array(
            'method' => 'POST',
            'endpoint' => self::ENDPOINT_CUSTOMERS,
            'auth_type' => 'Bearer',
            'parameters' => array(
                'given_name' => $this->customer->getFirstName(),
                'family_name' => $this->customer->getLastName(),
                'email_address' => $this->customer->getEmail(),
'reference_id' => (string)$this->customer->getId()
            )
        );
I changed the reference_id line to the one I have above. It was:
'reference_id' => $this->customer->getId()

Why the error didn't happen all the time is because not everyone logs in to make an order.

Time will tell but pretty sure this is the fix.
EDIT: Testing shows that IS the fix.

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by Cue4cheap » Sat Aug 16, 2025 9:01 am

BTW this fix will also work for the 3.x.x.x versions.
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 22 guests