dev/financial#148 fold call to loadObjects
authoreileen <emcnaughton@wikimedia.org>
Tue, 24 Nov 2020 01:04:34 +0000 (14:04 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 24 Nov 2020 01:04:34 +0000 (14:04 +1300)
CRM/Core/Payment/AuthorizeNetIPN.php

index 607fcc1fec21d1c43cafe3559e5a9880a43469f7..6971fffc21db091c71de43a5da4514356212b028 100644 (file)
@@ -86,7 +86,13 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN {
       $objects['contact'] = &$contact;
       $objects['contribution'] = &$contribution;
 
-      $this->loadObjects($input, $ids, $objects, TRUE, $paymentProcessorID);
+      $contribution = &$objects['contribution'];
+      $ids['paymentProcessor'] = $paymentProcessorID;
+      $contribution->loadRelatedObjects($input, $ids);
+      if (empty($contribution->_relatedObjects['paymentProcessor'])) {
+        throw new CRM_Core_Exception("Could not find payment processor for contribution record: " . $contribution->id);
+      }
+      $objects = array_merge($objects, $contribution->_relatedObjects);
 
       // check if first contribution is completed, else complete first contribution
       $first = TRUE;