diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index adbf82b2ec22..216c8149e252 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -328,13 +328,11 @@ public function preProcess() { } } - if ($isMonetary && - (!$isPayLater || !empty($this->_values['payment_processor'])) - ) { - $this->_paymentProcessorIDs = explode( + if ($isMonetary) { + $this->_paymentProcessorIDs = array_filter(explode( CRM_Core_DAO::VALUE_SEPARATOR, CRM_Utils_Array::value('payment_processor', $this->_values) - ); + )); $this->assignPaymentProcessor($isPayLater); } @@ -567,20 +565,20 @@ public function assignToTemplate() { } //fix for CRM-3767 - $assignCCInfo = FALSE; + $isMonetary = FALSE; if ($this->_amount > 0.0) { - $assignCCInfo = TRUE; + $isMonetary = TRUE; } elseif (!empty($this->_params['selectMembership'])) { $memFee = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $this->_params['selectMembership'], 'minimum_fee'); if ($memFee > 0.0) { - $assignCCInfo = TRUE; + $isMonetary = TRUE; } } // The concept of contributeMode is deprecated. // The payment processor object can provide info about the fields it shows. - if ($assignCCInfo) { + if ($isMonetary) { /** @var $paymentProcessorObject \CRM_Core_Payment */ $paymentProcessorObject = $this->_paymentProcessor['object']; $paymentFields = $paymentProcessorObject->getPaymentFormFields();