//what does recur 'mean here - to do with payment processor return functionality but
// what is the importance
if ($recur && !empty($this->_relatedObjects['paymentProcessor'])) {
- $paymentObject = &CRM_Core_Payment::singleton(
- $this->is_test ? 'test' : 'live',
- $this->_relatedObjects['paymentProcessor']
- );
+ $paymentObject = Civi\Payment\System::singleton()->getByProcessor($this->_relatedObjects['paymentProcessor']);
$entityID = $entity = NULL;
if (isset($ids['contribution'])) {
//fix for CRM-2062
//fix for CRM-16317
- $now = $form->_params['receive_date'] = date('YmdHis');
+ $form->_params['receive_date'] = date('YmdHis');
$form->assign('receive_date',
CRM_Utils_Date::mysqlToIso($form->_params['receive_date'])
);
// add a description field at the very beginning
$this->_params['description'] = ts('Online Contribution') . ': ' . (($this->_pcpInfo['title']) ? $this->_pcpInfo['title'] : $this->_values['title']);
- // also add accounting code
- $this->_params['accountingCode'] = CRM_Utils_Array::value('accountingCode',
- $this->_values
- );
+ $this->_params['accountingCode'] = CRM_Utils_Array::value('accountingCode', $this->_values);
// fix currency ID
$this->_params['currencyID'] = CRM_Core_Config::singleton()->defaultCurrency;
//carry payment processor id.
- if ($paymentProcessorId = CRM_Utils_Array::value('id', $this->_paymentProcessor)) {
- $this->_params['payment_processor_id'] = $paymentProcessorId;
+ if (CRM_Utils_Array::value('id', $this->_paymentProcessor)) {
+ $this->_params['payment_processor_id'] = $this->_paymentProcessor['id'];
}
if (!empty($params['image_URL'])) {
CRM_Contact_BAO_Contact::processImageParams($params);