X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment.php;h=288359d4e5e5e710820932c2c676b8bbe3eae040;hb=57bab6b5fb5bdc40ef82371c8f0b29cf9237c619;hp=b1df8ec53a13cdb6aa7b42d91d8eac61b4b3ed00;hpb=35844d63c0fcb972769c4431b8524ada76ad8dcf;p=civicrm-core.git diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index b1df8ec53a..288359d4e5 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -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']); } /** @@ -551,6 +551,9 @@ abstract class CRM_Core_Payment { * Only explicitly supported contexts are handled without error. * Currently supported: * - contributionPageRecurringHelp (params: is_recur_installments, is_email_receipt) + * - contributionPageContinueText (params: amount, is_payment_to_existing) + * - cancelRecurDetailText (params: mode, amount, currency, frequency_interval, frequency_unit, installments, {membershipType|only if mode=auto_renew}) + * - cancelRecurNotSupportedText * * @param array $params * Parameters for the field, context specific. @@ -590,11 +593,44 @@ abstract class CRM_Core_Payment { } return ts('To complete your contribution, click the Continue button below.'); + case 'cancelRecurDetailText': + if ($params['mode'] === 'auto_renew') { + return ts('Click the button below if you want to cancel the auto-renewal option for your %1 membership. This will not cancel your membership. However you will need to arrange payment for renewal when your membership expires.', + [1 => $params['membershipType']] + ); + } + else { + $text = ts('Recurring Contribution Details: %1 every %2 %3', [ + 1 => CRM_Utils_Money::format($params['amount'], $params['currency']), + 2 => $params['frequency_interval'], + 3 => $params['frequency_unit'], + ]); + if (!empty($params['installments'])) { + $text .= ' ' . ts('for %1 installments', [1 => $params['installments']]) . '.'; + } + $text = "{$text}