- if (CRM_Utils_Array::value('send_cancel_request', $params) == 1) {
- try {
- $propertyBag = new PropertyBag();
- $propertyBag->setContributionRecurID($this->getSubscriptionDetails()->recur_id);
- $propertyBag->setRecurProcessorID($this->getSubscriptionDetails()->subscription_id);
- $message = $this->_paymentProcessorObj->doCancelRecurring($propertyBag)['message'];
- }
- catch (\Civi\Payment\Exception\PaymentProcessorException $e) {
- CRM_Core_Error::statusBounce($e->getMessage());
- }
+ try {
+ $propertyBag = new PropertyBag();
+ $propertyBag->setIsNotifyProcessorOnCancelRecur(!empty($params['send_cancel_request']));
+ $propertyBag->setContributionRecurID($this->getSubscriptionDetails()->recur_id);
+ $propertyBag->setRecurProcessorID($this->getSubscriptionDetails()->subscription_id);
+ $message = $this->_paymentProcessorObj->doCancelRecurring($propertyBag)['message'];
+ }
+ catch (\Civi\Payment\Exception\PaymentProcessorException $e) {
+ CRM_Core_Error::statusBounce($e->getMessage());