From 2e75b2448d978343381e4dec38e7570149b41525 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 2 Nov 2019 17:15:01 +1300 Subject: [PATCH] Revert "Add getters & setters for contributionID on CRM_Core_Payment." This reverts commit c28ad54a7194e30033ffed1ad727586546e80db3. --- CRM/Core/Payment.php | 36 --------------------------------- CRM/Core/Payment/PayPalImpl.php | 4 ---- 2 files changed, 40 deletions(-) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index cb2e2f77cf..69b97a342f 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -149,41 +149,6 @@ abstract class CRM_Core_Payment { */ protected $backOffice = FALSE; - /** - * Contribution that is being paid. - * - * @var int - */ - protected $contributionID; - - /** - * Passed in parameters. - * - * Using individual getters & setters is preferred but these will be used if - * they are not available. - * - * @var array - */ - protected $inputParams = []; - - /** - * Get the contribution ID. - * - * We prefer the one set by the setter but traditional forms just pass in 'contributionID'. - * - * @return int - */ - public function getContributionID(): int { - return $this->contributionID ?? $this->inputParams['contributionID']; - } - - /** - * @param int $contributionID - */ - public function setContributionID(int $contributionID) { - $this->contributionID = $contributionID; - } - /** * @return bool */ @@ -1279,7 +1244,6 @@ abstract class CRM_Core_Payment { * @throws \Civi\Payment\Exception\PaymentProcessorException */ public function doPayment(&$params, $component = 'contribute') { - $this->inputParams = $params; $this->_component = $component; $statuses = CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id', 'validate'); diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 04ee47e496..b2d090a4d9 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -432,7 +432,6 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { "&m=" . "&c={$params['contactID']}" . "&r={$params['contributionRecurID']}" . - // @todo use $this->getContributionID(); "&b={$params['contributionID']}" . "&p={$params['contributionPageID']}"; @@ -570,7 +569,6 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $args['PROFILEREFERENCE'] = "" . "i=" . $params['invoiceID'] . "&m=" . $component . "&c=" . $params['contactID'] . "&r=" . $params['contributionRecurID'] . - // @todo use $this->getContributionID(); "&b=" . $params['contributionID'] . "&p=" . $params['contributionPageID']; } @@ -882,7 +880,6 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $notifyParameters = ['module' => $component]; $notifyParameterMap = [ 'contactID' => 'contactID', - // @todo use $this->getContributionID(); 'contributionID' => 'contributionID', 'eventID' => 'eventID', 'participantID' => 'participantID', @@ -906,7 +903,6 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $cancelUrlString = "$cancel=1&cancel=1&qfKey={$params['qfKey']}"; if (!empty($params['is_recur'])) { - // @todo use $this->getContributionID(); $cancelUrlString .= "&isRecur=1&recurId={$params['contributionRecurID']}&contribId={$params['contributionID']}"; } -- 2.25.1