[REF] Paypal std ipn Move not-actually shared-code out of shared code function #18536
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
[REF] Move not-actually shared-code out of shared code function
Before
single
function appears to hold a lot of code that is shared between themain
function and therecur
function but on looking at therecur
function it turns out to be entirely unreachable from there.After
non-shared code returned to the function that uses it.
Technical Details
On looking at the recur function it turns out it never calls without a
paymentStatus of 'Completed' ie it only proceeds to call
single
if$txnType == 'subscr_payment'
civicrm-core/CRM/Core/Payment/PayPalIPN.php
Line 180 in 26ec07d
And if ``$txnType == 'subscr_payment'``` then paymentStatus must be Completed
civicrm-core/CRM/Core/Payment/PayPalIPN.php
Line 79 in 26ec07d
between the 2 code paths but specifically belong to the 'main' (non-recur) code path.
Moving it out of this function we start to see there is very little shared code & probably no case for
the function to exist when we get down to it
Comments