From 80bcd2553c4919c38a0c6ec6c8ca2bba5b255538 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 3 Apr 2015 16:44:59 +1300 Subject: [PATCH] CRM-16224 add getter & setter for PaymentProcessor --- CRM/Core/Payment.php | 21 +++++++++++++++++++++ CRM/Utils/Hook.php | 3 +++ 2 files changed, 24 insertions(+) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 425de72540..2b665249af 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -206,6 +206,27 @@ abstract class CRM_Core_Payment { } } + /** + * Getter for the payment processor. + * + * The payment processor array is based on the civicrm_payment_processor table entry. + * + * @return array + * Payment processor array. + */ + public function getPaymentProcessor() { + return $this->_paymentProcessor; + } + + /** + * Setter for the payment processor. + * + * @param array $processor + */ + public function setPaymentProcessor($processor) { + $this->_paymentProcessor = $processor; + } + /** * Setter for the payment form that wants to use the processor. * diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index d18bd9895e..8f7819909c 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -928,6 +928,8 @@ abstract class CRM_Utils_Hook { * function hook_civicrm_alterPaymentProcessorParams($paymentObj, * &$rawParams, &$cookedParams); * + * See discussion in CRM-16224 as to whether $paymentObj should be passed by reference. + * * @param string $paymentObj * instance of payment class of the payment processor invoked (e.g., 'CRM_Core_Payment_Dummy') * @param array &$rawParams @@ -936,6 +938,7 @@ abstract class CRM_Utils_Hook { * params after the processor code has translated them into its own key/value pairs * * @return mixed + * This return is not really intended to be used. */ public static function alterPaymentProcessorParams( $paymentObj, -- 2.25.1