$contributionParams['contribution_recur_id'] = $recurringContributionID;
}
- $contributionParams['contribution_status_id'] = ($pending && $contributionParams['total_amount'] != 0) ? 2 : 1;
+ $contributionParams['contribution_status_id'] = $pending ? 2 : 1;
if (isset($contributionParams['invoice_id'])) {
$contributionParams['id'] = CRM_Core_DAO::getFieldValue(
'CRM_Contribute_DAO_Contribution',
public function doPayment(&$params, $component = 'contribute') {
$this->_component = $component;
$statuses = CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id');
+
+ // If we have a $0 amount, skip call to processor and set payment_status to Completed.
+ // Conceivably a processor might override this - perhaps for setting up a token - but we don't
+ // have an example of that at the mome.
+ if ($params['amount'] == 0) {
+ $result['payment_status_id'] = array_search('Completed', $statuses);
+ return $result;
+ }
+
if ($this->_paymentProcessor['billing_mode'] == 4) {
$result = $this->doTransferCheckout($params, $component);
if (is_array($result) && !isset($result['payment_status_id'])) {