[SOLVED]execute workflow after header("Location")

Author Message

Andreas Adelsberger

Monday 26 February 2007 10:08:56 am

hi there, I wrote an extension for the payment service firstgate. i will publish it to the contributsions if it works perfectly.

It works as long as I don't start any workflow after checkout because the firstgate server expects something like www.myserver.com/index.php/?result=success. in my script it says

$checker->approvePayment();
.
.
.

if($result)
{
	$logger->writeTimedString($localHost.$indexDir .$successURL.$orderID."/?result=success&parameters=", 'notify_url.php was propertly ended' );
	$sURL=$localHost.$indexDir .$successURL.$orderID."/?result=success&parameters=";
	header("Location: $sURL");
}
else {
	$logger->writeTimedString($localHost.$indexDir .$errorURL."/?result=error&parameters=", 'error' );
	$eURL=$localHost.$indexDir .$errorURL."/?result=error&parameters=";
	header("Location: $eURL");
}


if i have any workflow after checkout, the header() commands don' t get executed! any ideas?

thanx.

---------------------------------------
Styleflasher New Media OG
Websites. Games/Multimedia.

Andreas Adelsberger

Wednesday 28 February 2007 7:18:47 am

the solution is to use

    $http =& eZHTTPTool::instance();
$http->redirect($myUrl);
.
-
.
.
//more code that gets executed
 

the code after the $http->redirect() gets executed and the redirect also works...and my workflows after the redirect also work.

when I have time i will publish the firstgate/clickandbuy extension to the community contributions.

thanx guys....ez rocks!

---------------------------------------
Styleflasher New Media OG
Websites. Games/Multimedia.

H-Works Agency

Monday 12 November 2007 5:58:17 am

Hello,

Do you have published this clickandbuy extension ?

This would be very interesting for me.

Thanx in advance. Martin

EZP is Great

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.