// 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':
- 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 ts('Click the <strong>Continue</strong> button to proceed with the payment.');
case 'cancelRecurDetailText':
if ($params['mode'] === 'auto_renew') {
* @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'];
}
/**
/**
* Get URL to return the browser to on success.
*
- * @param $qfKey
+ * @param string $qfKey
*
* @return string
*/
* @param null $entity
* @param string $action
*
- * @return string
+ * @return string|null
+ * @throws \CRM_Core_Exception
*/
public function subscriptionURL($entityID = NULL, $entity = NULL, $action = 'cancel') {
// Set URL