[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.

eZ debug

Timing: Jan 18 2025 22:39:50
Script start
Timing: Jan 18 2025 22:39:50
Module start 'layout'
Timing: Jan 18 2025 22:39:50
Module start 'content'
Timing: Jan 18 2025 22:39:50
Module end 'content'
Timing: Jan 18 2025 22:39:50
Script end

Main resources:

Total runtime0.9400 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.0469152.6406
Module start 'layout' 0.00690.0037 740.687539.4766
Module start 'content' 0.01050.9280 780.1641541.3906
Module end 'content' 0.93850.0015 1,321.554712.1250
Script end 0.9400  1,333.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3710160.0002
Check MTime0.00140.1469160.0001
Mysql Total
Database connection0.00110.116710.0011
Mysqli_queries0.878993.4972570.0154
Looping result0.00070.0783550.0000
Template Total0.907796.620.4538
Template load0.00220.235720.0011
Template processing0.905496.320520.4527
Template load and register function0.00010.011710.0001
states
state_id_array0.00070.072110.0007
state_identifier_array0.00180.187320.0009
Override
Cache load0.00170.1797220.0001
Sytem overhead
Fetch class attribute can translate value0.00070.071720.0003
Fetch class attribute name0.00120.126750.0002
XML
Image XML parsing0.00120.125920.0006
class_abstraction
Instantiating content class attribute0.00000.004360.0000
General
dbfile0.00100.1090230.0000
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs