From: Matthew Wire Date: Fri, 9 Apr 2021 10:16:10 +0000 (+0100) Subject: Use propertyBag in doPayment X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=25e0105ae291028c6045e8a0c8ff4ebb7bc2a863;p=civicrm-core.git Use propertyBag in doPayment --- 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; }