INFRA-132 - Docblock formatting fixes
[civicrm-core.git] / CRM / Core / Payment / IATS.php
index ebc8f48aaebe4fc639019c7d5a34fb067a183b07..b646542e07cbbcbce5fac5f033f0c190ad98867d 100644 (file)
@@ -51,13 +51,14 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
   /**
    * Constructor
    *
-   * @param string $mode the mode of operation: live or test
+   * @param string $mode
+   *   The mode of operation: live or test.
    *
    * @param $paymentProcessor
    *
    * @return \CRM_Core_Payment_IATS
    */
-  function __construct($mode, &$paymentProcessor) {
+  public function __construct($mode, &$paymentProcessor) {
     $this->_paymentProcessor = $paymentProcessor;
     $this->_processorName = ts('IATS');
 
@@ -74,30 +75,18 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
     }
   }
 
-  /**
-   * @param string $mode
-   * @param array $paymentProcessor
-   *
-   * @return mixed
-   */
-  static function &singleton($mode, &$paymentProcessor) {
-    $processorName = $paymentProcessor['name'];
-    if (self::$_singleton[$processorName] === NULL) {
-      self::$_singleton[$processorName] = new CRM_Core_Payment_IATS($mode, $paymentProcessor);
-    }
-    return self::$_singleton[$processorName];
-  }
-
   /**
    * This function collects all the information from a web/api form and invokes
    * the relevant payment processor specific functions to perform the transaction
    *
-   * @param  array $params assoc array of input parameters for this transaction
+   * @param array $params
+   *   Assoc array of input parameters for this transaction.
    *
-   * @return array the result in an nice formatted array (or an error object)
+   * @return array
+   *   the result in an nice formatted array (or an error object)
    * @abstract
    */
-  function doDirectPayment(&$params) {
+  public function doDirectPayment(&$params) {
     // $result = '';
     //       foreach($params as $key => $value) {
     //         $result .= "<strong>$key</strong>: $value<br />";
@@ -117,11 +106,11 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
     // beginning of modified sample code from IATS php api include IATS supplied api library
 
     if ($isRecur) {
-      include_once ('Services/IATS/iats_reoccur.php');
+      include_once 'Services/IATS/iats_reoccur.php';
       $iatslink1 = new iatslinkReoccur;
     }
     else {
-      include_once ('Services/IATS/iatslink.php');
+      include_once 'Services/IATS/iatslink.php';
       $iatslink1 = new iatslink;
     }
 
@@ -200,7 +189,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
         case 'week':
           $scheduleType = 'WEEKLY';
           $scheduleDate = $date['wday'] + 1;
-          $endTime      = $startTime + ($paymentsRecur * 7 * 24 * 60 * 60);
+          $endTime = $startTime + ($paymentsRecur * 7 * 24 * 60 * 60);
           break;
 
         case 'month':
@@ -238,9 +227,9 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
       // this just means we got some kind of answer, not necessarily approved
       $result = $iatslink1->getAuthorizationResult();
       //return self::error($result);
-      $result      = explode(':', $result, 2);
+      $result = explode(':', $result, 2);
       $trxn_result = trim($result[0]);
-      $trxn_id     = trim($result[1]);
+      $trxn_id = trim($result[1]);
       if ($trxn_result == 'OK') {
         $params['trxn_id'] = $trxn_id . ':' . time();
         $params['gross_amount'] = $amount;
@@ -266,7 +255,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
    *
    * @return object
    */
-  function &error($error = NULL) {
+  public function &error($error = NULL) {
     $e = CRM_Core_Error::singleton();
     if (is_object($error)) {
       $e->push($error->getResponseCode(),
@@ -297,7 +286,7 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
    *
    * @return string
    */
-  function errorString($error_id) {
+  public function errorString($error_id) {
     $errors = array(
       1 => 'Agent Code has not been set up on the authorization system.',
       2 => 'Unable to process transaction. Verify and re-enter credit card information.',
@@ -336,10 +325,10 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
    *
    * @internal param string $mode the mode we are operating in (live or test)
    *
-   * @return string the error message if any
-   * @public
+   * @return string
+   *   the error message if any
    */
-  function checkConfig() {
+  public function checkConfig() {
     $error = array();
 
     if (empty($this->_paymentProcessor['signature'])) {
@@ -358,4 +347,3 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
     }
   }
 }
-