-
-
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
Add call to validateAllContributions & fix getTotalAmount #20391
Conversation
(Standard links)
|
$contribution1 = $this->callAPISuccess('contribution', 'get', ['id' => $contribution['id'], 'return' => 'tax_amount', 'sequential' => 1]); | ||
$this->callAPISuccess('contribution', 'completetransaction', [ | ||
'id' => $contribution['id'], | ||
$params = array_merge($this->_params, ['contribution_status_id' => 2, 'sequential' => 1, 'financial_type_id' => $financialTypeId]); |
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.
@eileenmcnaughton can you please change the 2 to 'Pending' !!
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.
I just moved it down - see it's a few lines above - - but it should be Pending if I'm changing it
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.
oops I mean changing 2 to 'Pending'.
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.
OK - updated - I actually flicked it over to Order.create which no longer requires contribution_status_id (forces it to pending)
I've updated 2 tests for readability and extended one to call validateAllContributions. The call failed and it turned out to be the check was wrong. Fixing that caused a test to fail. I have fixed the test by fixing getTotalAmount on the internal helper BAO_Order class to include the tax_amount for each line in the total. I think this would most affect tests - but it might affect the Membership_Form due to changes made recently to that form so I'm on the fence about going for the rc with this one
ff79dd8
to
53c8b1b
Compare
@monishdeb well at least this one has passed! |
Looks good, tested on local. r-run passed. |
Overview
Add call to validateAllContributions & fix getTotalAmount
Before
The check in validateAllContributions is checking that the contribution.total_amount = SUM(line_item.line_total) but in fact it should be SUM(line_item.line_total) + SUM(line_item.tax_amount). On fixing that (to allow the check to be added to testCompleteTransactionFeeAmount & pass I found that testSubmitContributionPageWithPriceSetQuantity was failing - however the failure is in the part that is used by the unit tests & the (unused out side of tests ? ) ContributionPage.submit api.
After
$order->getTotalAmount()
fixed to be SUM(line_item.line_total) + SUM(line_item.tax_amount)Technical Details
I found this trying to extend test cover to allow us to deal with #20357 - it's possible this could be a regression in the back office membership class which does use this function - but I'm unclear about that and am on the fence about putting this against master or the rc
Comments