-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
[REF] Paypal ipn - cleanup references to completion #20407
Conversation
(Standard links)
|
So if someone goes in and alters their PayPal Recurring in the PayPal GUI (as that is the only place to do it) that will mean that any newly created contribution based on the template would have a different amount to what is coming in the input right? |
@seamuslee001 right - so the question is - at what point is that valid - I am not sure it would be valid before the first amount is received? (rather than after the recurring has started) But if we think it is I think we should remove the amount check altogether |
Yeh so I don't think it should be valid on the first amount but valid after that. So are we certain that all subsequently created contributions are completed before the payment is processed is the only question I think? |
@seamuslee001 does what you said make sense or am I just needing coffee? |
Oh I think I get it - so the contribution being checked for completeness is always the first contribution. If the first contribution is completed then it goes on to create a subsequent contribution |
@seamuslee001 looks like I need to go in & fix something - what is your vote on the validation
|
I would probably go with 2 I would think, that seems to be the closest to the original right? |
@seamuslee001 I guess 3 is closer to the original - 3 permitted amount to change for the first payment for a recurring - but I'm not convinced that is a real scenario or that the code really copes with it beyond this point |
This extracts a function to check if the contribution is completed. I also rationalised the validation - it was using a combo of recur and first to validate but on thinking it through I realised all it was saying was 'if we are finalising a pending contribution the amount must match' I think that's fine even for recur with a change in amount - that seems to me to be something that happens down the track but we still expect the very first one to come in with the value it originally had - if that is NOT true then we probably should just remove the check
@seamuslee001 well tests turned out to be enforcing 3 - either by design or by accident but it's back now |
Overview
[REF] Paypal ipn - cleanup references to completion
Before
Params passed around
After
function used
Technical Details
This extracts a function to check if the contribution is completed.
I also rationalised the validation - it was using a combo of recur and first to
validate but on thinking it through I realised all it was saying was
'if we are finalising a pending contribution the amount must match'
I think that's fine even for recur with a change in amount - that seems
to me to be something that happens down the track but we still expect
the very first one to come in with the value it originally
had - if that is NOT true then we probably should just remove the check
Comments
Note this leaves a bunch of unused params - I think it's cleaner to remove those once this is merged