Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Square payments latency issue
Author « Topic »  

jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 12/09/2022 :  09:07:14  
Hi,
I'm having a problem with Square payments.
Once you enter the card number and click the pay button, the little wheel spins for about 3-4 minutes before finally landing on the confirmation page. This is obviously not customer friendly.

I checked my Square API logs and it gets a 200 response instantly, so I'm not understanding what's causing the hold up to get to the confirmation page.

Any ideas?

jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 12/09/2022 :  09:36:23  
Here is the raw server log entries for a Square transaction. You can see the 3 minute delay between the post to Square and then finally the post to thanks.php

173.89.97.102 - - [09/Dec/2022:12:07:59 -0500] "POST /vsadmin/ajaxservice.php?action=squareup HTTP/1.1" 200 61 "https://www.homesteadhardware.com/cart.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:107.0) Gecko/20100101 Firefox/107.0"
173.89.97.102 - - [09/Dec/2022:12:10:47 -0500] "POST /thanks.php HTTP/1.1" 200 19566 "https://www.homesteadhardware.com/cart.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:107.0) Gecko/20100101 Firefox/107.0"

During the 3 minute delay my whole admin section hangs up too. If I try refreshing it to view the test order my browser just spins and won't load any admin console pages until this 3 minute hang up is finally done.

Same thing is happening if I try Authorize.net SIM payments. Log entries below. The Auth.net response comes 3 minutes later
my post to Auth.net:
173.89.97.102 - - [09/Dec/2022:12:21:01 -0500] "POST /cart.php HTTP/1.1" 200 24154 "https://www.homesteadhardware.com/cart.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:107.0) Gecko/20100101 Firefox/107.0"

Auth.net response to wpconfirm.php shows up much later:
198.241.206.38 - - [09/Dec/2022:12:21:12 -0500] "POST /vsadmin/wpconfirm.php HTTP/1.1" 200 2347 "-" "-"


jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 12/09/2022 :  09:45:02  
I did a test order with Paypal and there was no delay with them.

dbdave
ECT Moderator

USA
10385 Posts

Posted - 12/09/2022 :  12:30:39  
Hi, the authorize.net seems like only 11 seconds, which does seem like a while...

quote:
173.89.97.102 - - [09/Dec/2022:12:21:01 -0500] "POST /cart.php HTTP/1.1" 200 24154 "https://www.homesteadhardware.com/cart.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:107.0) Gecko/20100101 Firefox/107.0"

Auth.net response to wpconfirm.php shows up much later:
198.241.206.38 - - [09/Dec/2022:12:21:12 -0500] "POST /vsadmin/wpconfirm.php HTTP/1.1" 200 2347 "-" "-"


But for the square, what version of the shopping cart are you on?
You'll see this version number in your admin.

Thanks,
David

jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 12/09/2022 :  12:45:10  
I just updated to 7.4.11

In regard to that Auth.net log entry, that particular test was only 11 seconds, but normally they take 2-3 minutes. And it always ends up just landing on a blank page. It never gets to the final order confirmation page and just stops on a blank white page, and the url in the browser remains as the authorize.net payment page url.

dbdave
ECT Moderator

USA
10385 Posts

Posted - 12/09/2022 :  15:07:07  
Hi, 7.4.11 should be good for square, but check your square account too and if you've been with them for a while you might be on an older version of their API and you can change that in your square account, so be sure you are on their latest version too.
It may not hurt to re-apply the update as well to be sure you have a good set of files.

Thanks,
David

jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 12/12/2022 :  07:47:34  
I am using the latest Square API.

I'm completely stumped and so far my host can't seem to figure anything out.

Vince
Administrator

42692 Posts

Posted - 12/14/2022 :  03:07:45  
Hi jghomestead
Sorry about the late reply but it is a tricky one this issue and I've been thinking about ways to tackle it. It really does sound like there is something on the server (a firewall for instance) that is delaying the response from the payment processor. Maybe if I can set up a test to show if this is the case would be the way to go. So could you send me the site FTP login details to my email at vince AT ecommercetemplates DOT com and I'll see what I can set up.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 01/16/2023 :  11:19:16  
Turns out my host needed to whitelist a bunch of IP addresses on the firewall for Auth.net.... which is weird because while trying to troubleshoot this I had turned off the firewall, or so I thought I did.

jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 02/05/2023 :  22:37:49  
Hi Vince,
This problem has returned. It's very strange.

Can I still send you my info to try to test this?

Vince
Administrator

42692 Posts

Posted - 02/06/2023 :  08:00:19  
Hi there
Sorry to hear that the problem is back and sure, please do send the details.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 02/06/2023 :  09:30:26  
Vince,
Also to note, I've since migrated to another host. So I am on host #2 in my quest to resolve this. This newest host seems more on the ball and responsive so far.

Below is a response they gave me, but I'm not sure what it means when they ask if I need to update a URL with the curl function call?

===== Configuration After PHP-FPM Changes =====

Domains using each version of PHP:
---
1 ea-php74
===
Domains using PHP-FPM: 1
Domains using open_basedir: 1
===
Current PHP handler configuration:
---
DEFAULT PHP: ea-php74
ea-php72 SAPI: cgi
ea-php73 SAPI: cgi
ea-php74 SAPI: cgi
ea-php80 SAPI: cgi
ea-php81 SAPI: cgi
ea-php82 SAPI: cgi
===
Current Apache Configuration:
---
mpm_event_module (shared)
http2_module (shared)
====


I enabled the PHP-FPM slow log while recreating the issue and the /home/j*****e/public_html/vsadmin/ajaxservice.php file is being logged to the slow log while recreating the slow cart issue.
====
[root@server logs]# tail -f slow.log

[06-Feb-2023 10:23:06] [pool homesteadhardware_com] pid 116191
script_filename = /home/j*****e/public_html/vsadmin/ajaxservice.php
[0x00007fe8c6a147c0] curl_exec() /home/j****e/public_html/vsadmin/inc/incfunctions.php:873
[0x00007fe8c6a14610] callcurlfunction() /home/j*****e/public_html/vsadmin/ajaxservice.php:490
====


Line 490 of /home/j*****e/public_html/vsadmin/ajaxservice.php specifically is calling a "callcurlfunction()" function on https://connect.squareup and you can see that code here https://paste.privatesystems.net/pastes/b1fdd7534d5a7c481b6b84008c5fcb1a


And connect.squareup does not resolve. Are you needing to update the URL you are connecting to with curl?
====
[~]$ dig connect.squareup +short
[~]$
====

Edited by - jghomestead on 02/06/2023 09:42:30

jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 02/06/2023 :  10:11:24  
The problem is PHPMailer !!

I changed the payment processor to 'Email' method..... it spun for 3-4 minutes before landing on the confirmation page.

Then I went into my settings and changed the SMTP service to the mail() function. I ran a test order and it landed on the confirmation page instantly!

So now I have to figure out why PHPMailer is not working. I use Google Workspace email.

Vince
Administrator

42692 Posts

Posted - 02/07/2023 :  01:38:49  
Well done for finding that, and maybe if you contacted Google to see if there is an SMTP server that is a bit more responsive? (These will be the settings you have in the ECT Admin -> Main Settings page for email.)

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

jghomestead
Starting Member

USA
12 Posts

Pre-sales questions only
(More Details...)

Posted - 02/07/2023 :  08:03:17  
The issue was fixed by having my host add my cPanel username to the server firewall's list of authorized SMTP users.
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000