Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@aldeed
Copy link
Contributor

@aldeed aldeed commented Feb 1, 2019

Resolves #4945
Impact: minor
Type: feature

Changes

A tax service's calculateOrderTaxes function may now return a black box customData object on each item in the taxes arrays.

This is not exposed through GraphQL. If you need any of the fields, you can create a custom plugin to extend type CalculatedTax with your properly typed custom fields and add resolvers as necessary.

Primarily, though, this is intended to be used to store extra data that the third-party tax integrations need for later API calls.

Breaking changes

None

Testing

This isn't currently used in the built-in tax service. You'd have to modify that calculateOrderTaxes function to include customData in its return, and then verify that it's stored in the database.

@aldeed aldeed added this to the 🏔 Torreys milestone Feb 1, 2019
@aldeed aldeed self-assigned this Feb 1, 2019
type: Object,
blackbox: true,
optional: true
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only actual change. All other changes were in support of adding the tests.

@aldeed aldeed requested review from Akarshit and kieckhafer February 1, 2019 14:32
@aldeed
Copy link
Contributor Author

aldeed commented Feb 1, 2019

@Akarshit Does this correctly solve #4945 for you?

@Akarshit
Copy link
Contributor

Akarshit commented Feb 1, 2019

@aldeed I am testing this.

@Akarshit
Copy link
Contributor

Akarshit commented Feb 1, 2019

Works!

Copy link
Member

@kieckhafer kieckhafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kieckhafer kieckhafer merged commit 7392603 into develop Feb 1, 2019
@kieckhafer kieckhafer deleted the feat-aldeed-4945-extra-tax-data branch February 1, 2019 19:49
@Akarshit
Copy link
Contributor

Akarshit commented Feb 1, 2019

@aldeed One thing I just discovered is that this only lets me store data per tax item.
I still don't have a way to store something at a higher level, for example the what taxClass was the product taxes according to the API(which I get in the response.)

@aldeed
Copy link
Contributor Author

aldeed commented Feb 5, 2019

@Akarshit Would you want to store that on taxSummary? Can you submit a new issue with your suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants