-
-
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
CRM-21200: Pay Now payment overwrites the contribution #11059
Conversation
I think this handles the issue well (though it raises the question of whether the |
This seems fine WRT the source - per @highfalutin's testing. WRT campaign - I guess the argument is that this was originally created via one page (or possibly even an event?) and we want to retain the original campaign. That makes sense I think. I'm giving this merge ready as it seems OK to merge, but I'd like a little cool down just in case some magic reason why contribution_id might be otherwise present occurs to us. |
I guess this does fail the unit test test ... and I mention that because it could easily get re-broken if you don't add one |
@eileenmcnaughton not sure how to add UT to assert the behaviour of |
Is there no way to test |
@highfalutin you want to know if there is a way to use |
@eileenmcnaughton is there any additional fix I need to address? |
@monishdeb I guess we should talk more about the test - processConfirm is called from a few forms & I think we can test those form flows - ie. test the submit function, which is what we really care about since we all hope processConfirm will not live forever in anything like it's current form |
@eileenmcnaughton I have added UT with |
0, FALSE | ||
); | ||
// Based on the processed contribution, complete transaction which update the contribution status based on payment result. | ||
if (!empty($result['contribution'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't really need to wrap this because it is such a shallow wrapper around civicrm_api3('contribution', 'completetransaction', array( I think we should ditch the wrapper & just call the api within the test (which is also how 50% of payment processors will call the completion)
@monishdeb just one minor point regarding the test - I think we can avoid the wrapper - otherwise all good |
@eileenmcnaughton made the change, can you please check now? |
I agree with the changes and i believe that they will fix the issue, I haven't tested it but there seems to be one minor issue with the test but i don't think that should prevent this from being merged |
Merging based on merge ready flag having been added a while back & a test having been subsequently added |
CRM-21200: Pay Now payment overwrites the contribution
Overview
Currently when we do a pay now contribution civicrm_contribution.contribution_page_id and civicrm_contribution.source is updated i.e the configured page for the later pay now payment overwrites the contribution info derived from the original creation of the pay later contribution. This should be a payment that is not overwriting 'reason' that the contribution was originally created.
To replicate:
Before
Contribution detail like source, campaign_id and contribution_page_id overwritten. Screenshot:
After
Screenshot: