CRM-15555 fix additional payment form (enotice still to fix)
authorEileen McNaughton <eileen@fuzion.co.nz>
Sat, 8 Nov 2014 08:02:22 +0000 (21:02 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Thu, 13 Nov 2014 15:04:40 +0000 (04:04 +1300)
CRM/Contribute/Form/AdditionalPayment.php
CRM/Core/Payment/Form.php

index e2e56864f2eededb3644009f931fa4753b1d5fbc..f70f9cddc007df41ed58560735dca2d8142e192c 100644 (file)
@@ -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);
index b163c3f02684e37d31f2caefcac4faefb6191c74..51fb59e933c5e075c3cb186fdb13822df3c2c2f2 100644 (file)
@@ -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