Merge pull request #17448 from mattwire/api4membershiptype
[civicrm-core.git] / CRM / Core / Payment / FirstData.php
index a123e8f85deada69bf8b6a9527da76ee049798dc..5e520cf7e452608cfbdef142c41ae7660079a544 100644 (file)
  * **************************
  */
 class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
-  # (not used, implicit in the API, might need to convert?)
+  // (not used, implicit in the API, might need to convert?)
   const CHARSET = 'UFT-8';
 
-  /**
-   * We only need one instance of this object. So we use the singleton
-   * pattern and cache the instance in this variable
-   *
-   * @var object
-   */
-  static private $_singleton = NULL;
-
   /**
    * Constructor.
    *
@@ -122,7 +114,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
     $requestFields['email'] = $params['email'];
     $requestFields['ip'] = $params['ip_address'];
     $requestFields['transactionorigin'] = "Eci";
-    #32 character string
+    // 32 character string
     $requestFields['invoice_number'] = $params['invoiceID'];
     $requestFields['ordertype'] = 'Sale';
     $requestFields['comments'] = $params['description'];
@@ -156,11 +148,11 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
    */
   public function doDirectPayment(&$params) {
     if ($params['is_recur'] == TRUE) {
-      CRM_Core_Error::fatal(ts('First Data - recurring payments not implemented'));
+      throw new CRM_Core_Exception(ts('First Data - recurring payments not implemented'));
     }
 
     if (!defined('CURLOPT_SSLCERT')) {
-      CRM_Core_Error::fatal(ts('%1 - Gateway requires curl with SSL support', [1 => $paymentProcessor]));
+      throw new CRM_Core_Exception(ts('%1 - Gateway requires curl with SSL support', [1 => $paymentProcessor]));
     }
 
     /**********************************************************
@@ -179,9 +171,9 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
      * define variables for connecting with the gateway
      **********************************************************/
 
-    # Name and location of certificate file
+    // Name and location of certificate file
     $key = $this->_paymentProcessor['password'];
-    # Your store number
+    // Your store number
     $requestFields["configfile"] = $this->_paymentProcessor['user_name'];
     $port = "1129";
     $host = $this->_paymentProcessor['url_site'] . ":" . $port . "/LSGSXML";