From 43e5f0f62d03d30d5b9d54ff2c87f1f7e507a3cf Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 7 Jan 2015 16:42:01 +1300 Subject: [PATCH] add code comments --- CRM/Core/Payment.php | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index ee9e77810a..179a93ed74 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -53,6 +53,7 @@ abstract class CRM_Core_Payment { * credit card * direct debit * or both + * @todo create option group - nb omnipay uses a 3rd type - transparent redirect cc * */ const @@ -68,21 +69,7 @@ abstract class CRM_Core_Payment { RECURRING_PAYMENT_START = 'START', RECURRING_PAYMENT_END = 'END'; - /** - * We only need one instance of this object. So we use the singleton - * pattern and cache the instance in this variable - * - * @var object - * @static - */ - static private $_singleton = NULL; - - protected $_paymentProcessor; - - /** - * @var CRM_Core_Form - */ - protected $_paymentForm = NULL; + protected $_paymentProcessor; /** * Singleton function used to manage this object @@ -118,7 +105,7 @@ abstract class CRM_Core_Payment { /** * @param array $params - * + * @todo move to factory class \Civi\Payment\System (or similar) * @return mixed */ public static function logPaymentNotification($params) { @@ -190,7 +177,7 @@ abstract class CRM_Core_Payment { /** * Setter for the payment form that wants to use the processor - * + * @deprecated * @param CRM_Core_Form $paymentForm * */ @@ -200,7 +187,7 @@ abstract class CRM_Core_Payment { /** * Getter for payment form that is using the processor - * + * @deprecated * @return CRM_Core_Form A form object */ public function getForm() { @@ -209,7 +196,7 @@ abstract class CRM_Core_Payment { /** * Getter for accessing member vars - * + * @todo believe this is unused * @param string $name * * @return null @@ -220,7 +207,7 @@ abstract class CRM_Core_Payment { /** * Get name for the payment information type - * + * @todo - use option group + name field (like Omnipay does) * @return string */ public function getPaymentTypeName() { @@ -229,7 +216,7 @@ abstract class CRM_Core_Payment { /** * Get label for the payment information type - * + * @todo - use option group + labels (like Omnipay does) * @return string */ public function getPaymentTypeLabel() { @@ -429,6 +416,7 @@ abstract class CRM_Core_Payment { * * @param $component * + * @return array $params (modified) * @throws CRM_Core_Exception */ public function doPayment(&$params, $component) { @@ -454,7 +442,7 @@ abstract class CRM_Core_Payment { /** * @param $paymentProcessor - * + * @todo move to paypal class or remover * @return bool */ public static function paypalRedirect(&$paymentProcessor) { @@ -474,6 +462,7 @@ abstract class CRM_Core_Payment { } /** + * @todo move to0 \Civi\Payment\System factory method * Page callback for civicrm/payment/ipn */ public static function handleIPN() { @@ -492,6 +481,7 @@ abstract class CRM_Core_Payment { * Note that processor_id is more reliable as one site may have more than one instance of a * processor & ideally the processor will be validating the results * Load requested payment processor and call that processor's handle<$method> method + * @todo move to0 \Civi\Payment\System factory method * * @param $method * @param array $params -- 2.25.1