Return pages after payment

  • Posts: 19
  • Thank you received: 0
10 years 1 month ago #175868

-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.10

Dear all,

after using payment plugin customer is redirect to payment gateway and after the process is complete customer is redirect back to the site and there is the problem with successURL (payment is successful) and failedURL (payment is canceled).

successURL - there is "/component/hikashop/checkout/after_end/order_id-28" and should be "/nakupni-kosik/task-step/step-6" in my opinion

failedURL - there is "/nakupni-kosik/step-5" and should be "/nakupni-kosik/task-step/step-5"

Plugin makers told me that this is hikashop router file issue and has nothing to do with the plugin.

Thank you for help!

Best regards,

Sorky

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 1 month ago #175895

Hi,

Mmm. I don't see what is your problem here.
The URL /nakupni-kosik/task-step/step-6 doesn't exist. So if you were to redirect to it, it just wouldn't work.

Normal payment plugins, like the one we developed have a "Return URL" parameter which is taken into account automatically and the user is redirected to that URL. So you can actually specify the URL that you want for the success URL by entering it in the "return URL" option of your payment plugin, provided that your payment plugin has that option.

The failed URL is sent to the payment gateway by the payment plugin and HikaShop has not control over it. I see that your payment plugin is using a SEF URL for the URLs they sent to the payment gateway, and yes, the router of HikaShop will convert the non-SEF URLs they provide to the SEF URLs equivalent, but that's their call to make if they want to use the SEF system or not and what URL to give to the SEF system.
In the payment plugins we develop we do not specify a SEF URL at all and just use the non-SEF URL for the redirection.

Having SEF URLs for these URLs is pointless since search engines won't see these URLs, so I don't see why you want to change them in the first place ?

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

  • Posts: 19
  • Thank you received: 0
10 years 1 month ago #176253

Hi Nicolas,

thank you for your reply, you were right, problem was at plugins site. Sorry to bother you...

Best regards,

Sorky

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

  • Posts: 51
  • Thank you received: 1
7 years 2 months ago #278436

I'm currently having a challenge with the plugin my developer made.
If the return url is specified, cart doesn't clear after payment notification is received(My developer said the reason is becaused Hika will clear the cart only if it returns to the default return url).
But if left empty, the cart is cleared.
How can he make this redirection possible so that the cart is always cleared because i don't like the default return url coz its an empty page which just displays the "Thank you *****" as a popup?

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
7 years 2 months ago #278443

Hello,

As it's not a plugin that we develop and we don't even know for which payment platform you refer (and so how works communication with payment servers ?) I can only made some guess, and point you to some ideas.

Nevertheless, one answer the cart isn't emptied from customer payment url, the proof is that lots of payment plugin existing with customizable url return like it seems you needs.
The cart is emptied by payment plugin code from payment server notifications (most often), and this process is different from url redirection after payment.

For the thank you page, you can customize via an override view, the concerned view is checkout / end.
With this you can all you need for have a better thank you page.

Hope this will help you.

Regards

Last edit: 7 years 2 months ago by Philip.

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

  • Posts: 51
  • Thank you received: 1
7 years 2 months ago #278898

The cart is emptied by payment plugin code from payment server notifications (most often), and this process is different from url redirection after payment.


The plugin he developed for me is Paystack plugin. Which code should he add to the plugin so that it empties the cart once payment notification from Paystack is received not minding the redirection url because as it is, if the browser doesn't return to the url below after successful payment on Paystack, the cart won't empty
' www.mywebsite.com/index.php?option=com_h...stack&tmpl=component '

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 2 months ago #278917

Hi,

I don't have the code of the plugin so I can't say why it doesn't work properly for your case.
However, here is what I can say:
The payment plugins are supposed to always give the HikaShop default return URL to the payment gateway. Then, if they want HikaShop to redirect somewhere else, they can have their return URL in the payment_params of their plugin named "return_url". That way, on the default return URL of HikaShop, after clearing the cart, it will take that URL in that parameter and redirect to that return URL you specify in the settings of the payment plugin.
So if your developer had followed the instructions we provide in the example payment plugin of our developer page, the situation you're describing shouldn't happen, unless you have an old version of HikaShop with a bug on the return URL of HikaShop which doesn't clear the cart properly. However, with the latest version of HikaShop, this shouldn't happen.

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

  • Posts: 51
  • Thank you received: 1
7 years 1 month ago #279368

I really don't know if you can help out by glancing through the code in your spare time. My only issue with it is Cart doesn't clear when the return url field is filled. I'd appreciate if you can help out by looking through the code.
The plugin can also be added to the list of 3rd Party developed plugin for hikashop for other users who might be interested in using Paystack.
Thanks

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 1 month ago #279396

Hi,

First, make sure that the redirect URL setting of the payment method is empty and save the settings.
Then, the issue is this line:
'redirect_url' => array('Redirect URL after payment is confirmed (can be left empty).', 'textarea'),
change it to:
'return_url' => array('Redirect URL after payment is confirmed (can be left empty).', 'textarea'),
and then, edit the payment method and enter the redirect URL you want in that field and save again the settings.
It should then work properly.

I'm sure others would be interested in using PayStack, so how about publishing the plugin online ? (on GitHub for example, like we do: github.com/HikaShop/ ). That way, others could even improve it in the future and potentially maintain it.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum