Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6.14, 4.7.2
-
Component/s: CiviContribute
-
Labels:
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
ran into a rather obtuse error with with paypal standard IPNs.
to set it up, create a payment processor record using paypal standard. disable it. create a new payment processor record using paypal standard and attach to a contribution page. run a payment on the page. result: the payment remains in pending status because the IPN cannot locate the payment processor.
I traced it and the issue seems to originate in CRM/Core/Payment/PayPalIPN.php, around line 324, where we have:
$paymentProcessorID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', 'PayPal_Standard', 'id', 'name' );
This pulls the first available payment processor of type PayPal Standard – even if it's not the one used by this particular contribution. A few thoughts:
- in my case, the error was triggered because that ID makes its way to CRM/Contribute/BAO/Contribution.php around line 2351 (loadRelatedObjects) where we use the ID to retrieve the paymentProcessor. that then triggers an error in BaseIPN.php because no paymentProcessor is retrieved (since it's disabled). I suspect if the first processor was enabled it would succeed – even though it would be attached to the wrong payment processor.
- it seems the primary issue is that we need to know what payment processor was used for the transaction at that point in the process. it seems we should be able to know that from the contribution ID. but I'm always a bit fuzzy as to what should be retrieved from data and what is used by the IPN POST as a check/balance against the contribution.
Attachments
Issue Links
- is supplemented by
-
CRM-18383 civicrm/payment/ipn url in wordpress does not handle & (for some processors)
- Done/Fixed
- links to