Generated the following references: - `pricing` - `product` Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
65 lines
1.5 KiB
Plaintext
65 lines
1.5 KiB
Plaintext
---
|
|
displayed_sidebar: servicesSidebar
|
|
---
|
|
|
|
import ParameterTypes from "@site/src/components/ParameterTypes"
|
|
|
|
# ITaxCalculationStrategy
|
|
|
|
## Methods
|
|
|
|
### calculate
|
|
|
|
**calculate**(`items`, `taxLines`, `calculationContext`): `Promise`<`number`\>
|
|
|
|
Calculates the tax amount for a given set of line items under applicable
|
|
tax conditions and calculation contexts.
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../classes/LineItem.mdx)[]",
|
|
"description": "the line items to calculate the tax total for",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "taxLines",
|
|
"type": "([`LineItemTaxLine`](../classes/LineItemTaxLine.mdx) \\| [`ShippingMethodTaxLine`](../classes/ShippingMethodTaxLine.mdx))[]",
|
|
"description": "the tax lines that applies to the calculation",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "calculationContext",
|
|
"type": "[`TaxCalculationContext`](../types/TaxCalculationContext.mdx)",
|
|
"description": "other details relevant for the calculation",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
`Promise`<`number`\>
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "Promise",
|
|
"type": "`Promise`<`number`\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "the tax total",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|