Post by grozzy » Thu Dec 12, 2019 10:51 pm

I'm on OpenCart Version and am trying to get my Square Payments extension setup and connected. When I try to connect I'm getting the following error:

An error was encountered while refreshing the token: The `Authorization` http header of your request was malformed. The header value is expected to be of the format "Bearer TOKEN" (without quotation marks), where TOKEN is to be replaced with your access token (e.g. "Bearer ABC123def456GHI789jkl0"). For more information, see ... nseheaders. If you are seeing this error message while using one of our officially supported SDKs, please report this to

If I leave the extension setup and come back in, this is a persistent error message:

Your Square access token has expired or has been revoked! Click here to re-authorize the Square extension.

I installed OpenCart using Softaculous and I'm on shared hosting. I've verified with my hosting provider that cURL is enabled and there is no firewall issue blocking the connection. Emails to have gone unanswered twice now. Any help would be much appreciated. Thank you!



Tue Apr 24, 2018 11:02 pm

Post by thekrotek » Fri Dec 13, 2019 6:17 pm

But error message already tells you everything: token has expired, renew it.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by

User avatar
Expert Member


Sun Jul 03, 2016 12:24 am

Post by grozzy » Sat Dec 14, 2019 5:51 am

I don't really know how to do that. I've tried everything I can think of and can't get this to work. I found this in the forums and ran the script on my site:

$url = '';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($curl);
$error_number = curl_errno($curl);
$error_text = curl_error($curl);
$curl_info = curl_getinfo($curl);

echo '<h1>DATA:</h1>';
echo '<pre>' . htmlentities($data) . '</pre>';
echo '<h1>ERROR (' . $error_number . '):</h1>';
echo '<pre>' . $error_text . '</pre>';
echo '<h1>INFO:</h1>';
echo '<pre>'; print_r($curl_info); echo '</pre>';

This was the response, which seems normal:

"message": "NotFound",
"type": "not_found"
ERROR (0):
[url] =>
[content_type] => application/json
[http_code] => 404
[header_size] => 553
[request_size] => 69
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.219417
[namelookup_time] => 0.000563
[connect_time] => 0.050322
[pretransfer_time] => 0.163336
[size_upload] => 0
[size_download] => 51
[speed_download] => 232
[speed_upload] => 0
[download_content_length] => 51
[upload_content_length] => -1
[starttransfer_time] => 0.219345
[redirect_time] => 0
[redirect_url] =>
[primary_ip] =>
[certinfo] => Array

[primary_port] => 443
[local_ip] =>
[local_port] => 43296



Tue Apr 24, 2018 11:02 pm

Post by straightlight » Sat Dec 14, 2019 7:42 am

This was the response, which seems normal:

"message": "NotFound",
"type": "not_found"

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

Straightlight Administrator / Quality Assurance Analyst / Programmer

Legendary Member


Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Baidu [Spider] and 8 guests