CRM-16224 add getter & setter for PaymentProcessor
authorEileen McNaughton <eileen@fuzion.co.nz>
Fri, 3 Apr 2015 03:44:59 +0000 (16:44 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Fri, 3 Apr 2015 03:44:59 +0000 (16:44 +1300)
CRM/Core/Payment.php
CRM/Utils/Hook.php

index 425de725409d6d2cfbc5e8efe9e109e1493b174a..2b665249af241e9c7c5d3ecfbc5b87835724720b 100644 (file)
@@ -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.
    *
index d18bd9895eac1ad980846a06fdf2221d2bc53a3a..8f7819909ce6d59039b1f4b8e68ad930bffbc1c7 100644 (file)
@@ -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,