Body: <p>We have a paypal pro setup for a contribution page and the ipn response for a normal contribution looks like -</p>
  
  <blockquote>
    <p>{"transaction_subject":"","payment_date":"16:37:45 Sep 02, 2018 PDT","txn_type":"web_accept","last_name":"xxxx","receipt_id":"2600-0803-0809-7320","residence_country":"US","item_name":"Online Contribution: Personal Membership","payment_gross":"35.00","mc_currency":"USD","business":"xxx@xxx.org","payment_type":"instant","protection_eligibility":"Ineligible","verify_sign":"xxxx","payer_status":"unverified","payer_email":"xxx@xxx.com","txn_id":"7F410221CJ172415V","quantity":"1","receiver_email":"xxx@xxxx.org","first_name":"xxxx","invoice":"89272b33abe6e127f59343e2a9b44a2c","payer_id":"9X46HRFGKLWH2","receiver_id":"R6MXHRC5VK3G8","item_number":"","payment_status":"Completed","payment_fee":"1.07","mc_fee":"1.07","mc_gross":"35.00","custom":"","charset":"windows-1252","notify_version":"3.9","ipn_track_id":"xxxxx"}</p>
  </blockquote>
  
  <p><a href="https://civicrm.stackexchange.com/a/17991/245">https://civicrm.stackexchange.com/a/17991/245</a> mentions that paypal pro ipn is only handled for recurring payments and others are simply ignored. </p>
  
  <p>What seems incorrect to me is when an <code>rp_invoice_id</code>(not set for non-recurring payment) is missing in the response parameters, the payment processor is assumed to be of <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment/PayPalProIPN.php#L99" rel="nofollow noreferrer">Paypal Express type</a> and further handling is done with <code>handlePaymentExpress</code> function.</p>
  
  <p>This function <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment/PayPalProIPN.php#L567" rel="nofollow noreferrer">throws an exception</a> when a payment is not of recurring type and hence sends a <code>failed</code> delivery status to paypal.  </p>
  
  <p>On the other side, civi contribution is completed and all works fine in the backend. It is just that paypal isn't getting a positive response for the ipn URL and hence the Paypal system send us a warning email re failed IPN calls about 2x/day.</p>
  
  <p>Is this something missing in the code which incorrectly sets <code>payment express</code> for not seeing <code>rp_invoice_id</code> in the response? Should it also check for another param before deciding it as a paypal express transaction?</p>
  
  <p>Update: CiviCRM version - 5.5.</p>
  
  <p>Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-21T06:47:27.650Z
Comments.Text: What version of CiviCRM are you on? We're on 5.5 and we are getting notices from Paypal about failures.
Comments.UserDisplayName: Zachary
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-21T07:23:50.110Z
Comments.Text: Updated the question with the civi version.
Comments.UserDisplayName: jitendra - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-21T09:16:56.710Z
Comments.Text: So there have been a number of tweaks/fixes to the paypal code in core over the last few versions, resolving various issues with recurring etc.  @jitendra-fuzion it sounds like that may have allowed another bug to surface - if you can create a PR I'll happily review
Comments.UserDisplayName: Matthew Wire
Tags: <payment-processor><paypal><ipn>
Title: Paypal Pro IPN failures for non-recurring payments
ThreadText: # Paypal Pro IPN failures for non-recurring payments
  
  (Asked by: username_0 on 2018-09-21)
  
  We have a paypal pro setup for a contribution page and the ipn response for a normal contribution looks like -
  
  > {"transaction\_subject":"","payment\_date":"16:37:45 Sep 02, 2018 PDT","txn\_type":"web\_accept","last\_name":"xxxx","receipt\_id":"2600-0803-0809-7320","residence\_country":"US","item\_name":"Online Contribution: Personal Membership","payment\_gross":"35.00","mc\_currency":"USD","business":"xxx@xxx.org","payment\_type":"instant","protection\_eligibility":"Ineligible","verify\_sign":"xxxx","payer\_status":"unverified","payer\_email":"xxx@xxx.com","txn\_id":"7F410221CJ172415V","quantity":"1","receiver\_email":"xxx@xxxx.org","first\_name":"xxxx","invoice":"89272b33abe6e127f59343e2a9b44a2c","payer\_id":"9X46HRFGKLWH2","receiver\_id":"R6MXHRC5VK3G8","item\_number":"","payment\_status":"Completed","payment\_fee":"1.07","mc\_fee":"1.07","mc\_gross":"35.00","custom":"","charset":"windows-1252","notify\_version":"3.9","ipn\_track\_id":"xxxxx"}
  
  <https://civicrm.stackexchange.com/a/17991/245> mentions that paypal pro ipn is only handled for recurring payments and others are simply ignored.
  
  What seems incorrect to me is when an `rp_invoice_id`(not set for non-recurring payment) is missing in the response parameters, the payment processor is assumed to be of [Paypal Express type](https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment/PayPalProIPN.php#L99) and further handling is done with `handlePaymentExpress` function.
  
  This function [throws an exception](https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment/PayPalProIPN.php#L567) when a payment is not of recurring type and hence sends a `failed` delivery status to paypal.
  
  On the other side, civi contribution is completed and all works fine in the backend. It is just that paypal isn't getting a positive response for the ipn URL and hence the Paypal system send us a warning email re failed IPN calls about 2x/day.
  
  Is this something missing in the code which incorrectly sets `payment express` for not seeing `rp_invoice_id` in the response? Should it also check for another param before deciding it as a paypal express transaction?
  
  Update: CiviCRM version - 5.5.
  
  Thanks.
  
  **Tags:** payment-processor, paypal, ipn
  
  > **Comments:**
  > **username_1**: What version of CiviCRM are you on? We're on 5.5 and we are getting notices from Paypal about failures.  
  > **username_0**: Updated the question with the civi version.  
  > **username_2**: So there have been a number of tweaks/fixes to the paypal code in core over the last few versions, resolving various issues with recurring etc.  @username_0 it sounds like that may have allowed another bug to surface - if you can create a PR I'll happily review  
  
  ---
  
  ## 0 answers
  
  