-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: allow tax services to add custom data to taxes #4955
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
Conversation
Signed-off-by: Eric Dobbertin <[email protected]>
Signed-off-by: Eric Dobbertin <[email protected]>
| type: Object, | ||
| blackbox: true, | ||
| optional: true | ||
| }, |
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.
This is the only actual change. All other changes were in support of adding the tests.
|
@aldeed I am testing this. |
|
Works! |
kieckhafer
left a comment
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.
👍
|
@aldeed One thing I just discovered is that this only lets me store data per tax item. |
|
@Akarshit Would you want to store that on |
Resolves #4945
Impact: minor
Type: feature
Changes
A tax service's
calculateOrderTaxesfunction may now return a black boxcustomDataobject on each item in thetaxesarrays.This is not exposed through GraphQL. If you need any of the fields, you can create a custom plugin to
extend type CalculatedTaxwith 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
calculateOrderTaxesfunction to includecustomDatain its return, and then verify that it's stored in the database.