X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment.php;h=e19da90c3a5e19e2617fef8ac78cf0a21befb0e5;hb=9b41cfc801c970293cf2a1a7bff0ff4390219423;hp=d5bd619d7a9563b4965fcd4d60027184cfafad2c;hpb=4e93513a0be5ccbd2f2a1b2e86b34d0231d295e5;p=civicrm-core.git diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index d5bd619d7a..e19da90c3a 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -584,20 +584,10 @@ abstract class CRM_Core_Payment { // not documented clearly above. switch ($context) { case 'contributionPageRecurringHelp': - // require exactly two parameters - if (array_keys($params) == [ - 'is_recur_installments', - 'is_email_receipt', - ]) { - $gotText = ts('Your recurring contribution will be processed automatically.'); - if ($params['is_recur_installments']) { - $gotText .= ' ' . ts('You can specify the number of installments, or you can leave the number of installments blank if you want to make an open-ended commitment. In either case, you can choose to cancel at any time.'); - } - if ($params['is_email_receipt']) { - $gotText .= ' ' . ts('You will receive an email receipt for each recurring contribution.'); - } + if ($params['is_recur_installments']) { + return ts('You can specify the number of installments, or you can leave the number of installments blank if you want to make an open-ended commitment. In either case, you can choose to cancel at any time.'); } - return $gotText; + return ''; case 'contributionPageContinueText': return ts('Click the Continue button to proceed with the payment.'); @@ -1174,7 +1164,11 @@ abstract class CRM_Core_Payment { * @throws \CRM_Core_Exception */ protected function getAmount($params = []) { - return CRM_Utils_Money::format($params['amount'], NULL, NULL, TRUE); + if (!CRM_Utils_Rule::numeric($params['amount'])) { + CRM_Core_Error::deprecatedWarning('Passing Amount value that is not numeric is deprecated please report this in gitlab'); + return filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); + } + return $params['amount']; } /** @@ -1212,7 +1206,7 @@ abstract class CRM_Core_Payment { /** * Get URL to return the browser to on success. * - * @param $qfKey + * @param string $qfKey * * @return string */