Remove last reference to Payment->_processorName in core & remove from processors
[civicrm-core.git] / CRM / Core / Payment / Realex.php
index c757923468daca684c2fe0e7dab62e2158b36548..fad410d3be5ee9a487860fd7064019d2104d45e9 100644 (file)
@@ -42,7 +42,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
 
   protected $_mode = NULL;
 
-  protected $_params = array();
+  protected $_params = [];
 
   /**
    * We only need one instance of this object. So we use the singleton
@@ -65,7 +65,6 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
   public function __construct($mode, &$paymentProcessor) {
     $this->_mode = $mode;
     $this->_paymentProcessor = $paymentProcessor;
-    $this->_processorName = ts('Realex');
 
     $this->_setParam('merchant_ref', $paymentProcessor['user_name']);
     $this->_setParam('secret', $paymentProcessor['password']);
@@ -147,7 +146,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
       return self::error(9002, ts('Could not initiate connection to payment gateway'));
     }
 
-    curl_setopt($submit, CURLOPT_HTTPHEADER, array('SOAPAction: ""'));
+    curl_setopt($submit, CURLOPT_HTTPHEADER, ['SOAPAction: ""']);
     curl_setopt($submit, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($submit, CURLOPT_TIMEOUT, 60);
     curl_setopt($submit, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL'));
@@ -204,12 +203,12 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
 
     // FIXME: We are using the trxn_result_code column to store all these extra details since there
     // seems to be nowhere else to put them. This is THE WRONG THING TO DO!
-    $extras = array(
+    $extras = [
       'authcode' => $response['AUTHCODE'],
       'batch_id' => $response['BATCHID'],
       'message' => $response['MESSAGE'],
       'trxn_result_code' => $response['RESULT'],
-    );
+    ];
 
     $params['trxn_id'] = $response['PASREF'];
     $params['trxn_result_code'] = serialize($extras);
@@ -230,8 +229,8 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
    *   An array of the result with following keys:
    */
   public function xml_parse_into_assoc($xml) {
-    $input = array();
-    $result = array();
+    $input = [];
+    $result = [];
 
     $result['#error'] = FALSE;
     $result['#return'] = NULL;
@@ -250,11 +249,11 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
       }
       else {
         $result['#error'] = ts('Error parsing XML result - error code = %1 at line %2 char %3',
-          array(
+          [
             1 => xml_get_error_code($xmlparser),
             2 => xml_get_current_line_number($xmlparser),
             3 => xml_get_current_column_number($xmlparser),
-          )
+          ]
         );
       }
     }
@@ -269,18 +268,18 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
    * @return array
    */
   public function _xml_parse($input, $depth = 1) {
-    $output = array();
-    $children = array();
+    $output = [];
+    $children = [];
 
     foreach ($input as $data) {
       if ($data['level'] == $depth) {
         switch ($data['type']) {
           case 'complete':
-            $output[$data['tag']] = isset($data['value']) ? $data['value'] : '';
+            $output[$data['tag']] = $data['value'] ?? '';
             break;
 
           case 'open':
-            $children = array();
+            $children = [];
             break;
 
           case 'close':
@@ -364,7 +363,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
     $this->_setParam('country', $params['country']);
     $this->_setParam('post_code', $params['postal_code']);
     $this->_setParam('order_id', $params['invoiceID']);
-    $params['issue_number'] = (isset($params['issue_number']) ? $params['issue_number'] : '');
+    $params['issue_number'] = ($params['issue_number'] ?? '');
     $this->_setParam('issue_number', $params['issue_number']);
     $this->_setParam('varref', $params['contributionType_name']);
     $comment = $params['description'] . ' (page id:' . $params['contributionPageID'] . ')';
@@ -475,7 +474,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment {
    *   the error message if any
    */
   public function checkConfig() {
-    $error = array();
+    $error = [];
     if (empty($this->_paymentProcessor['user_name'])) {
       $error[] = ts('Merchant ID is not set for this payment processor');
     }