-
Notifications
You must be signed in to change notification settings - Fork 194
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
Feature: add revenue compatibility for v3 forms and donation model #7148
Feature: add revenue compatibility for v3 forms and donation model #7148
Conversation
@jonwaldstein I can't remember how our model hooks compatibility works. By switching to the model "updated" hook, will this still work sufficiently with v2 forms? Or is there a reason that's not necessary? |
@JasonTheAdams that's a great question! We are using the models in both v2 and v3 forms - so the model hooks will fire for both forms. In fact, we have done our best to make sure the processing is as close as possible. However, there is still a difference in how some data is sent to the server and how we process custom fields in v2 forms that we need to account for. For example, in v2 forms we send the sum amount of fee recovered to the server, where as in v3 forms, the two amounts are delivered separately and updated on the server via hooks. So to answer your question, yes the "updated" hook will work for v2 forms - however we are not exactly switching to that hook - it's being added in addition to |
@glaubersilva can you please review this one |
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.
@jonwaldstein Nice work! Everything worked as expected for both v2 and v3 forms. I just left a couple of comments about a few minor changes related to the missing unreleased tag. After that, it's ready for QA. Thanks!
tests/Unit/Revenue/LegacyListeners/UpdateRevenueWhenDonationAmountUpdatedTest.php
Show resolved
Hide resolved
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.
Passed manual QA tests.
Resolves GIVE-178
Description
This is necessary for updating the revenue amount in v3 forms that use models like give-funds. Most notably for use with fee-recovery as the amount gets updated after initial donation creation. In v2 forms this was all processed during the initial instance of
give_insert_payment
- where in v3 it's more of an async request and we need to listen for udpates.Basically, this will ensure the revenue table gets updated when a donation model is updated.
Affects
give_updated_edited_donation
andgivewp_donation_updated
for the purpose of updating revenue amounts.Visuals
Testing Instructions
Pre-review Checklist
@unreleased
tags included in DocBlocks