Merge pull request #17345 from eileenmcnaughton/ev_batch
[civicrm-core.git] / CRM / Core / Payment.php
index a83eab7b7d885ba32f833e0d0ef68b41a999ab44..288359d4e5e5e710820932c2c676b8bbe3eae040 100644 (file)
@@ -354,7 +354,7 @@ abstract class CRM_Core_Payment {
    * @return bool
    */
   protected function supportsLiveMode() {
-    return empty($this->_paymentProcessor['is_test']) ? TRUE : FALSE;
+    return empty($this->_paymentProcessor['is_test']);
   }
 
   /**
@@ -363,7 +363,7 @@ abstract class CRM_Core_Payment {
    * @return bool
    */
   protected function supportsTestMode() {
-    return empty($this->_paymentProcessor['is_test']) ? FALSE : TRUE;
+    return !empty($this->_paymentProcessor['is_test']);
   }
 
   /**
@@ -622,6 +622,15 @@ abstract class CRM_Core_Payment {
     return '';
   }
 
+  /**
+   * Get the title of the payment processor to display to the user
+   *
+   * @return string
+   */
+  public function getTitle() {
+    return $this->getPaymentProcessor()['title'] ?? $this->getPaymentProcessor()['name'];
+  }
+
   /**
    * Getter for accessing member vars.
    *
@@ -1493,7 +1502,7 @@ abstract class CRM_Core_Payment {
    */
   public static function handlePaymentMethod($method, $params = []) {
     if (!isset($params['processor_id']) && !isset($params['processor_name'])) {
-      $q = explode('/', CRM_Utils_Array::value(CRM_Core_Config::singleton()->userFrameworkURLVar, $_GET, ''));
+      $q = explode('/', CRM_Utils_System::currentPath());
       $lastParam = array_pop($q);
       if (is_numeric($lastParam)) {
         $params['processor_id'] = $_GET['processor_id'] = $lastParam;