CRM-16255 pass contact_id to payment processor from backoffice participant form
authorEileen McNaughton <eileen@fuzion.co.nz>
Fri, 3 Apr 2015 03:52:45 +0000 (16:52 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Fri, 3 Apr 2015 03:52:45 +0000 (16:52 +1300)
CRM/Core/Payment/Form.php
CRM/Event/Form/Participant.php

index f8ee37e13d13dd7a7dabafec866c6ea0cd7e0065..865fa196db96a5d52ba5aa0151d639012884957d 100644 (file)
@@ -392,6 +392,7 @@ class CRM_Core_Payment_Form {
         'state_province' => "billing_state_province-$id",
         'postal_code' => "billing_postal_code-$id",
         'country' => "billing_country-$id",
+        'contactID' => 'contact_id',
       );
     }
 
index 433e762d8a9c1ff57c2f13db940d6c5666d1a33a..ab8f474cc881024b728a834faceff00fd99ac1a6 100644 (file)
@@ -1189,7 +1189,14 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       if (!empty($this->_params['send_receipt'])) {
         $paymentParams['email'] = $this->_contributorEmail;
       }
-      CRM_Core_Payment_Form::mapParams($this->_bltID, $this->_params, $paymentParams, TRUE);
+
+      // The only reason for merging in the 'contact_id' rather than ensuring it is set
+      // is that this patch is being done around the time of the stable release
+      // so more conservative approach is called for.
+      // In fact the use of $params and $this->_params & $this->_contactId vs $contactID
+      // needs rationalising.
+      $mapParams = array_merge(array('contact_id' => $contactID), $this->_params);
+      CRM_Core_Payment_Form::mapParams($this->_bltID, $mapParams, $paymentParams, TRUE);
 
       $payment = CRM_Core_Payment::singleton($this->_mode, $this->_paymentProcessor, $this);