From 510fa17f23a45fdb146c2f933b4eb5995bfe12c7 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 12 Nov 2015 18:39:41 -0800 Subject: [PATCH] CRM-17557 ensure /bin/bash payments are completed --- CRM/Contribute/BAO/Contribution/Utils.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 16c713a557..2f9a662d33 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -158,7 +158,7 @@ class CRM_Contribute_BAO_Contribution_Utils { $paymentParams['contributionRecurID'] = $contribution->contribution_recur_id; } - if (!empty($form->_paymentProcessor) && $form->_amount > 0.0) { + if (!empty($form->_paymentProcessor)) { try { $payment = Civi\Payment\System::singleton()->getByProcessor($form->_paymentProcessor); if ($form->_contributeMode == 'notify') { @@ -211,7 +211,16 @@ class CRM_Contribute_BAO_Contribution_Utils { $form->_values['contribution_id'] = $contribution->id; $form->_values['contribution_page_id'] = $contribution->contribution_page_id; - + if ($form->_params['amount'] == 0) { + // This is kind of a back-up for pay-later $0 transactions. + // In other flows they pick up the manual processor & get dealt with above (I + // think that might be better...). + return array( + 'payment_status_id' => 1, + 'contribution' => $contribution, + 'payment_processor_id' => 0, + ); + } CRM_Contribute_BAO_ContributionPage::sendMail($contactID, $form->_values, $contribution->is_test -- 2.25.1