diff --git a/CRM/Core/Payment/Stripe.php b/CRM/Core/Payment/Stripe.php index 3bf7965d41e324e96027cdacd112bd6f8e9d2116..ed29c661cd791b276b1b066833bf5794bb976710 100644 --- a/CRM/Core/Payment/Stripe.php +++ b/CRM/Core/Payment/Stripe.php @@ -33,8 +33,6 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment { */ public function __construct($mode, $paymentProcessor) { $this->_paymentProcessor = $paymentProcessor; - // @todo Remove once we drop support for CiviCRM < 5.27 - $this->_processorName = E::SHORT_NAME; } /** @@ -1075,18 +1073,11 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment { public function doCancelRecurring(\Civi\Payment\PropertyBag $propertyBag) { // By default we always notify the processor and we don't give the user the option // because supportsCancelRecurringNotifyOptional() = FALSE - // @fixme setIsNotifyProcessorOnCancelRecur was added in 5.27 - remove method_exists once minVer is 5.27 - if (method_exists($propertyBag, 'setIsNotifyProcessorOnCancelRecur')) { - if (!$propertyBag->has('isNotifyProcessorOnCancelRecur')) { - // If isNotifyProcessorOnCancelRecur is NOT set then we set our default - $propertyBag->setIsNotifyProcessorOnCancelRecur(TRUE); - } - $notifyProcessor = $propertyBag->getIsNotifyProcessorOnCancelRecur(); - } - else { - // CiviCRM < 5.27 - $notifyProcessor = (boolean) CRM_Utils_Request::retrieveValue('send_cancel_request', 'Boolean', TRUE, FALSE, 'POST'); + if (!$propertyBag->has('isNotifyProcessorOnCancelRecur')) { + // If isNotifyProcessorOnCancelRecur is NOT set then we set our default + $propertyBag->setIsNotifyProcessorOnCancelRecur(TRUE); } + $notifyProcessor = $propertyBag->getIsNotifyProcessorOnCancelRecur(); if (!$notifyProcessor) { return ['message' => E::ts('Successfully cancelled the subscription in CiviCRM ONLY.')]; @@ -1115,46 +1106,6 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment { return ['message' => E::ts('Successfully cancelled the subscription at Stripe.')]; } - /** - * Attempt to cancel the subscription. - * @deprecated Remove when min CiviCRM version is 5.25 - * - * @see supportsCancelRecurring() - * - * @param string $message - * @param array|\Civi\Payment\PropertyBag $params - * - * @return bool - * @throws \CiviCRM_API3_Exception - * @throws \Civi\Payment\Exception\PaymentProcessorException - */ - public function cancelSubscription(&$message = '', $params = []) { - $propertyBag = \Civi\Payment\PropertyBag::cast($params); - - // Fix Unknown property 'subscriptionId' (for < 5.25) - // @see https://lab.civicrm.org/extensions/stripe/-/issues/234 - if (version_compare(CRM_Utils_System::version(), '5.25', '<')) { - if (isset($params['subscriptionId'])) { - $propertyBag->setRecurProcessorID($params['subscriptionId']); - } - } - - if (!$propertyBag->has('recurProcessorID')) { - throw new \Civi\Payment\Exception\PaymentProcessorException("cancelSubscription requires the recurProcessorID"); - } - - // contributionRecurID is set when doCancelRecurring is called directly (from 5.25) - if (!$propertyBag->has('contributionRecurID')) { - $contrib_recur = civicrm_api3('ContributionRecur', 'getsingle', [ - 'trxn_id' => $propertyBag->getRecurProcessorID(), - ]); - $propertyBag->setContributionRecurID($contrib_recur['id']); - } - - $message = $this->doCancelRecurring($propertyBag)['message']; - return TRUE; - } - /** * Process incoming payment notification (IPN). * diff --git a/js/civicrm_stripe.js b/js/civicrm_stripe.js index dc715ea79794d87147020977aeb9a9f96750957e..832672915127e428c8ebe69261e204fd140313c7 100644 --- a/js/civicrm_stripe.js +++ b/js/civicrm_stripe.js @@ -898,28 +898,6 @@ $(this).attr('name', name.replace('[' + name.split('[').pop(), '')); }); - // @todo remove once min version is 5.28 (https://github.com/civicrm/civicrm-core/pull/17672) - var is_for_organization = $('#is_for_organization'); - if (is_for_organization.length) { - setValidateOnBehalfOfBlock(); - is_for_organization.on('change', function() { - setValidateOnBehalfOfBlock(); - }); - } - function setValidateOnBehalfOfBlock() { - if (is_for_organization.is(':checked')) { - $('#onBehalfOfOrg select.crm-select2').removeClass('crm-no-validate'); - } - else { - $('#onBehalfOfOrg select.crm-select2').addClass('crm-no-validate'); - } - } - - var validator = $(form).validate(); - validator.settings.errorClass = 'crm-inline-error alert-danger'; - validator.settings.ignore = '.select2-offscreen, [readonly], :hidden:not(.crm-select2), .crm-no-validate'; - validator.settings.ignoreTitle = true; - // Default email validator accepts test@example but on test@example.org is valid (https://jqueryvalidation.org/jQuery.validator.methods/) $.validator.methods.email = function(value, element) { // Regex from https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address