6

We're on civicrm 4.7.5 on Drupal 7.

All contributions paid through the paypal standard payment processor are failing to successfully complete.

The user sees a successful transaction, but the contribution status is " Pending (Incomplete Transaction)"

There is nothing in the CiviCRM log to suggest an error. The IPN is sent to the correct URL, the status recorded in paypal is HTTP 200 OK.

But when I copy the path into a browser:

https://[ourwebsiteurlredacted.com]/sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5669&module=contribute&membershipID=9587

this prints the following message to screen:

Sorry, can not load CMS user account.

Any help debugging would be greatfully received!

  • Apologies for typo in subject line! – Robin Fenwick Apr 8 '16 at 9:16
  • You can edit the title to correct this! – William Mortada Apr 8 '16 at 10:58
  • 1
    So I can! Typo corrected. (Bug still present!) – Robin Fenwick Apr 8 '16 at 11:59
  • I applied the patch github.com/civicrm/civicrm-core/pull/8270/files this did NOT resolve the issue on our site. All civiCRM Contributions via PayPal are not being marked as Completed (continues to show Pending) even though successful IPN messages / handshake occurs. PULLING MY HAIR OUT! – user3231 May 3 '16 at 16:35
4

Issue had been filed https://issues.civicrm.org/jira/browse/CRM-18483 and this is my fix https://github.com/civicrm/civicrm-core/pull/8270/files

As earlier in case of drupal site, CRM_Utils_System::loadBootStrap() eventually calls CRM_Utils_System_Drupal::loadBootStrap() and fails at https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/Drupal.php#L545 because we are not passing any drupal userID as $uid parameter in loadBootStrap() fn and got halt at the same point. Unlike in other CMS (wordpress, joomla) the underlying bootstrap code is not too reliant on user id and didn't break.

As per my fix CRM_Utils_System::loadBootStrap($params, TRUE, FALSE) where 2nd parameter stands for $loadUser = TRUE and third $throwError = FALSE so if there is no corresponding CMS userID assigned against civiCRM contactID then it won't break rather it will return false and will complete the workflow just what happen when we call REST url https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/REST.php#L711.

The reason behind calling loadBootstrap function lies in https://issues.civicrm.org/jira/browse/CRM-18245

Can anyone please verify my patch if it works for ya!!

Thanks

2
+25

We had identical symptoms, after lots of cursing CiviCRM, finally found it was nothing to do with CiviCRM. PayPal IPN requires a valid email address. Our mailbox was full with someones vast supply of Spam. Cleared the mailbox and it worked fine. Hope this does it for you.

2

I think there is a bug here of some sort - I have reverted to an old copy of ipn.php, from 4.7.3, and payments are now completing successfully again

  • Hi Robin, please can you confirm the total filepath of the file that you replaced? I'll take a look at it. – JohnFF Apr 15 '16 at 21:24
  • I am having a problem as well with Paypal completing and it started with 4.7.4. Is there a place I can get the 4.7.3 ipn.php to test as well? Do I need to download the old version and expand to get it or is there a place online? – Hudson Essex Terraplane Club Apr 16 '16 at 2:59
  • 1
    Hi @JohnFF in Drupal it is /sites/all/modules/civicrm/extern/ipn.php Thank you :) – Robin Fenwick Apr 16 '16 at 16:21
  • 1
    @HudsonEssexTerraplaneClub I happened to have 4.7.3 as a backup copy on our server, but you can download it from sourceforge.net/projects/civicrm/files/civicrm-stable/4.7.3 – Robin Fenwick Apr 16 '16 at 16:22
  • 1
    By removing that bootstrap line, my PayPal works again. – Hudson Essex Terraplane Club Apr 16 '16 at 23:33
1

This is a really common error incidentally.

I suspect that that error you're seeing is unrelated to the PayPal issue.

  1. Check the CiviCRM Error Logs for errors that happened around the time of the last transaction.
  2. Check your htaccess logs for blocked requests from PayPal.
  3. The error being thrown is in libraries/civicrm/CRM/Utils/System/Drupal.php line 545 in function loadBootStrap. This code is messy, with a function that does many things.
  4. I would check visiting the IPN with the correct parameters in a browser and seeing if that updates the transactions as you'd expect.
  • Thanks @JohnFF - there is nothing relevant in the logs (no error fires at the time of the transaction), no blocked request in the access logs, and going to the IPN URL just generates 'Sorry, can not load CMS user account' Here are some relevant lines from access_log – Robin Fenwick Apr 8 '16 at 15:28
  • 173.0.81.1 - - [08/Apr/2016:09:48:42 +0100] "POST /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5667&module=contribute&membershipID=9587 HTTP/1.0" 200 43 173.0.81.1 - - [08/Apr/2016:09:51:28 +0100] "POST /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5669&module=contribute&membershipID=9587 HTTP/1.0" 200 43 82.153.198.74 - - [08/Apr/2016:10:03:21 +0100] "GET /sites/all/modules/civicrm/extern/ipn.php?reset=1&contactID=9994&contributionID=5669&module=contribute&membershipID=9587 HTTP/1.1" 200 43 – Robin Fenwick Apr 8 '16 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.