Hikashop redirect to payment gateway url with a POST, but we need a GET!

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
1 year 10 months ago #342203

-- HikaShop version -- : 4.6.0
-- Joomla version -- : 3.10.6
-- PHP version -- : 7.4.3
-- Browser(s) name and version -- : Chrome 90.0.4430.212

Hello!
we created a "payment plugin" for hikashop environment. Plugin call a custom WS that return a the url for the paymente gateway.
As the example we had follow, in the "onAfterOrderConfirm" we set that url into $this->gateway_url.

Then i don't know what append, but if url point to a bank gateway that accept a POST call, everything goes well.
If the url point to a bank gateway tha only accept a GET call, then we got an http error "POST is not allowed".

How can we manage that?

The best would be to have a custom plugin parameter where to set GET or POST options as needed, but i don't know then how to say "hei hikashop! do a GET for this case" :)

Thank you very much.
Regards,

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
1 year 10 months ago #342205

Hi,

There is no such thing because it's you who control this in the plugin.
In the plugin you normally have a file finishing with "_end.php". That file contains the form which has all the hidden input fields and which is triggered to redirect to the payment gateway.
So in that file of your payment plugin, you just need to make sure that the form HTML element has a "method" attribute set to "get" if you want the form to be sent as a GET:
www.w3schools.com/tags/att_form_method.asp

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

Time to create page: 0.054 seconds
Powered by Kunena Forum