The problem was solved by disabling the SiteGround (a web host) optimizer plug in.
Thank you so much. I just disabled SiteGround Optimizer and it started working. It solved an issue with a woocommerce paypal plug in as well.
I’m getting the opposite problem since 5 days ago. Both PayPal and Stripe payments have been working fine on my site for more than a year, and recently when customers try to check out as guests without logging in, both payment types fail.
Paypal returns “could not retrieve order” error and the Stripe in-line payment doesn’t appear. I’ve had a look through all of my plug-ins, and they were all updated before these problems seem to have occurred.