From 254ce39340a364b0c84aaa0a0510e30472a8ec11 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 8 Nov 2014 21:02:22 +1300 Subject: [PATCH] CRM-15555 fix additional payment form (enotice still to fix) --- CRM/Contribute/Form/AdditionalPayment.php | 17 +++-------------- CRM/Core/Payment/Form.php | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index e2e56864f2..f70f9cddc0 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -139,10 +139,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract list($this->_contributorDisplayName, $this->_contributorEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($this->_contactId); if (!$this->_refund) { - $this->assignProcessors(); - // also check for billing information - // get the billing location type - $this->assignBillingType(); + $this->assignPaymentRelatedVariables(); } $this->assign('contributionMode', $this->_mode); @@ -151,8 +148,6 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract $this->assign('paymentAmt', abs($paymentAmt)); $this->setPageTitle($this->_refund ? ts('Refund') : ts('Payment')); - - $this->_paymentProcessor = array('billing_mode' => 1); } /** @@ -256,14 +251,8 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract 'id' => $type ); - if ($type == 'CreditCard') { - $this->add('hidden', 'hidden_CreditCard', 1); - CRM_Core_Payment_Form::buildCreditCard($this, TRUE); - } - elseif ($type == 'DirectDebit') { - $this->add('hidden', 'hidden_DirectDebit', 1); - CRM_Core_Payment_Form::buildDirectDebit($this, TRUE); - } + CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE); + $qfKey = $this->controller->_key; $this->assign('qfKey', $qfKey); $this->assign('allPanes', $allPanes); diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index b163c3f026..51fb59e933 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -358,7 +358,7 @@ class CRM_Core_Payment_Form { } /** - * @param CRM_Contribute_Form_Contribution| CRM_Contribute_Form_Contribution_Main|CRM_Core_Payment_ProcessorForm $form + * @param CRM_Contribute_Form_AbstractEditPayment|CRM_Contribute_Form_Contribution_Main|CRM_Core_Payment_ProcessorForm $form * @param array $processor array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors * @param bool $isBillingDataOptional This manifests for 'NULL' (pay later) payment processor as the addition of billing fields to the form and * for payment processors that gather payment data on site as rendering the fields as not being required. (not entirely sure why but this -- 2.25.1