From 25e0105ae291028c6045e8a0c8ff4ebb7bc2a863 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Fri, 9 Apr 2021 11:16:10 +0100 Subject: [PATCH] Use propertyBag in doPayment --- CRM/Core/Payment.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 8064029670..71f9e55516 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1343,13 +1343,14 @@ abstract class CRM_Core_Payment { * @throws \Civi\Payment\Exception\PaymentProcessorException */ public function doPayment(&$params, $component = 'contribute') { + $propertyBag = \Civi\Payment\PropertyBag::cast($params); $this->_component = $component; $statuses = CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id', 'validate'); // 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) { + // have an example of that at the moment. + if ($propertyBag->getAmount() == 0) { $result['payment_status_id'] = array_search('Completed', $statuses); return $result; } -- 2.25.1