Post by rumenbl » Sat Aug 03, 2024 2:54 pm

Hi all hope you guys doing well. Last cuple of days have an issues with square payment gatway. I did try diferent version non of it works . My OC is 4.0.2.3 and extention ver. 4.0.5 API Ver. in square dashboard is Production API version 2022-02-16 and is the right for this extention.

Just wont conect in non setiting as sandbox or production. the errors I have meet are ;
We detected a possible cross site attack and have terminated your connection attempt. Please verify your application ID and secret and try again using the buttons in the admin panel.
And when switch browser to chrome is;
Warning: Undefined array key "access_token" in /public_html/extension/squareup/admin/controller/payment/squareup.php on line 605A general authorization error occurred. Please try again or contact support for more information.: in /public_html/extension/squareup/system/library/squareup/api.php on line 1235
I did contact with square and still waiting, also have a open ticket with isenselabs.
In the main time , just wondering if some one has the same problem and if has been fixed. My web site i full under SSL , testing the connection ( with diferent script ) to square has no return errors, mean hosting works and no restrictions.
Thanks

Newbie

Posts

Joined
Sat Jun 13, 2020 8:34 pm

Post by rumenbl » Sun Aug 04, 2024 1:09 am

so a bit of extra information which make me think all the issues coming of SQUARE and a small bug in OC. Please corect me if am not right haven touch PHP for the last 20 years.
afther five emails to square without any answer, some how extention start working for 30 min with sandbox and then for 5 min in production mode. Befor this meet another error an is;
Opencart\System\Library\DB::escape(): Argument #1 ($value) must be of type string, null given, called in /public_html/adminrum/model/setting/setting.php on line 55: in /public_html/system/library/db.php on line 58
Clearly can be seen this is states that the DB::escape() method expects a string value but received null. In file settings.php line 55 .
this is the code .
$this->db->query("INSERT INTO " . DB_PREFIX . "setting SET store_id = '" . (int)$store_id . "', code = '" . $this->db->escape($code) . "', key = '" . $this->db->escape($key) . "', value = '" . $this->db->escape($value) . "'");
moding to this works perfectly
$this->db->query("INSERT INTO `" . DB_PREFIX . "setting` SET `store_id` = '" . (int)$store_id . "', `code` = '" . $this->db->escape($code ?? '') . "', `key` = '" . $this->db->escape($key ?? '') . "', `value` = '" . $this->db->escape($value ?? '') . "'");
As I mention above haven touch anything related PHP for last 20 years. And my question is is this safety ?
Expecting profesional opinions .
Thanks

Newbie

Posts

Joined
Sat Jun 13, 2020 8:34 pm

Post by ADD Creative » Sun Aug 04, 2024 2:44 am

You need to find out why null is being set. You don't want to add to the settings table with the code and key being empty or null.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by rumenbl » Sun Aug 04, 2024 3:52 am

Thanks alots for the inforation, the problem is n the server logs or OC logs have no any aditional errors . have no idea were to look. if you can point ne at some direction will be good starting point.

ADD Creative wrote:
Sun Aug 04, 2024 2:44 am
You need to find out why null is being set. You don't want to add to the settings table with the code and key being empty or null.

Newbie

Posts

Joined
Sat Jun 13, 2020 8:34 pm

Post by ADD Creative » Sun Aug 04, 2024 4:40 am

Looking at the time of the errors in the error log can help. You can then look at the web access log to maybe see which page was causes the error. You could also add your own debug log messages after testing for the null values.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by rumenbl » Sun Aug 04, 2024 5:54 am

Thanks for the information. This happend when myself tryng to connect square extention in production mode. IF is in sandbox mode no issues everting works perfect.
No aditional errors in to logs including server log, am wondaring to downgrade OC to 3x , will wait a cuple of day to see if isenselabs can help wit his extention.
ADD Creative wrote:
Sun Aug 04, 2024 4:40 am
Looking at the time of the errors in the error log can help. You can then look at the web access log to maybe see which page was causes the error. You could also add your own debug log messages after testing for the null values.

Newbie

Posts

Joined
Sat Jun 13, 2020 8:34 pm
Who is online

Users browsing this forum: No registered users and 1 guest