PayPal URL problems with non default language

  • Posts: 86
  • Thank you received: 5
4 years 1 month ago #316134

-- HikaShop version -- : 4.2.3
-- Joomla version -- : 3.9.15
-- PHP version -- : 7.3
-- Browser(s) name and version -- : N/A

Hi, I am testing the PayPal plugin with Sandbox and a multilanguage site. Cancel and Return URL are left blank in the configuration to use the default values.
While everything is working when the user navigates in the default language (English), nothing is working when using the secondary language (Italian):

  • the cancel order URL goes back to a non existing link giving 404 (in particular the cancel URL is index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=8&Itemid=998 that is automatically redirected to /negozio/cassa/checkout/step-0 that is not existing
  • the return URL goes to a thank page in English and also the contained link to the order goes to a non existing page
  • no confirmation is acquired from Hika though the transaction completes successfully in PayPal
Then I investigated the problems and found a partial fix: in the PayPal plugin, in the paypal.php the return and cancel_return URL must be appended with current language. So adding "&lang=it" everything works! Is it a fix you can confirm and please add soon to be able to use Paypal in secondary language?
But the blocking problem remains for notification: also adding the lang tag to the notification URL does not solve in secondary language: while PayPal transaction completes OK and the Hika payment logging traces the response
03.01.20 11:57:45 - paypal
VERIFIED
03.01.20 11:57:45 - paypal
PayPal transaction id: 1VM977490S2299108
the order remains in "created" state and infact in the order history just one line (creation) is reported, no confirmation step.
Any clue on this?
thanks a lot

Giuse

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
4 years 1 month ago #316135

Hi,

Adding the language to the URL is not normally necessary.
So I suppose that the issue must be linked to something else you didn't mention in your message.
For example, maybe you restricted some of your menu items to some languages and if the language is not specified, then the system assumes the default language, but if you don't specify the language in the URL then Joomla refuses the access to the menu item as it uses the default language. Or something like that.
In fact, the fact that you don't get a notification of the payment for the other languages could be related to this.
For example, Joomla has a mechanism to redirect the page when the language doesn't correspond to the current menu item, and it goes to another menu item. But in that case, the POST data sent by PayPal to the server would be lost with the redirect.

What I would recommend is to configure a menu item of the type "HikaShop checkout", without any language restriction and then selected it in the "force a menu item on checkout" setting of the HikaShop configuration.
Then, you should see that it works fine in all the languages without any code change.

Please Log in or Create an account to join the conversation.

  • Posts: 86
  • Thank you received: 5
4 years 1 month ago #316143

Hi, having a multilanguage site I have two menus, one for each language, it's the Joomla way as you know.
So I have 2 menu items for the checkout page, one in English for the English menu and one for the Italian menu.
It's then not clear for me your suggestion: I should have a single checkout menu item with language = All, but... then I cannot translate it (title,metadata, etc) and it must go to another menu (not the two language specific menus) so it will not appear as an item in the menu bar...
Am I missing something? Surely with Falang it work but I think it should fully work also with native Joomla way.
Thanks a lot

Giuse

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
4 years 1 month ago #316146

Hi,

Please note that I was doing some suppositions and potential things to try, or solutions which might be viable for you without having you to research the problem.
I'm not saying that you need to do it that way and it can't work in another way.
First, I'm still not clear on how you configured everything...
To be able to provide solutions which could include code changes, I would first need to better understand the situation.
For example, could you provide screenshots of the menu item(s) settings of your checkout ? And what did you configure in the "force a menu on checkout" setting of the HikaShop configuration ?
And what is the menu item with the id 998 referenced in one of the URLs you proposed ?

Please Log in or Create an account to join the conversation.

  • Posts: 86
  • Thank you received: 5
4 years 1 month ago #316161

Ok Nicolas, here all the details. English works, Italian does not. No Falang usage.
If you need more info, I am here.
thanks

Addendum on URLs used with PayPal interaction:
>>> English
return = index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=28&Itemid=997
notify_url = index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=paypal&tmpl=component&lang=en&Itemid=997
cancel_return = index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=26&Itemid=997
... all three URLs work correctly

>>> Italian
return = index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=28&Itemid=998
... thank you page in English. Fixed adding lang tag
notify_url = index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=paypal&tmpl=component&lang=it&Itemid=998
... not acquired by HikaShop also with appending lang tag
cancel_return = index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=28&Itemid=998
... redirects to "/negozio/cassa/checkout/step-0" that does not exist and infact it returns 404. Fixed appending lang tag

Itemid= 997 and 998 are the menu item id for the checkout, the first in English (and restricted to English only), the second in Italian (and restricted to Italian only)

Attachments:
Last edit: 4 years 1 month ago by Giuse.

Please Log in or Create an account to join the conversation.

  • Posts: 86
  • Thank you received: 5
4 years 1 month ago #316196

Hi, sorry to repost but did you have time to check this?
I also tried to disable the checkout menu items in both languages, and the secondary language does not work (return URL to an english page, link to the order throws 404).
It seems as currently something has to be fixed to use multilanguage PayPal with native Joomla (without Falang).
thanks a lot
cheers

Giuse

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
4 years 1 month ago #316213

Hi,

Sorry for the delay, it took me some time to setup a test website with the languages, menu items, modules, plugins etc.
I did a similar setup and I don't have the issue here.
My website's main language is English.
I switch to French with the Joomla modules manager.
I access the French checkout menu item via a link in my French main menu module which is:
http://localhost/joomla36/index.php/fr/passage-en-caisse
Then, I go to PayPal, and the cancel_url is:
http://localhost/joomla36/index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=1&Itemid=233
And when I use it, I get redirected to the URL:
http://localhost/joomla36/index.php/fr/passage-en-caisse/checkout/step-0
And thus it displays fine.
So the question is why Joomla is not adding the language code when redirecting the non SEF URL to the SEF URL.
This redirection is done by the Joomla language filter.
I checked its code and if you have the setting "Remove URL Language Code" activated (which isn't the case by default), then maybe it won't add the language code to the URL, however, even with that setting activated on my end, it still added the code and the URL still worked.
I also saw that the plugin has a parameter that can be used to skip it when you don't want it by adding &nolangfilter=1 to the end of the URL. I tried it with:
http://localhost/joomla36/index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=1&Itemid=233&nolangfilter=1
but I still got redirected to http://localhost/joomla36/index.php/fr/passage-en-caisse/checkout/step-0
So in short, I'm not sure why it doesn't work on your end. And I did not have Falang installed. I did it only with Joomla menu items and language system.
I'm afraid it would require some debugging in the code on your website to better understand where the issue comes from.
Could you provide a backend and FTP access to your website via our contact form along with a link to this thread so that we can have a look ?
www.hikashop.com/support/contact-us.html

Please Log in or Create an account to join the conversation.

  • Posts: 86
  • Thank you received: 5
4 years 1 month ago #316216

Thanks Nicolas. From your reply, I had a guess when you said that the lang tag are added by the language filter: I am using a customized lang switcher for Seblod since I use Seblod in my site. I then changed settings of the lang switcher so that the Seblod variation is not used in the hikashop pages and now return_url works!
Still the order is not being confirmed in the secondary language, the notification URL still does not have effect.
I am sending you admin credentials to have a look.
thanks a lot

Giuse

Last edit: 4 years 1 month ago by Giuse.

Please Log in or Create an account to join the conversation.

  • Posts: 4508
  • Thank you received: 610
  • MODERATOR
4 years 1 month ago #316239

Hello,

We have recieved your access but unfortunatelly these references didn't work, see the screenshot :



Can you double checked and try again please.
Regards

Last edit: 4 years 1 month ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 86
  • Thank you received: 5
4 years 1 month ago #316284

yes, sorry, the admin account was locked, yesterday after your post I immediately unlocked it.
cheers

Giuse

Please Log in or Create an account to join the conversation.

  • Posts: 86
  • Thank you received: 5
4 years 1 month ago #316329

Hi, after long testing I found the solution for the remaining problem (the notification): I was not using the account primary email and in this case Paypal leaves on hold the transaction.
Thanks, cheers

Giuse

The following user(s) said Thank You: Mohamed Thelji

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
4 years 1 month ago #316338

Hi Giuse,

Thank you for your feedback !

Kind regards,
Mohamed.

Please Log in or Create an account to join the conversation.

Time to create page: 0.090 seconds
Powered by Kunena Forum