fakhrizaki
fakhrizaki

Reputation: 153

PayPal IPN _notify-validate throws Error 302 in Sandbox

The second IPN response after sending cmd=_notify-validate to www.sandbox.paypal.com returns HTTP Error 302.

If I change the URL to www.paypal.com, it returns INVALID response. I am not sure where I am wrong.

Should I use www.paypal.com as a host to validate the IPN in sandbox? I don't think so?

I am really struggling to get this sorted. Any help please?

Upvotes: 5

Views: 5887

Answers (2)

periklis
periklis

Reputation: 10192

I had the same issue and it appears that sandbox has switched to ssl. I had to change my code from:

$fp = fsockopen ($paypalUrl, "80", $errno, $errstr, 30);

to:

$fp = fsockopen ('ssl://'.$paypalUrl, "443", $errno, $errstr, 30);

and it worked. I found this solution at http://www.jomres.net/jomres-forum/General-discussion/10590-PayPal-IPN----IP-Address-Expansion

Upvotes: 10

Robert
Robert

Reputation: 19356

That's not an HTTP error, that's the HTTP response code for accessing https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate

You should be looking at the contents of the page, not the HTTP response code.

Upvotes: 1

Related Questions