From 673997939c030bbce3413311a66c41b02f56ed76 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 10 Nov 2014 17:15:14 +1300 Subject: [PATCH] CRM-15555 fix for credit card showing on paylater --- CRM/Contribute/Form/Contribution/Main.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index f4eb1f70c3..000f3f905c 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -394,7 +394,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } // Build payment processor form - if (($this->_paymentProcessorID || $this->_isBillingAddressRequiredForPayLater) && empty($_GET['onbehalf'])) { + if (empty($_GET['onbehalf'])) { CRM_Core_Payment_ProcessorForm::buildQuickForm($this); // Return if we are in an ajax callback if ($this->_snippet) { @@ -420,6 +420,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu ); $this->addRule("email-{$this->_bltID}", ts('Email is not valid.'), 'email'); $pps = array(); + //@todo - this should be replaced by a check as to whether billing fields are set $onlinePaymentProcessorEnabled = FALSE; if (!empty($this->_paymentProcessors)) { foreach ($this->_paymentProcessors as $key => $name) { @@ -1400,7 +1401,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if ($form->_paymentProcessors) { // Fetch type during ajax request if (isset($_GET['type']) && $form->_snippet) { - $form->_paymentProcessorID = $_GET['type']; + $form->_paymentProcessorID = CRM_Utils_Request::retrieve('type', 'Integer', CRM_Core_DAO::$_nullObject, FALSE, 0); } // Remember type during form post elseif (!empty($form->_submitValues)) { @@ -1422,6 +1423,9 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if ($form->_paymentProcessorID) { CRM_Core_Payment_ProcessorForm::preProcess($form); } + else { + $form->_paymentProcessor = array(); + } //get payPal express id and make it available to template foreach ($form->_paymentProcessors as $ppId => $values) { -- 2.25.1