Answers.Body: <p>Alright, now that I've solved the problem, let me reiterate over the issues, and how they were solved.</p>
  
  <h1>Problem 1: Wordpress Dev Site Test Contributions Marked Pending</h1>
  
  <p>Test contributions were being marked as <code>Pending (Incomplete Transaction)</code>. As was identified via logs, and confirmed by looking at the IPN history for the sandbox, the notification URL was referencing the Wordpress backend.</p>
  
  <p>As a result, I needed to figure out how to change this. As the <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/payment-processors/paypal-standard/#configure-paypal-to-talk-to-civicrm" rel="nofollow noreferrer">docs</a> state:</p>
  
  <blockquote>
    <p>Enter your CiviCRM site home page (e.g. <a href="http://www.example.com" rel="nofollow noreferrer">http://www.example.com</a>) as the Notification URL. This is a placeholder. CiviContribute will pass the exact IPN 'listener' URL to PayPal automatically during each transaction.</p>
  </blockquote>
  
  <h2>Solution</h2>
  
  <p>The solution required setting the <code>$frontend</code> argument to <code>TRUE</code> for the call to <code>CRM_Utils_System::url</code> as seen in <code>CRM/Core/Payment.php</code> (<a href="https://github.com/civicrm/civicrm-core/blob/5.8/CRM/Core/Payment.php#L1143" rel="nofollow noreferrer">code reference</a>).</p>
  
  <p>So instead of</p>
  
  <pre><code>  protected function getNotifyUrl() {
      $url = CRM_Utils_System::url(
        'civicrm/payment/ipn/' . $this-&gt;_paymentProcessor['id'],
        array(),
        TRUE,
        NULL,
        FALSE
      );
      return (stristr($url, '.')) ? $url : '';
    }
  </code></pre>
  
  <p>it's now</p>
  
  <pre><code>  protected function getNotifyUrl() {
      $url = CRM_Utils_System::url(
        'civicrm/payment/ipn/' . $this-&gt;_paymentProcessor['id'],
        array(),
        TRUE,
        NULL,
        FALSE,
        TRUE  // This is the argument that needs to be added
      );
      return (stristr($url, '.')) ? $url : '';
    }
  </code></pre>
  
  <p>For those interested, here's a <a href="https://github.com/civicrm/civicrm-core/blob/5.8/CRM/Utils/System.php#L240" rel="nofollow noreferrer">link</a> to the method definition.</p>
  
  <p>Why I haven't seen this pop up elsewhere, I am not sure. It may be prudent to do a check, and if Wordpress or Joomla are being used, to set that argument.</p>
  
  <p>After making that change though, notifications started flowing.</p>
  
  <h1>Problem 2: Drupal Prod Site Test Contributions Marked Pending as Well</h1>
  
  <p>As mentioned in the initial post, test contributions also appeared to not be getting IPN notifications, where they used to previously.</p>
  
  <h2>Solution</h2>
  
  <p>This was actually fixed while I was working on the fix for the Wordpress problem.</p>
  
  <p>As it turns out, when I was initially testing with Wordpress, the relatively short order hits against the admin area by the IPN notifications caused modsec to blackball the IP that Paypal's Sandbox sends the notifications from.</p>
  
  <p>Once I removed the IP from the deny list, the notifications resumed flowing, and the test contributions resumed processing correctly.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-08T06:29:57.200Z
Answers.LastActivityDate: 2019-01-08T06:29:57.200Z
Answers.UserDisplayName: jgillmanjr
Answers.Body: <p>Based on your comment on Pradeep's answer, the issue now is the URL you're using.  You can actually submit the IPN to any WordPress page that doesn't require a login.  So assuming your front page doesn't require one, you can use:
  <code>https://[domain]?page=CiviCRM&amp;q=civicrm/payment/ipn/1</code>.  Of course, ensure that your payment processor id is <code>1</code> or change the last digit accordingly.</p>
  
  <p>Also, note that you can <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_display-ipns-history" rel="nofollow noreferrer">resend IPNs</a> for up to 30 days.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-06T21:28:44.650Z
Answers.LastActivityDate: 2019-01-06T21:28:44.650Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>Since you are using paypal standard then I believe it requires to setup IPN call back url for CiviCRM to get response from Paypal and process the contribution status. </p>
  
  <p><a href="https://docs.civicrm.org/sysadmin/en/latest/setup/payment-processors/paypal-standard/#configure-paypal-to-talk-to-civicrm" rel="nofollow noreferrer">Here</a> is the document how to configure IPN(Instant Payment Notification) at Paypal.</p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-06T04:43:10.957Z
Answers.Text: I've been focusing on addressing it from the dev side of things. Look at logs, it appears that the IPN for the test notification is getting blocked, which kind of makes sense. The notification URL that's showing in the sandbox is `https://[domain]/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fpayment%2Fipn%2F2&`
  
  So now to figure out how to resolve this
Answers.UserDisplayName: jgillmanjr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-07T00:22:59.533Z
Answers.Text: The URL you build is wrong. Your url needs admin privileges. Try using Public facing url!
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-05T20:02:31.960Z
Answers.LastActivityDate: 2019-01-05T20:02:31.960Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>While building out a transition plan from Drupal to Wordpress, after getting CiviCRM setup on Wordpress, I tried making a test contribution. However, all attempts resulted in <code>Pending (Incomplete Transaction)</code> despite showing as successful in the sandbox.</p>
  <p>As part of troubleshooting, I tried making a test contribution on the production site (which is the one currently running Drupal) since I had previously made successful test contributions. However, this too lead to the contributions being marked as <code>Pending (Incomplete Transaction)</code>.</p>
  <p>One thing to note is that &quot;Real&quot; contributions have still been coming in fine on the production site.</p>
  <p>I'm aware that there was an issue previously per <a href="https://civicrm.stackexchange.com/questions/22049/fatal-error-using-paypal-in-version-4-7-29">this</a> StackExchange post, however it appears that should have been fixed in <code>4.7.30</code>, whereas I'm running <code>5.8.2</code> (both on the production and dev sites for obvious reasons).</p>
  <p>No errors seem to be showing relating to this in any of the <code>error_log</code> files on the production or dev site.</p>
  <p>Any further troubleshooting advice would be greatly appreciated.</p>
  <h1>Additional Information</h1>
  <p>I'm using Paypal Standard.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-05T13:39:55.977Z
Comments.Text: Are you using Paypal Standard or Pro payment processor?
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-05T17:23:02.060Z
Comments.Text: I'm using Paypal Standard. Will update the post to reflect this.
Comments.UserDisplayName: jgillmanjr
Tags: <civicontribute><paypal>
Title: Test Payments showing Incomplete Transaction (CiviCRM 5.8.2)
ThreadText: # Test Payments showing Incomplete Transaction (CiviCRM 5.8.2)
  
  (Asked by: username_0 on 2019-01-05)
  
  While building out a transition plan from Drupal to Wordpress, after getting CiviCRM setup on Wordpress, I tried making a test contribution. However, all attempts resulted in `Pending (Incomplete Transaction)` despite showing as successful in the sandbox.
  
  As part of troubleshooting, I tried making a test contribution on the production site (which is the one currently running Drupal) since I had previously made successful test contributions. However, this too lead to the contributions being marked as `Pending (Incomplete Transaction)`.
  
  One thing to note is that "Real" contributions have still been coming in fine on the production site.
  
  I'm aware that there was an issue previously per [this](https://civicrm.stackexchange.com/questions/22049/fatal-error-using-paypal-in-version-4-7-29) StackExchange post, however it appears that should have been fixed in `4.7.30`, whereas I'm running `5.8.2` (both on the production and dev sites for obvious reasons).
  
  No errors seem to be showing relating to this in any of the `error_log` files on the production or dev site.
  
  Any further troubleshooting advice would be greatly appreciated.
  
  # Additional Information
  
  I'm using Paypal Standard.
  
  **Tags:** civicontribute, paypal
  
  > **Comments:**
  > **username_1**: Are you using Paypal Standard or Pro payment processor?  
  > **username_0**: I'm using Paypal Standard. Will update the post to reflect this.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2019-01-08. Score: 2 | Accepted answer
  
  Alright, now that I've solved the problem, let me reiterate over the issues, and how they were solved.
  Problem 1: Wordpress Dev Site Test Contributions Marked Pending
  Test contributions were being marked as Pending (Incomplete Transaction). As was identified via logs, and confirmed by looking at the IPN history for the sandbox, the notification URL was referencing the Wordpress backend.
  As a result, I needed to figure out how to change this. As the docs state:
  
  Enter your CiviCRM site home page (e.g. http://www.example.com) as the Notification URL. This is a placeholder. CiviContribute will pass the exact IPN 'listener' URL to PayPal automatically during each transaction.
  
  Solution
  The solution required setting the $frontend argument to TRUE for the call to CRM_Utils_System::url as seen in CRM/Core/Payment.php (code reference).
  So instead of
    protected function getNotifyUrl() {
      $url = CRM_Utils_System::url(
        'civicrm/payment/ipn/' . $this->_paymentProcessor['id'],
        array(),
        TRUE,
        NULL,
        FALSE
      );
      return (stristr($url, '.')) ? $url : '';
    }
  
  it's now
    protected function getNotifyUrl() {
      $url = CRM_Utils_System::url(
        'civicrm/payment/ipn/' . $this->_paymentProcessor['id'],
        array(),
        TRUE,
        NULL,
        FALSE,
        TRUE  // This is the argument that needs to be added
      );
      return (stristr($url, '.')) ? $url : '';
    }
  
  For those interested, here's a link to the method definition.
  Why I haven't seen this pop up elsewhere, I am not sure. It may be prudent to do a check, and if Wordpress or Joomla are being used, to set that argument.
  After making that change though, notifications started flowing.
  Problem 2: Drupal Prod Site Test Contributions Marked Pending as Well
  As mentioned in the initial post, test contributions also appeared to not be getting IPN notifications, where they used to previously.
  Solution
  This was actually fixed while I was working on the fix for the Wordpress problem.
  As it turns out, when I was initially testing with Wordpress, the relatively short order hits against the admin area by the IPN notifications caused modsec to blackball the IP that Paypal's Sandbox sends the notifications from.
  Once I removed the IP from the deny list, the notifications resumed flowing, and the test contributions resumed processing correctly.
  
  
  ---
  
  ### Answer by username_2 on 2019-01-06. Score: 2
  
  Based on your comment on Pradeep's answer, the issue now is the URL you're using. You can actually submit the IPN to any WordPress page that doesn't require a login. So assuming your front page doesn't require one, you can use:
  `https://[domain]?page=CiviCRM&q=civicrm/payment/ipn/1`. Of course, ensure that your payment processor id is `1` or change the last digit accordingly.
  
  Also, note that you can [resend IPNs](https://www.paypal.com/us/cgi-bin/webscr?cmd=_display-ipns-history) for up to 30 days.
  
  
  ---
  
  ### Answer by username_1 on 2019-01-05. Score: 1
  
  Since you are using paypal standard then I believe it requires to setup IPN call back url for CiviCRM to get response from Paypal and process the contribution status.
  
  [Here](https://docs.civicrm.org/sysadmin/en/latest/setup/payment-processors/paypal-standard/#configure-paypal-to-talk-to-civicrm) is the document how to configure IPN(Instant Payment Notification) at Paypal.
  
  HTH
  
  Pradeep
  
  > **Comments:**
  > **username_0**: I've been focusing on addressing it from the dev side of things. Look at logs, it appears that the IPN for the test notification is getting blocked, which kind of makes sense. The notification URL that's showing in the sandbox is `https://[domain]/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fpayment%2Fipn%2F2&`  So now to figure out how to resolve this  
  > **username_1**: The URL you build is wrong. Your url needs admin privileges. Try using Public facing url!  
  
  ---
  
  