Forums / Developer / [SOLVED]execute workflow after header("Location")
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¶meters=", 'notify_url.php was propertly ended' ); $sURL=$localHost.$indexDir .$successURL.$orderID."/?result=success¶meters="; header("Location: $sURL"); } else { $logger->writeTimedString($localHost.$indexDir .$errorURL."/?result=error¶meters=", 'error' ); $eURL=$localHost.$indexDir .$errorURL."/?result=error¶meters="; 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.
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!
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