ezRedirectGateway POST data issue

Author Message

Tomislav Buljević

Monday 20 June 2011 12:57:11 am

Hello,

I'm trying to make a redirection of POST data to another site and then to redirect to the next page. So far, I've been experimenting with the cURL functions of PHP, with no luck. What I'm trying to do here is:

Take POSTed data from the Gateway => success,

Send POSTed data to another site => success,

Redirect to the site with the POSTed data => unsuccessful.

I get a kernel(20) error on my site because it tries to redirect me to /1, and not to my appointed site.

The code so far (in the eZRedirectGateway function createRedirectionUrl) is:

$ch = curl_init($server);
      curl_setopt( $ch, CURLOPT_POST, true );
      curl_setopt( $ch, CURLOPT_POSTFIELDS, $post );
      curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
      curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)" );
      curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
      $response=curl_exec($pg);
      curl_close($pg);
return $response; 

Any suggestions?

PS. I also tried to modify the header of the cURL, but to no avail.

PPS. And no, I can't use GET, the site of the payment only accepts POSTed data.

Martin Weber

Friday 24 June 2011 8:54:46 am

Just make the curl request to post your data to the external site.

After this you can make a header redirect (like 'header('Location: http://xy.com');) ... Not nothing must be send to output before you make the header redirect.

I hope i understood your problem. Otherwise explain again.

Regards,
Martin

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 02:03:12
Script start
Timing: Jan 18 2025 02:03:12
Module start 'layout'
Timing: Jan 18 2025 02:03:12
Module start 'content'
Timing: Jan 18 2025 02:03:13
Module end 'content'
Timing: Jan 18 2025 02:03:13
Script end

Main resources:

Total runtime0.7748 sec
Peak memory usage4,096.0000 KB
Database Queries55

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.3359152.6250
Module start 'layout' 0.00620.0028 741.960939.4688
Module start 'content' 0.00900.7640 781.4297500.3203
Module end 'content' 0.77300.0017 1,281.75008.1563
Script end 0.7747  1,289.9063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4534160.0002
Check MTime0.00150.1873160.0001
Mysql Total
Database connection0.00080.099010.0008
Mysqli_queries0.720793.0263550.0131
Looping result0.00060.0820530.0000
Template Total0.742895.920.3714
Template load0.00240.314020.0012
Template processing0.740395.554120.3702
Template load and register function0.00020.027210.0002
states
state_id_array0.00100.126010.0010
state_identifier_array0.00220.282520.0011
Override
Cache load0.00200.2562220.0001
Sytem overhead
Fetch class attribute can translate value0.00090.114420.0004
Fetch class attribute name0.00140.185630.0005
XML
Image XML parsing0.00230.292920.0011
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00250.3209160.0002
String conversion0.00000.001040.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/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
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs