public $_bltID;
- public $_fields;
+ public $_fields = array();
/**
* @var array current payment processor including a copy of the object in 'object' key
*/
public $_paymentProcessor;
- public $_recurPaymentProcessors;
+
+ /**
+ * Available recurring processors.
+ *
+ * @var array
+ */
+ public $_recurPaymentProcessors = array();
/**
* Array of processor options in the format id => array($id => $label)
* @var array
*/
protected $_paymentProcessors = array();
+
+ /**
+ * Instance of the payment processor object.
+ *
+ * @var CRM_Core_Payment
+ */
+ protected $_paymentObject;
+
/**
* The id of the contribution that we are processing.
*
protected $_formType;
- /**
- * @var mystery variable screaming out for documentation
- */
- protected $_cdType;
-
/**
* Array of fields to display on billingBlock.tpl - this is not fully implemented but basically intent is the panes/fieldsets on this page should
* be all in this array in order like
*/
public $billingFieldSets = array();
+ /**
+ * Pre process function with common actions.
+ */
+ public function preProcess() {
+ $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
+ $this->assign('contactID', $this->_contactID);
+
+ $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add');
+ }
+
/**
* @param int $id
*/
}
- /**
- * Assign billing type id to bltID.
- *
- * @throws CRM_Core_Exception
- * @return void
- */
- public function assignBillingType() {
- $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
- $this->_bltID = array_search('Billing', $locationTypes);
- if (!$this->_bltID) {
- throw new CRM_Core_Exception(ts('Please set a location type of %1', array(1 => 'Billing')));
- }
- $this->set('bltID', $this->_bltID);
- $this->assign('bltID', $this->_bltID);
- }
-
/**
* Assign $this->processors, $this->recurPaymentProcessors, and related Smarty variables
*/
if (!empty($processor['description'])) {
$this->_processors[$id] .= ' : ' . ts($processor['description']);
}
+ if ($processor['is_recur']) {
+ $this->_recurPaymentProcessors[$id] = $this->_processors[$id];
+ }
}
- //get the valid recurring processors.
- $test = strtolower($this->_mode) == 'test' ? TRUE : FALSE;
- $recurring = CRM_Core_PseudoConstant::paymentProcessor(FALSE, $test, 'is_recur = 1');
- $this->_recurPaymentProcessors = array_intersect_key($this->_processors, $recurring);
}
$this->assign('recurringPaymentProcessorIds',
empty($this->_recurPaymentProcessors) ? '' : implode(',', array_keys($this->_recurPaymentProcessors))
}
/**
- * @param $submittedValues
+ * @param array $submittedValues
*
* @return mixed
*/
$this->assignBillingType();
- $this->_fields = array();
- CRM_Core_Payment_Form::setPaymentFieldsByProcessor($this, $this->_paymentProcessor);
+ CRM_Core_Payment_Form::setPaymentFieldsByProcessor($this, $this->_paymentProcessor, FALSE, TRUE);
}
}
catch (CRM_Core_Exception $e) {