+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
*/
public $_onlinePendingContributionId = NULL;
+ /**
+ * Explicitly declare the entity api name.
+ */
+ public function getDefaultEntity() {
+ return 'Participant';
+ }
+
/**
* Set variables up before form is built.
*
$this->_action = CRM_Core_Action::COPY;
break;
}
- parent::preProcess();
+ CRM_Contact_Form_Task::preProcessCommon($this);
$this->_single = FALSE;
$this->_contactId = NULL;
$errorMsg = array();
if (!empty($values['payment_processor_id'])) {
- // make sure that credit card number and cvv are valid
- CRM_Core_Payment_Form::validateCreditCard($values, $errorMsg);
+ // make sure that payment instrument values (e.g. credit card number and cvv) are valid
+ CRM_Core_Payment_Form::validatePaymentInstrument($values['payment_processor_id'], $values, $errorMsg, $self);
}
if (!empty($values['record_contribution'])) {
unset($params['amount']);
}
$params['register_date'] = CRM_Utils_Date::processDate($params['register_date'], $params['register_date_time']);
- $params['receive_date'] = CRM_Utils_Date::processDate(CRM_Utils_Array::value('receive_date', $params));
+ $params['receive_date'] = CRM_Utils_Date::processDate(CRM_Utils_Array::value('receive_date', $params), CRM_Utils_Array::value('receive_date_time', $params));
$params['contact_id'] = $this->_contactId;
// overwrite actual payment amount if entered
$customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEvent, $customFields);
$customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEventType, $customFields);
$params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
- $customFields,
$this->_id,
'Participant'
);
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);
// CRM-15622: fix for incorrect contribution.fee_amount
$paymentParams['fee_amount'] = NULL;
- $result = $payment->doDirectPayment($paymentParams);
+ $result = $payment->doPayment($paymentParams);
if (is_a($result, 'CRM_Core_Error')) {
CRM_Core_Error::displaySessionError($result);
= CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'financial_type_id');
$this->_params['mode'] = $this->_mode;
- //add contribution reocord
+ //add contribution record
$contributions[] = $contribution = CRM_Event_Form_Registration_Confirm::processContribution($this, $this->_params, $result, $contactID, FALSE);
// add participant record
//add custom data for participant
CRM_Core_BAO_CustomValueTable::postProcess($this->_params,
- CRM_Core_DAO::$_nullArray,
'civicrm_participant',
$participants[0]->id,
'Participant'