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 order api to support a pseudoConstant for financial_type_id #13317

Merged
merged 1 commit into from
Jan 17, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Adds functionality & test to support 'Event Fee' instead of '4' for Order.create financial_type_id.

This improves consistency with Contribution.create api and others

Before

civicrm_api3('Order', 'create', [
'financial_type_id' => 'Event fee',
'total_amount' => 300,
'....
]);

Fails as financial_type_id cannot be validated

After

Above call works

Technical Details

Order.create api is an alias for Contribution.create api at the top level and it makes sense it supports the same pseudoconstants. Arguably it should start with the getfields output from Contribution.create but I've kept scope small & tested

Comments

@monishdeb @pradpnayak

@civibot
Copy link

civibot bot commented Dec 19, 2018

(Standard links)

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@seamuslee001
Copy link
Contributor

Test failure looks related @eileenmcnaughton

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@pradpnayak
Copy link
Contributor

Code looks good and also tested using api explorer, Financial type is populated with values on create mode.

screenshot from 2019-01-16 02-35-12

However the test failures looks related.

@eileenmcnaughton
Copy link
Contributor Author

Ok - I think I've fixed the api test - the change meant it had to support 'order_id' as 'id' to pass Syntaxconformance - now fixed - merge on pass @seamuslee001 ?

Adds functionality & test to support 'Event Fee' instead of '4' for Order.create financial_type_id.

This improves consistency with Contribution.create api and others
@eileenmcnaughton
Copy link
Contributor Author

unrelated fails

@eileenmcnaughton eileenmcnaughton merged commit e790273 into civicrm:master Jan 17, 2019
@eileenmcnaughton eileenmcnaughton deleted the order_pseudo branch January 17, 2019 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants