dev/financial#148 Simplify parameters passed to completeOrder #18479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Simplifies the code in Event batch update to no longer interact with the BaseIPN class - specifically when updating an event to Completed
Before
$baseIPN validate called to retrieve 'objects' - but in practice doing the same as contribution->fetch() plus an incorrect guess at the relevant payment processor
After
just calls contribution->fetch()
Technical Details
Now that completeOrder has had most interaction with objects var cleaned up
we know only 2 objects are actually used
This alters it to only load & pass contribution. The value of passing in
processor seems lost in time. This code can only be reached for pay_later contributions - see
CRM_Contribute_BAO_Contribution::checkOnlinePendingContribution
and specifically
civicrm-core/CRM/Contribute/BAO/Contribution.php
Line 2033 in 318c630
and only when submitted via an online event (same function) so by definition there IS NO PAYMENT PROCESSOR that applies.
Given that we can just do the minimum to load the contribution and pass that in.
Testing notes
I added CRM_Event_Form_Task_BatchTest::testSubmit prior to starting cleanup on this code. It passes through the altered lines & should lock in 'no change of behaviour'
Comments
Original PR was closed by accident (by me) #18390