INFRA-132 - Docblock formatting fixes
[civicrm-core.git] / CRM / Core / Payment / IATS.php
index b6588811b6d7d2ef21b7bbda6a3e75cc0e17dee4..b646542e07cbbcbce5fac5f033f0c190ad98867d 100644 (file)
@@ -51,7 +51,8 @@ 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
    *
@@ -74,27 +75,15 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment {
     }
   }
 
-  /**
-   * @param string $mode
-   * @param array $paymentProcessor
-   *
-   * @return mixed
-   */
-  public 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
    */
   public function doDirectPayment(&$params) {
@@ -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;
@@ -336,7 +325,8 @@ 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
+   * @return string
+   *   the error message if any
    */
   public function checkConfig() {
     $error = array();