0

I write integrator to Pauy payment system. When I bay sth payu response me with status order. When I recive this I have to use

header("HTTP/1.1 200 OK");

To stop response from payu.

But I don't know How to use it inside cakephp 2.x Controller?

I try:

     $this->response->header("HTTP/1.1", "200 OK");

and

     $this->response->statusCode(200);

But it's not work.

marczak
  • 489
  • 2
  • 8
  • 17
  • This is the default response status code, so in theoryyou just have to return the response, it will be done for you. – mark Dec 25 '15 at 18:47

1 Answers1

3

What you tried should work in the Controller, namely:

$this->response->statusCode(200);

However this will still load the method's view in 2.x as per the default behaviour. If you want to stop the default behaviour and instead just return the 200 code, try this:

return $this->response;

after you've set the status code (with the line above).

jake2389
  • 1,166
  • 8
  • 22