if (empty($this->_recurPaymentProcessors)) {
$buildRecurBlock = FALSE;
}
+ if ($this->_ppID) {
+ foreach ($this->_paymentProcessors as $processor) {
+ if (!empty($processor['is_recur']) && !empty($processor['object']) && $processor['object']->supports('recurContributionsForPledges')) {
+ $buildRecurBlock = TRUE;
+ break;
+ }
+ $buildRecurBlock = FALSE;
+ }
+ }
if ($buildRecurBlock) {
CRM_Contribute_Form_Contribution_Main::buildRecur($this);
$this->setDefaults(array('is_recur' => 0));
return FALSE;
}
+ /**
+ * Can recurring contributions be set against pledges.
+ *
+ * In practice all processors that use the baseIPN function to finish transactions or
+ * call the completetransaction api support this by looking up previous contributions in the
+ * series and, if there is a prior contribution against a pledge, and the pledge is not complete,
+ * adding the new payment to the pledge.
+ *
+ * However, only enabling for processors it has been tested against.
+ *
+ * @return bool
+ */
+ protected function supportsRecurContributionsForPledges() {
+ return FALSE;
+ }
+
/**
* Default payment instrument validation.
*
return TRUE;
}
+ /**
+ * Can recurring contributions be set against pledges.
+ *
+ * In practice all processors that use the baseIPN function to finish transactions or
+ * call the completetransaction api support this by looking up previous contributions in the
+ * series and, if there is a prior contribution against a pledge, and the pledge is not complete,
+ * adding the new payment to the pledge.
+ *
+ * However, only enabling for processors it has been tested against.
+ *
+ * @return bool
+ */
+ protected function supportsRecurContributionsForPledges() {
+ return TRUE;
+ }
+
/**
* Submit a payment using Advanced Integration Method.
*
return FALSE;
}
+ /**
+ * Can recurring contributions be set against pledges.
+ *
+ * In practice all processors that use the baseIPN function to finish transactions or
+ * call the completetransaction api support this by looking up previous contributions in the
+ * series and, if there is a prior contribution against a pledge, and the pledge is not complete,
+ * adding the new payment to the pledge.
+ *
+ * However, only enabling for processors it has been tested against.
+ *
+ * @return bool
+ */
+ protected function supportsRecurContributionsForPledges() {
+ return TRUE;
+ }
+
/**
* Express checkout code. Check PayPal documentation for more information
*
</td>
</tr>
- {if $buildRecurBlock && !$ppID}
+ {if $buildRecurBlock}
<tr id='recurringPaymentBlock' class='hiddenElement'>
<td></td>
<td>