Quote Originally Posted by strelitzia View Post
I'm seeing the following error in the logs after an attempt to use Square.

PHP Warning: Illegal string offset 'id' in /home/devsite/public_html/includes/modules/payment/square.php on line 142

The module code hasn't been edited in any way.
Site is a clean install of 1.5.5f
Server is running PHP Version: 5.6.35 (Zend: 2.6.0). It was on PHP 7.1.12, but I switched to an older PHP version to see if it cleared the issue. No change.

I checked the array key is wrapped in quotes, and it is.

$sql = "SELECT zone_id FROM " . TABLE_ZONES_TO_GEO_ZONES . " WHERE geo_zone_id = '" . (int)MODULE_PAYMENT_SQUARE_ZONE . "' AND zone_country_id = '" . (int)$order->billing['country']['id'] . "' ORDER BY zone_id";

Any suggestions?
That's essentially saying that $order->billing['country']['id'] doesn't exist, which suggests that $order->billing['country'] isn't defined as an array ... which suggests something's amuck with the address, which suggests that either the customer is connected to an invalid address (ie: a prior address_book entry that no longer has a corresponding country record), or your order class isn't populating the country data properly when passing it to the module. You didn't say whether this was triggered by a customer purchase or if it was from an Admin attempt to look up an order paid by Square.
Lots of moving parts.
It's only a Warning, so isn't causing a fatal/crash (blank page) situation.

Can you shed more light on the actual transaction and why the country data wouldn't be set properly when that Warning was generated?