Payment gateway Redirect

  • Posts: 15
  • Thank you received: 1
11 years 10 months ago #83716

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.

  • Posts: 15
  • Thank you received: 1
11 years 10 months ago #83723

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.

  • Posts: 12953
  • Thank you received: 1778
11 years 10 months ago #83863

Hi,

For your return URL, my advice would be to do it like this :

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: 11 years 10 months ago by Mohamed Thelji.

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

  • Posts: 15
  • Thank you received: 1
11 years 10 months ago #84231

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.

  • Posts: 15
  • Thank you received: 1
11 years 10 months ago #84322

ok, I ran into wall again this time

here is what I'm trying to do

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.

  • Posts: 2334
  • Thank you received: 403
11 years 10 months ago #84582

Hi there,

If you wanna see your link before being redirected you can just do something like that:

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.

  • Posts: 15
  • Thank you received: 1
11 years 10 months ago #84651

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.083 seconds
Powered by Kunena Forum