Re: Square Payment Module for Zen Cart [Support Thread]
So I've been tracing this problem of the Access Token Needed. I put in a lot of error_log statements to get an idea.
After some thought, I went out to the Square Developer page for my App. On the Credentials section, I changed the API Version to:
Your API Version
2018-12-05 (15 versions behind)
Which is what I found the module was written to on line 36 of "includes/modules/square.php":
Code:
protected $SquareApiVersion = '2018-12-05';
That got a log file generated when I tried the green 'Click here to log in and Authorize your account' button in the payment module configuration (Edited to remove the token data):
Code:
[20-Feb-2020 18:39:43 America/Chicago] SQUARE TOKEN REQUEST - auth code for exchange: sq0cgp-(data removed for security)
Array
(
[ code] => sq0cgp-(data removed for security)
[response_type] => code
[state] => 5e4f25bc0e298
[main_page] => index
)
But the module is still reporting '(Access Token needed)'.
Re: Square Payment Module for Zen Cart [Support Thread]
Further troubleshooting for my problem. I've narrowed down the error which has something to do with my SSL certificate?
Re: Square Payment Module for Zen Cart [Support Thread]
Looked at the curltester.php, it's giving the same error.
I went out to IONOS and revoked the old certificate and renewed and installed a new one. Same error. SSLLabs still gives my website an "A".
Still the curltester.php gives these errors:
Code:
Testing communications to various destinations. This is a simple diagnostic to determine whether your server can connect to common destinations.
For advanced "details" mode, add ?details=on to the URL.
(Another resource you may find useful for testing your server's overall customer-facing SSL configuration: https://www.ssllabs.com/ssltest/index.html )
Connecting to Zen Cart Version Server (http) ...
GOOD: CURL Connection successful.
Connecting to Zen Cart Version Server (https) ...
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to Zen Cart Support Server (https) ...
Error 60: SSL certificate problem: self signed certificate in certificate chain
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to USPS (port 80)...
GOOD: CURL Connection successful.
Connecting to USPS Test/Staging/Sandbox Server (port 80)...
GOOD: CURL Connection successful.
Connecting to UPS (port 80)...
GOOD: CURL Connection successful.
GOOD: Socket established
Connecting to UPSXML (onlinetools.ups.com) ...
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to UPSXML (sandbox) ...
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to FedEx (port 80)...
GOOD: Socket established
Connecting to Canada Post REST API (SSL) ...
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to PayPal IPN (port 443)...
GOOD: Socket established
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to PayPal IPN (port 443) Sandbox ...
GOOD: Socket established
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to PayPal Express/Pro Server ...
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to PayPal Express/Pro Sandbox ...
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to PayPal Payflowpro Server ...
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to Cardinal Commerce 3D-Secure Server ...
Error 60: SSL certificate problem: self signed certificate in certificate chain
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to AuthorizeNet Production Server ...
Error 60: SSL certificate problem: self signed certificate in certificate chain
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to AuthorizeNet Developer/Sandbox Server ...
Error 60: SSL certificate problem: self signed certificate in certificate chain
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to First Data GGe4 server (SSL)...
Error 60: SSL certificate problem: unable to get local issuer certificate
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to Payeezy Processing Server...
Error 60: SSL certificate problem: self signed certificate in certificate chain
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to Payeezy Sandbox Server...
Error 60: SSL certificate problem: self signed certificate in certificate chain
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to Elavon Server...
Error 60: SSL certificate problem: self signed certificate in certificate chain
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Connecting to Elavon Sandbox Server...
Error 60: SSL certificate problem: self signed certificate in certificate chain
IMPORTANT NOTE: Error 60 or 61 means that this server has an SSL certificate configuration problem. YOU NEED TO ASK YOUR HOSTING COMPANY SERVER ADMIN FOR ASSISTANCE with fixing the server's OpenSSL certificate chain.
This error has nothing to do with Zen Cart. It is a server configuration issue.
(If you are running this test on a localhost/PC/dev/standlone server then you can either ignore this until you put the site on a live production server, or temporarily override things by manually configuring the CURLOPT_CAINFO value with a legitimate CA bundle. If you don't know what that means, just defer your CURL testing until you are on a live production webserver!)
Testing again with less security...
GOOD: CURL Connection successful. (but without being able to verify certificate chain. Again: this is a server issue, not a Zen Cart issue.)
Testing completed. See results above.
Why does some of these other servers also fail?
Re: Square Payment Module for Zen Cart [Support Thread]
Square Credit Card Payments - SQ-NONCE-FAILURE
Error Log:
PHP Notice: Exception when calling LocationsApi->listLocations: [HTTP/2 401] {"errors":[{"category":"AUTHENTICATION_ERROR","code":"UNAUTHORIZED","detail":"This request could not be authorized."}]} in /home/***/public_html/shop/includes/modules/payment/square.php on line 703
On-screen error in checkout:
We could not initiate your transaction because of a problem with the card data you entered. Please correct the card data, or report this error to the Store Owner: SQ-NONCE-FAILURE
The fix:
Turn off javascript loading for features in the site not needed in the checkout pages.
Found in:
includes/templates/YOUR_TEMPLATE/common/html_header.php
also may be in tpl_header.php (not in my case with this site)
Re: Square Payment Module for Zen Cart [Support Thread]
Square did a change to their API that has broken this module. Customers are seeing HTTP 500 after clicking Confirm Order on Step 3. I'm getting the following error in my logs:
Code:
[04-Mar-2020 13:37:39 America/Chicago] PHP Fatal error: Uncaught Error: Call to undefined method SquareConnect\Configuration::callApi() in \www\store\includes\classes\vendors\square\connect\lib\Api\OAuthApi.php:134
Stack trace:
#0 \www\store\includes\classes\vendors\square\connect\lib\Api\OAuthApi.php(78): SquareConnect\Api\OAuthApi->obtainTokenWithHttpInfo(Object(SquareConnect\Model\ObtainTokenRequest))
#1 \www\store\includes\modules\payment\square.php(692): SquareConnect\Api\OAuthApi->obtainToken(Object(SquareConnect\Model\ObtainTokenRequest))
#2 \www\store\includes\modules\payment\square.php(557): square->renewOAuthToken()
#3 \www\store\includes\modules\payment\square.php(492): square->token_refresh_check()
#4 \www\store\includes\modules\payment\square.php(356): square->getAccessToken()
#5 \www\store\includes\classes\payment.php(245): square->before_process()
#6 \www\store\includes\modules\checkout_process.php(84): payment->before_process()
#7 \www\store\includes\modules\pages\checkout_process\header_php.php(14): require('\\www\\sto...')
#8 \www\store\index.php(36): require('\\www\\sto...')
#9 {main}
thrown in \www\store\includes\classes\vendors\square\connect\lib\Api\OAuthApi.php on line 134
The last successful order I had with this module was on the 26th of February.
Unfortunately, because of this problem, I'm not able to use the Admin site Payments Module configuration page to disable this module so I can enable another. Help!
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
Fjolsvith
Square did a change to their API that has broken this module.
Um ... The error suggests that you've changed the PHP files associated with this module. If it was something Square did only on their end, the error would be different.
What's the back-story of changes to the PHP files?
Which set of files are you using? v0.9xxx? or 1.0-beta? Or a hybrid of files that you've changed independently?
Re: Square Payment Module for Zen Cart [Support Thread]
Fjolsvith
If the fileset is the newest from the Zen Plugins, you may need to re-key your store to My Apps in Square.
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
DrByte
Um ... The error suggests that you've changed the PHP files associated with this module. If it was something Square did only on their end, the error would be different.
What's the back-story of changes to the PHP files?
Which set of files are you using? v0.9xxx? or 1.0-beta? Or a hybrid of files that you've changed independently?
Ah, you are correct. I modified modules\payment\square.php around line 318 to add extra information about the order to the description passed to square:
Code:
if (sizeof($order->products) < 100) {
$p = '';
for ($i = 0; $i < sizeof($order->products); $i++) {
$p2 = $order->products[$i];
if (!$p == '') {
$p .= ', ';
}
$p .= '(' . $p2['qty'] . ') ' . $p2['name'] ;
}
}
$p = 'Item(s) Ordered:' . $p;
$d = 'Delivery Address: ' . $order->delivery['street_address'] . ', ' . $order->delivery['city'] . ', ' . $order->delivery['state'] . ' ' . $order->delivery['postcode'] . ' tel:' . $order->customer['telephone'];
$p .= '; ' . $d;
$note = htmlentities(trim($order->billing['firstname'] . ' ' . $order->billing['lastname'] . ' ' . $p . ' ' . STORE_NAME));
I had done this for the Stripe module and it worked great there because it basically duplicated the order information on the email that Stripe sent out to customers, which helped reassure them. The average order at my store is $3.5k, and some people are apprehensive about making such big purchases on the internet.
I recently switched from Stripe to Square, and that is the reason for the module change. I will go read up how long the note field can be and modify the code to fit.
Edit: So I reverted the payment module files back to the 1.0-beta (which is the version I'm using) and I still have the OAuthApi.php line 134 error.
Re: Square Payment Module for Zen Cart [Support Thread]
I did receive an email from the Square Developer Team about new API updates and deprications yesterday, so I am pretty sure it is something to do with their API changes. I can forward it to you if you like, just send me a private message.
Re: Square Payment Module for Zen Cart [Support Thread]
Quote:
Originally Posted by
twitchtoo
Fjolsvith
If the fileset is the newest from the Zen Plugins, you may need to re-key your store to My Apps in Square.
I did that and had two successful orders at the end of February. Last night was the most recent attempt by a customer to place an order, and it failed. And then, today I had two more try to order and they complained about getting the HTTP 500 error and not getting the order placed.
I was able to use the MySql console to disable the Square module by setting the status to false. That allowed me to enable the Stripe module so those orders could be placed this evening.