Skip to content
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

Fix Payment.create to update financial_item.status_id #20941

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jul 23, 2021

Overview

Fix Payment.create to update financial_item.status_id

Before

Create and order using order.create api, add a payment using payment.create - associated financial_items will have a status of 3 - unpaid

After

Status of the financial_item update to Paid when payment is added to it

Technical Details

When I try to switch to the order->create flow for membership forms it turns
out we are leaving the financial_item.status_id as 'unpaid' when adding a payment.

No one has noticed because this field is kinda unused - but it needs to work
to pass tests

Comments

@civibot
Copy link

civibot bot commented Jul 23, 2021

(Standard links)

@civibot civibot bot added the master label Jul 23, 2021
@eileenmcnaughton eileenmcnaughton force-pushed the ord branch 6 times, most recently from 374f99e to 4eaf0ca Compare July 26, 2021 14:23
@seamuslee001
Copy link
Contributor

Test fail i think might relate but maybe not

api_v3_ContributionTest::testRepeatContributionWithTaxAmount
Failed asserting that 100.0 matches expected '110.00'.

/home/jenkins/bknix-dfl/build/core-20941-5w8dn/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:3601
/home/jenkins/bknix-dfl/build/core-20941-5w8dn/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:3615
/home/jenkins/bknix-dfl/build/core-20941-5w8dn/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:577
/home/jenkins/bknix-dfl/extern/phpunit8/phpunit8.phar:671

@eileenmcnaughton
Copy link
Contributor Author

@eileenmcnaughton eileenmcnaughton force-pushed the ord branch 4 times, most recently from 39cce92 to e2fcf40 Compare July 27, 2021 23:44
@eileenmcnaughton
Copy link
Contributor Author

I just split off #20965

@eileenmcnaughton
Copy link
Contributor Author

@monishdeb this has been a big fight but it's passing now! I'm going to need your help to get it merged - I did split off #20965 to simplify a little

This makes it such that when using the default price set for contributions it not only
fills the default price field id. I originally had this in the code but I pulled it out
because the line item test failed. However, I'm seeing cases where not
having a price_field_value_id fails to add tax and I think the issue with the line item
test is that it is, incorrecly, trying to add 2 line items on the price field in
the default price set - which is not actually the expectation on the default price set

I do, separately, wonder if we need the unique id for price_field_id + contribution_id
+ price_field_value_id - but out of scope on this
When I try to switch to the order->create flow for membership forms it turns
out we are leaving the financial_item.status_id as 'unpaid' when adding a payment.

No one has noticed because this field is kinda unused - but it needs to work
to pass tests
@monishdeb
Copy link
Member

Changes makes sense. r-run passed and the added unit-tests capture the use-case accurately. Merging now.

@monishdeb monishdeb merged commit b525440 into civicrm:master Jul 28, 2021
@eileenmcnaughton eileenmcnaughton deleted the ord branch July 28, 2021 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants