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.