return method_exists(CRM_Utils_System::getClassName($this), 'cancelSubscription');
}
+ /**
+ * Does the processor support the user having a choice as to whether to cancel the recurring with the processor?
+ *
+ * If this returns TRUE then there will be an option to send a cancellation request in the cancellation form.
+ *
+ * This would normally be false for processors where CiviCRM maintains the schedule.
+ *
+ * @return bool
+ */
+ protected function supportsCancelRecurringNotifyOptional() {
+ return $this->supportsCancelRecurring();
+ }
+
/**
* Does this processor support pre-approval.
*
}
case 'cancelRecurNotSupportedText':
- return ts('Automatic cancellation is not supported for this payment processor. You or the contributor will need to manually cancel this recurring contribution using the payment processor website.');
+ if (!$this->supportsCancelRecurring()) {
+ return ts('Automatic cancellation is not supported for this payment processor. You or the contributor will need to manually cancel this recurring contribution using the payment processor website.');
+ }
+ return '';
}
CRM_Core_Error::deprecatedFunctionWarning('Calls to getText must use a supported method');
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
public function doCancelRecurring(PropertyBag $propertyBag) {
- if (method_exists($this, 'cancelSubscription')) {
+ if (method_exists($this, 'cancelSubscription')
+ && $propertyBag->getIsNotifyProcessorOnCancelRecur()) {
$message = NULL;
if ($this->cancelSubscription($message, $propertyBag)) {
return ['message' => $message];