Skip to main content

Payment gateway Redirect

More
13 years 9 months ago #83716 by krisnasim
Hi.

Recently I'm trying to develop a custom payment plugin for HikaShop

I run into some walls about payment gateway redirect. I have been able to successfully redirect from checkout page into a dummy page.

The question is, how do I redirect from the dummy page, back to the confirmation order page in joomla! ?

Where do I have to put the code into? (Considering there are a few functions available for the payment API in the developer docs)

Thanks :D

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

More
13 years 9 months ago #83723 by krisnasim
Replied by krisnasim on topic Payment gateway Redirect
okay I 've tried to put it on the onAfterOrderConfirm, just like the docs developer suggest.
But, if I redirect the page first, when it came back, the page still have the product on the cart.
The order is created, but the cart isn't cleared. I use site.com/index.php?ctrl=checkout&task=after_end for the return link

Did I do something wrong here?

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

More
13 years 9 months ago - 13 years 9 months ago #83863 by Mohamed Thelji
Hi,

For your return URL, my advice would be to do it like this :
Code:
global $Itemid; $url_itemid=''; if(!empty($Itemid)){ $url_itemid='&Itemid='.$Itemid; } $return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id.$url_itemid;

Hope this will help you.
Last edit: 13 years 9 months ago by Mohamed Thelji.

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

More
13 years 9 months ago #84231 by krisnasim
Replied by krisnasim on topic Payment gateway Redirect
to send the return url variable, is it possible to use jrequest inside the afterorderconfirm method?

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

More
13 years 9 months ago #84322 by krisnasim
Replied by krisnasim on topic Payment gateway Redirect
ok, I ran into wall again this time

here is what I'm trying to do
Code:
function onAfterOrderConfirm(&$order,&$methods,$method_id){ global $Itemid; $url_itemid=''; if(!empty($Itemid)){ $url_itemid='&Itemid='.$Itemid; } $return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id.$url_itemid; $ccek = 'alert(\'$return_url\')'; $docs =& JFactory::getDocument(); $docs->addScriptDeclaration( $ccek ); $link = 'http://localhost/drivetest/PAYMENT/dum.php'; $app = JFactory::getApplication(); $app->redirect($link);

I want to alert the link before redirect to another page, but it never show an alert box before redirect
Do I miss something here?

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

More
13 years 9 months ago #84582 by Eliot
Replied by Eliot on topic Payment gateway Redirect
Hi there,

If you wanna see your link before being redirected you can just do something like that:
Code:
echo $return_url; exit;
If nothing shows up maybe you are executing this code at the wrong moment.
Look at the other trigger for more possibilities ;)
The following user(s) said Thank You: krisnasim

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

More
13 years 9 months ago #84651 by krisnasim
Replied by krisnasim on topic Payment gateway Redirect
awesome! it work like a miracle
thanks a bunch :laugh:

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

Time to create page: 0.237 seconds
Powered by Kunena Forum