I´m coding payment in CakePHP. I make POST request to /payments/pay/5 (method pay in PaymentsController) which make HttpSocket->post to external service and it return payment parameters. Then I make HttpSocket->post to payment gateway with given parameters which will return 302 response. I need to return this response and display it in browser. How to do it?
It returns a 302 and you need to redirect to the specified URL? Are you having problems extracting the URL from the POST return data, or redirecting to it? Showing some code might be helpful.
My mistake. I was sending POST request instead of GET request, which I should use. It caused 302. I changed it to GET and it works.