- Posts: 7
- Thank you received: 0
Square payment plugin. does not clear cart on created.
2 years 2 months ago #362418
by paedbo13
Square payment plugin. does not clear cart on created. was created by paedbo13
-- HikaShop version -- : 5.1.0
-- Joomla version -- : 5.1.2
-- PHP version -- : 8.1.28
-- Browser(s) name and version -- : chrome
-- Error-message(debug-mod must be tuned on) -- : Cart does not clear for square payment when created
I am not sure what I am doing wrong here. I have paypal and manual payment methods which both work fine and will clear the cart on created status. I can click finish to pay for an order with paypal and then back out and the cart will be cleared. However with Square payment plugin. If i click finish and then hit back on the browser. It will show my cart still populated , I check orders in hikashop and it shows that it was created so why is the front end not clearing the cart?
-- Joomla version -- : 5.1.2
-- PHP version -- : 8.1.28
-- Browser(s) name and version -- : chrome
-- Error-message(debug-mod must be tuned on) -- : Cart does not clear for square payment when created
I am not sure what I am doing wrong here. I have paypal and manual payment methods which both work fine and will clear the cart on created status. I can click finish to pay for an order with paypal and then back out and the cart will be cleared. However with Square payment plugin. If i click finish and then hit back on the browser. It will show my cart still populated , I check orders in hikashop and it shows that it was created so why is the front end not clearing the cart?
Please Log in or Create an account to join the conversation.
2 years 2 months ago - 2 years 2 months ago #362419
by Philip
Replied by Philip on topic Square payment plugin. does not clear cart on created.
Last edit: 2 years 2 months ago by Philip.
Please Log in or Create an account to join the conversation.
2 years 2 months ago #362428
by paedbo13
Replied by paedbo13 on topic Square payment plugin. does not clear cart on created.
Hi my square settings is attached. some is cut off. at top it says published and at bottom access level is set to all. I went and set joomla to maximum error recording then tried to add to cart on front end and check out with square, purposely backing out. The cart does not empty. I am unsure where to get the log file? i went to administrator/logs and see some stuff listed under error.php. but the last entries were just
2024-07-30T22:03:07+00:00 WARNING 144.62.xxx.xxx deprecated Joomla\CMS\Application\CMSApplication::getCfg() is deprecated and will be removed in 6.0. Use Factory->getApplication()->get() instead.
2024-07-30T22:03:07+00:00 WARNING 144.62.xxx.xxx deprecated Joomla\CMS\Application\CMSApplication::getCfg() is deprecated and will be removed in 6.0. Use Factory->getApplication()->get() instead.
2024-07-30T22:03:07+00:00 WARNING 144.62.xxx.xxx deprecated Joomla\CMS\Application\CMSApplication::getCfg() is deprecated and will be removed in 6.0. Use Factory->getApplication()->get() instead.
2024-07-30T22:03:07+00:00 WARNING 144.62.xxx.xxx deprecated Joomla\CMS\Application\CMSApplication::getCfg() is deprecated and will be removed in 6.0. Use Factory->getApplication()->get() instead.
Please Log in or Create an account to join the conversation.
2 years 2 months ago #362431
by paedbo13
Replied by paedbo13 on topic Square payment plugin. does not clear cart on created.
also when i abort payment and cart is not clear i can click on finish again and it causes the system to create a new order number that also shows a status of created but i can again abort payment and go back to a populated cart.
Please Log in or Create an account to join the conversation.
2 years 2 months ago #362429
by nicolas
Replied by nicolas on topic Square payment plugin. does not clear cart on created.
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.
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.
Please Log in or Create an account to join the conversation.
2 years 2 months ago #362443
by paedbo13
Replied by paedbo13 on topic Square payment plugin. does not clear cart on created.
Hi my issue exists with clear cart on created and only for the square plugin. No return url is being used .
Please Log in or Create an account to join the conversation.
2 years 2 months ago #362452
by Tsuki Dev
Kind regards,
Mohamed Thelji.
Tsuki Dev
contact[at]tsukidev[dot]com
Replied by Tsuki Dev on topic Square payment plugin. does not clear cart on created.
Hello,
Thanks for your feedback, I'm actually looking into the issue and debugging it on my end, we can continue via email at : tsukidev.contact[at]gmail[dot]com
Thanks for your feedback, I'm actually looking into the issue and debugging it on my end, we can continue via email at : tsukidev.contact[at]gmail[dot]com
Kind regards,
Mohamed Thelji.
Tsuki Dev
contact[at]tsukidev[dot]com
Please Log in or Create an account to join the conversation.
2 years 1 month ago #362482
by paedbo13
Replied by paedbo13 on topic Square payment plugin. does not clear cart on created.
Thanks. I've sent you an email. From paedbo13 hotmail.
Please Log in or Create an account to join the conversation.
Time to create page: 0.265 seconds