From 3868d6af485eca5008269ebc4158142646d5355f Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Tue, 24 Nov 2020 14:04:34 +1300 Subject: [PATCH] dev/financial#148 fold call to loadObjects --- CRM/Core/Payment/AuthorizeNetIPN.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index 607fcc1fec2..6971fffc21d 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -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; -- GitLab