Merge pull request #13955 from colemanw/Promise
[civicrm-core.git] / CRM / Core / Payment.php
index f21aeec500e7d852d10fb43023ad815a11089e0a..1aaa4aa5f5c379b105dacb4cb95a1319bb2ef474 100644 (file)
@@ -336,6 +336,15 @@ abstract class CRM_Core_Payment {
     return TRUE;
   }
 
+  /**
+   * Does this payment processor support refund?
+   *
+   * @return bool
+   */
+  public function supportsRefund() {
+    return FALSE;
+  }
+
   /**
    * Should the first payment date be configurable when setting up back office recurring payments.
    *
@@ -522,9 +531,23 @@ abstract class CRM_Core_Payment {
             $gotText .= ' ' . ts('You will receive an email receipt for each recurring contribution.');
           }
         }
-        break;
+        return $gotText;
+
+      case 'contributionPageContinueText':
+        if ($params['amount'] <= 0) {
+          return ts('To complete this transaction, click the <strong>Continue</strong> button below.');
+        }
+        if ($this->_paymentProcessor['billing_mode'] == 4) {
+          return ts('Click the <strong>Continue</strong> button to go to %1, where you will select your payment method and complete the contribution.', [$this->_paymentProcessor['payment_processor_type']]);
+        }
+        if ($params['is_payment_to_existing']) {
+          return ts('To complete this transaction, click the <strong>Make Payment</strong> button below.');
+        }
+        return ts('To complete your contribution, click the <strong>Continue</strong> button below.');
+
     }
-    return $gotText;
+    CRM_Core_Error::deprecatedFunctionWarning('Calls to getText must use a supported method');
+    return '';
   }
 
   /**
@@ -1244,6 +1267,17 @@ abstract class CRM_Core_Payment {
     return $result;
   }
 
+  /**
+   * Refunds payment
+   *
+   * Payment processors should set payment_status_id if it set the status to Refunded in case the transaction is successful
+   *
+   * @param array $params
+   *
+   * @throws \Civi\Payment\Exception\PaymentProcessorException
+   */
+  public function doRefund(&$params) {}
+
   /**
    * Query payment processor for details about a transaction.
    *