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

Add test for recurring links and clean up method of retrieving recurring #18790

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Oct 18, 2020

Overview

This helps address blockers on #18787 and #18196 by

  1. adding a preliminary unit test and
  2. cleaning up the processor loading (for Always use cancelSubscription form for cancelling recurring contributions #18196 there is some code around this but the reason for the change there is not clear & it's it some code that needn't apply since we just want the object, we are not checking for capabilities )

Before

  • No test
  • convoluted method of loading the processor object goes through complex code that doesn't add anything here

After

  • test to prevent behaviour change
  • we use our preferred method to just load the object - however, I felt I had to improve the caching in it a bit, along with a couple of NFC changes

Technical Details

Comments

@civibot
Copy link

civibot bot commented Oct 18, 2020

(Standard links)

1 Outdated Show resolved Hide resolved
@@ -69,7 +69,7 @@ public static function recurLinks($recurID = FALSE, $context = 'contribution') {
];

if ($recurID) {
$paymentProcessorObj = CRM_Contribute_BAO_ContributionRecur::getPaymentProcessorObject($recurID);
$paymentProcessorObj = Civi\Payment\System::singleton()->getById(CRM_Contribute_BAO_ContributionRecur::getPaymentProcessorID($recurID));
if ($paymentProcessorObj) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This IF can go as it is always true & would be removed in a follow up PR

@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

unrelated fail

@eileenmcnaughton eileenmcnaughton merged commit 86f29bd into civicrm:master Oct 19, 2020
@eileenmcnaughton eileenmcnaughton deleted the canceltest branch October 19, 2020 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants