* @param array $params
* (reference ) an assoc array of name/value pairs.
* @param array $duplicates
- * (reference ) store ids of duplicate contribs.
+ * (reference ) store ids of duplicate contributions.
*
* @return bool
* true if duplicate, false otherwise
}
/**
+ * Get the payment processor (array) for a recurring processor.
+ *
* @param int $id
- * @param $mode
+ * @param string $mode
+ * - Test or NULL - all other variants are ignored.
*
* @return array|null
*/
- public static function getPaymentProcessor($id, $mode) {
- //FIX ME:
+ public static function getPaymentProcessor($id, $mode = NULL) {
$sql = "
SELECT r.payment_processor_id
FROM civicrm_contribution_recur r
WHERE r.id = %1";
$params = array(1 => array($id, 'Integer'));
- $paymentProcessorID = &CRM_Core_DAO::singleValueQuery($sql,
+ $paymentProcessorID = CRM_Core_DAO::singleValueQuery($sql,
$params
);
if (!$paymentProcessorID) {
}
/**
- * Get the number of installment done/completed for each recurring contribution
+ * Get the number of installment done/completed for each recurring contribution.
*
* @param array $ids
* (reference ) an array of recurring contribution ids.
*/
/**
- * This class generates form components generic to recurring contributions
+ * This class generates form components generic to recurring contributions.
*
* It delegates the work to lower level subclasses and integrates the changes
* back in. It also uses a lot of functionality with the CRM API's, so any change
*/
public $_contactID;
+ /**
+ * Pre-processing for the form.
+ *
+ * @throws \Exception
+ */
public function preProcess() {
$this->_crid = CRM_Utils_Request::retrieve('crid', 'Integer', $this, FALSE);
if ($this->_crid) {
- $this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_crid, 'recur', 'info');
- $this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_crid, 'recur', 'obj');
+ $this->_paymentProcessor = CRM_Contribute_BAO_ContributionRecur::getPaymentProcessor($this->_crid);
+ $this->_paymentProcessorObj = $this->_paymentProcessor['object'];
$this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_crid);
}