Skip to content
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

Implement doCancelRecurring #319

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Implement doCancelRecurring #319

wants to merge 2 commits into from

Conversation

KarinG
Copy link
Contributor

@KarinG KarinG commented Jul 20, 2020

WIP - my ITEM 3:

ITEM3 - Cancelling a Recurring Contribution

1. The method doCancelRecurring() was added in CiviCRM 5.25 https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment.php#L1411 and is now the preferred function for Cancelling a Recurring Contribution! For older versions of CiviCRM you need to implement cancelSubscription().

2. Note: from CiviCRM 5.25 cancelSubscription() will receive a \Civi\Payment\PropertyBag and NOT an array. So -> if you are using array_ functions to interact with the $params that will no longer work as it is no longer an array. If you don't use array_ functions in your cancelSubscription() you will require no change! Note you can cast a $params array to $propertyBag to take advantage of it already.

3. The payment class should implement the following methods:

protected function supportsCancelRecurring() { return TRUE; } CiviCRM will show cancellation links based on this. 

4. Examples:
Fancy example: Stripe implementation -> https://lab.civicrm.org/extensions/stripe/-/blob/6.4.1/CRM/Core/Payment/Stripe.php#L975

Simple example: iATSPayments -> added a new function doCancelRecurring() & marked cancelSubscription() as to be deprecated in future [this PR]

If you are supporting ESR -> note that current ESR is 5.27 but many sites will still be on 5.21.x b/c there has not been a security advisory (yet). 

@KarinG KarinG marked this pull request as draft July 20, 2020 19:29
@KarinG KarinG marked this pull request as ready for review July 20, 2020 22:32
@KarinG KarinG changed the title WIP implement doCancelRecurring Implement doCancelRecurring Sep 12, 2020
@KarinG
Copy link
Contributor Author

KarinG commented Sep 19, 2020

@adixon - this is also a PR based on conversations w/ @eileenmcnaughton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant