Search code examples
phppaypalpaypal-ipn

Paypal IPN keep showing INVALID


I am trying IPN callback but everytime I try to validate the IPN message with paypal it says that is INVALID! I already tried a lot of methods in the internet but anyone is working, This is my code:

header('HTTP/1.1 200 OK');
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
$homepage = file_get_contents("https://ipnpb.sandbox.paypal.com/cgi-bin/webscr?{$req}");

This is working but its showing invalid. Does someone knows why this is happening?


Solution

  • Solved,
    The Paypal IPN simulator have an error, just remove the DATE field when you going to simulate and you will get VERIFIED!