From cc929e4d368d3eec18ae2fd32c90cd1b1eb9d353 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Fri, 9 Apr 2021 11:17:23 +0100 Subject: [PATCH] Add in default doPayment per https://lab.civicrm.org/dev/financial/-/issues/141 --- CRM/Core/Payment.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 8064029670..f1df22a94a 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1351,6 +1351,7 @@ abstract class CRM_Core_Payment { // have an example of that at the mome. if ($params['amount'] == 0) { $result['payment_status_id'] = array_search('Completed', $statuses); + $result['payment_status'] = 'Completed'; return $result; } @@ -1358,6 +1359,7 @@ abstract class CRM_Core_Payment { $result = $this->doTransferCheckout($params, $component); if (is_array($result) && !isset($result['payment_status_id'])) { $result['payment_status_id'] = array_search('Pending', $statuses); + $result['payment_status'] = 'Pending'; } } else { @@ -1366,9 +1368,11 @@ abstract class CRM_Core_Payment { if (!empty($params['is_recur'])) { // See comment block. $result['payment_status_id'] = array_search('Pending', $statuses); + $result['payment_status'] = 'Pending'; } else { $result['payment_status_id'] = array_search('Completed', $statuses); + $result['payment_status'] = 'Completed'; } } } -- 2.25.1