Answers.Body: <p>As an update to this thread, the issue was identified as a bug in the PayPal integration (<a href="https://lab.civicrm.org/dev/core/-/issues/1931" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/-/issues/1931</a>) and was resolved in an update pushed by CiviCRM Admin Utilities 0.8 released on 20 November 2020. Payments have been closing perfectly for us since applying the patch.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-14T17:00:57.973Z
Answers.LastActivityDate: 2020-12-14T17:00:57.973Z
Answers.UserDisplayName: Geof Newton
Answers.Body: <p>First check to see if they're unrecieved or received but not processed by looking for them in <code>civicrm_system_log</code>.  If they're not there, you can review web server logs.</p>
  <p>If they <em>are</em> there, you can <a href="https://civicrm.stackexchange.com/a/4510/12">replay them using the notificationlog extension</a>.  Check the <a href="https://civicrm.stackexchange.com/q/15931/12">ConfigAndLog</a> directory to see the Civi log errors when you do that - as well as review the logs for when the IPN was originally received.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-17T15:20:24.700Z
Answers.Text: They are not received according to civicrm_system_log. They also do not show up on ConfigAndLog.
  
  The web server logs do show the IPN.
Answers.UserDisplayName: raaboyl
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-17T16:10:39.373Z
Answers.Text: Do the web server logs show a 200 HTTP status? Or a different status?  Especially look out for 3xx statuses, which indicate a redirect.  [Only a 307 redirect](https://civicrm.stackexchange.com/a/4326/12) will tell PayPal to resend a POST request.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-17T19:59:53.317Z
Answers.Text: Web server logs show a 200 HTTP status for both received and unreceived IPNs. (PayPal confirms that IPN notification URLs return an HTTP response of 200 even when the message is not sent to listener expectations.)
Answers.UserDisplayName: raaboyl
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-22T17:30:13.060Z
Answers.Text: Any other ideas? It's getting to the point where I need to monitor Civi and PayPal daily and resend IPN notifications (which, again, go through correctly the second time), which really defeats the purpose of automation!
Answers.UserDisplayName: raaboyl
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-23T16:22:34.703Z
Answers.Text: Sure: You can try sending the IPNs by hand using `curl` to view the entire communication for hints.I'm not sure if you're using `mod_php` or a dedicated PHP interpreter (like `php-fpm`) but check the PHP logs for errors if the latter.  You can enable debug-level logging on Apache to store the POST requests in logs.  Either Apache isn't passing the data to PHP, and is giving the 200 on its own - not sure how that could happen intermittently tbh - or PHP is returning the 200 status, in which case the data is either going to Civi, or directed elsewhere.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-17T12:47:46.333Z
Answers.LastActivityDate: 2020-11-17T12:47:46.333Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Random completed PayPal transactions are not being updated in CiviCRM and the contribution records are incorrectly left as &quot;Pending.&quot; I have worked with PayPal to confirm that all IPN notifications are being successfully sent from their end. CiviCRM's logs do not show any errors; they simply do not show that they received any notification from PayPal.</p>
  <p>To make matters more confusing, when I resend IPN notifications through PayPal, they are then correctly received by CiviCRM the second time around and the contribution record is updated.</p>
  <p>Any ideas on how to rectify this situation? I cannot find any pattern as to which notifications go unreceived and which contributions are successfully updated. I am on WordPress 5.5.3 and CiviCRM 5.30.1.</p>
  
Tags: <contributions><paypal><ipn>
Title: PayPal IPN Notification Inconsistently Received
ThreadText: # PayPal IPN Notification Inconsistently Received
  
  (Asked by: username_0 on 2020-11-16)
  
  Random completed PayPal transactions are not being updated in CiviCRM and the contribution records are incorrectly left as "Pending." I have worked with PayPal to confirm that all IPN notifications are being successfully sent from their end. CiviCRM's logs do not show any errors; they simply do not show that they received any notification from PayPal.
  
  To make matters more confusing, when I resend IPN notifications through PayPal, they are then correctly received by CiviCRM the second time around and the contribution record is updated.
  
  Any ideas on how to rectify this situation? I cannot find any pattern as to which notifications go unreceived and which contributions are successfully updated. I am on WordPress 5.5.3 and CiviCRM 5.30.1.
  
  **Tags:** contributions, paypal, ipn
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-12-14. Score: 1 | Accepted answer
  
  As an update to this thread, the issue was identified as a bug in the PayPal integration (<https://lab.civicrm.org/dev/core/-/issues/1931>) and was resolved in an update pushed by CiviCRM Admin Utilities 0.8 released on 20 November 2020. Payments have been closing perfectly for us since applying the patch.
  
  
  ---
  
  ### Answer by username_2 on 2020-11-17. Score: 0
  
  First check to see if they're unrecieved or received but not processed by looking for them in `civicrm_system_log`. If they're not there, you can review web server logs.
  
  If they *are* there, you can [replay them using the notificationlog extension](https://civicrm.stackexchange.com/a/4510/12). Check the [ConfigAndLog](https://civicrm.stackexchange.com/q/15931/12) directory to see the Civi log errors when you do that - as well as review the logs for when the IPN was originally received.
  
  > **Comments:**
  > **username_0**: They are not received according to civicrm_system_log. They also do not show up on ConfigAndLog.  The web server logs do show the IPN.  
  > **username_2**: Do the web server logs show a 200 HTTP status? Or a different status?  Especially look out for 3xx statuses, which indicate a redirect.  [Only a 307 redirect](https://civicrm.stackexchange.com/a/4326/12) will tell PayPal to resend a POST request.  
  > **username_0**: Web server logs show a 200 HTTP status for both received and unreceived IPNs. (PayPal confirms that IPN notification URLs return an HTTP response of 200 even when the message is not sent to listener expectations.)  
  > **username_0**: Any other ideas? It's getting to the point where I need to monitor Civi and PayPal daily and resend IPN notifications (which, again, go through correctly the second time), which really defeats the purpose of automation!  
  > **username_2**: Sure: You can try sending the IPNs by hand using `curl` to view the entire communication for hints.I'm not sure if you're using `mod_php` or a dedicated PHP interpreter (like `php-fpm`) but check the PHP logs for errors if the latter.  You can enable debug-level logging on Apache to store the POST requests in logs.  Either Apache isn't passing the data to PHP, and is giving the 200 on its own - not sure how that could happen intermittently tbh - or PHP is returning the 200 status, in which case the data is either going to Civi, or directed elsewhere.  
  
  ---
  
  