CRM-12108 fix merge of intermediary commit
authoreileen <eileen@fuzion.co.nz>
Thu, 1 Aug 2013 20:09:22 +0000 (08:09 +1200)
committereileen <eileen@fuzion.co.nz>
Thu, 1 Aug 2013 20:09:22 +0000 (08:09 +1200)
CRM/Core/Payment/BaseIPN.php

index b7eb02b09a72301a25d9e6a0a7745083105dd59b..aec81aba53fdee9cc3a5efe849ba7dd518917ce2 100644 (file)
@@ -539,9 +539,9 @@ LIMIT 1;";
     // it would be good if someone added some comments or refactored this
     if ($contribution->id) {
       $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
-      if (isset($input['prevContribution']) && !$input['prevContribution']->is_pay_later &&
-        $input['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses)) {
-        $input['payment_processor'] = $paymentProcessorId;
+      if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later &&
+-      $input['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses))) {
+       $input['payment_processor'] = $paymentProcessorId;
       }
       $input['contribution_status_id'] = array_search('Completed', $contributionStatuses);
       $input['total_amount'] = $input['amount'];