Hi,
I looked into the issue.
From what I can see, the problem is linked to two things:
- You must have entered a "return URL" in the settings of the payment method.
- HikaShop has a system where, when the user is directed to the "after_end" page (after a payment), it will clear the cart, and then, either display the default thank you page of HikaShop, or redirect the user to the "return_url" of the payment method if not empty. However, when developing the Square plugin, the developer make a mistake and used "returnurl" instead of "return_url". This led to HikaShop ignoring it and always display the default thank you page. To counter this, the developer modified the plugin so that when the return URL is provided, the plugin directly directs the user to it, instead of the "after_end" page of HikaShop. And thus, this leads to the cart not being cleared after the payment if you have the "clear cart after order is" setting set to "confirmed" in the HikaShop configuration. If you leave this setting to the default "created", which is the default, then the cart is cleared by HikaShop before the payent plugin redirects to the payment gateway, and thus it works the same if you don't go through the after_end page. I think that's why the developer of the plugin didn't see the problem you have.
So the solution will be to change the returnurl parameter of the plugin to return_url, and to keep always using the "after_end" URL in the code of the plugin.
This will require modifying the code of the payment plugin. I'll send an email to the developer of this plugin after sending this message so that he can make the necessary modifications.