paypal / ipn-code-samples

Other
562 stars 486 forks source link

How to listening IPN using PHP?? #117

Closed MESWEB closed 6 years ago

MESWEB commented 6 years ago

General information

Issue description

I'm using smple code from this repository for PHP language. I'm trying send IPN using Sandbox IPN on development PayPal website but my both servers don't receive any POST message from PayPal. What's problem?

overint commented 6 years ago

Something in between your server & PayPal is probably blocking the messages. Have you made sure all firewalls and filtering has PayPal's IP addresses excluded or are turned off?

randstraw commented 6 years ago

@MESWEB were you able to resolve?

marcelo2605 commented 6 years ago

Same problem here, with PHP 7 and WP Engine host:

if(isset( $_GET['payment'] ) && $_GET['payment'] == 'paypal'){

    $ipn = new PaypalIPN\PaypalIPN();
    $ipn->useSandbox();
    $verified = $ipn->verifyIPN();
    if ($verified) {
        error_log( 'verifed' );
    }else{
        error_log( 'not verified' );
    }
    header("HTTP/1.1 200 OK");
}
marcelo2605 commented 6 years ago

Fixed the problem removing payment_date value from IPN Sandbox, as mentioned here: #51

BigRedBot commented 6 years ago

This should be fixed with this pull request: https://github.com/paypal/ipn-code-samples/pull/119

I have tested it sandboxed and live with no issues so far.

MESWEB commented 6 years ago

Problem solved.