Skip to content

Implement doCancelRecurring #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions CRM/Core/Payment/iATSService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

use Civi\Payment\Exception\PaymentProcessorException;
use Civi\Payment\PropertyBag;

/**
*
Expand Down Expand Up @@ -265,7 +266,7 @@ public function doPayment(&$params, $component = 'contribute') {
}

/**
* support corresponding CiviCRM method
* Support corresponding CiviCRM method
*/
public function changeSubscriptionAmount(&$message = '', $params = array()) {
// $userAlert = ts('You have modified this recurring contribution.');
Expand All @@ -274,14 +275,25 @@ public function changeSubscriptionAmount(&$message = '', $params = array()) {
}

/**
* support corresponding CiviCRM method
* Support corresponding CiviCRM method
* ToDo: deprecated -> remove when ESR has a security update which will bring everyone >5.27
*/
public function cancelSubscription(&$message = '', $params = array()) {
$userAlert = ts('You have cancelled this recurring contribution.');
CRM_Core_Session::setStatus($userAlert, ts('Warning'), 'alert');
return TRUE;
}

/**
* Support corresponding CiviCRM method
* preferred function for Cancelling a Recurring Contribution as of 5.25
*
* @return array|null[]
*/
public function doCancelRecurring(PropertyBag $propertyBag) {
return ['message' => ts('You have cancelled this recurring contribution.')];
}

/**
* Set additional fields when editing the schedule.
*
Expand Down