Merge pull request #14181 from eileenmcnaughton/group_search
[civicrm-core.git] / CRM / Core / Payment / ProcessorForm.php
index ba07a854fc6fdc6b2f28cdbbe99ef2bcf17a0161..9b8fc660e6717447ff73fb9e2f03ccd251c9e320 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 use Civi\Payment\System;
+
 /**
  *
  * @package CRM
@@ -72,6 +73,9 @@ class CRM_Core_Payment_ProcessorForm {
 
     $form->assign('suppressSubmitButton', $form->_paymentObject->isSuppressSubmitButtons());
 
+    CRM_Financial_Form_Payment::addCreditCardJs($form->getPaymentProcessorID());
+    $form->assign('paymentProcessorID', $form->getPaymentProcessorID());
+
     $form->assign('currency', $form->getCurrency());
 
     // also set cancel subscription url
@@ -80,12 +84,12 @@ class CRM_Core_Payment_ProcessorForm {
     }
 
     if (!empty($form->_values['custom_pre_id'])) {
-      $profileAddressFields = array();
+      $profileAddressFields = [];
       $fields = CRM_Core_BAO_UFGroup::getFields($form->_values['custom_pre_id'], FALSE, CRM_Core_Action::ADD, NULL, NULL, FALSE,
         NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL);
 
       foreach ((array) $fields as $key => $value) {
-        CRM_Core_BAO_UFField::assignAddressField($key, $profileAddressFields, array('uf_group_id' => $form->_values['custom_pre_id']));
+        CRM_Core_BAO_UFField::assignAddressField($key, $profileAddressFields, ['uf_group_id' => $form->_values['custom_pre_id']]);
       }
       if (count($profileAddressFields)) {
         $form->set('profileAddressFields', $profileAddressFields);
@@ -128,7 +132,7 @@ class CRM_Core_Payment_ProcessorForm {
     ) {
 
       CRM_Core_Error::fatal(ts('This contribution page is configured to support separate contribution and membership payments. This %1 plugin does not currently support multiple simultaneous payments, or the option to "Execute real-time monetary transactions" is disabled. Please contact the site administrator and notify them of this error',
-          array(1 => $form->_paymentProcessor['payment_processor_type'])
+          [1 => $form->_paymentProcessor['payment_processor_type']]
         )
       );
     }