TaxLineCalculationStrategy
TaxLineCalculationStrategy
This strategy defines how the TaxLines on OrderItems are calculated. By default, the DefaultTaxLineCalculationStrategy is used, which directly applies a single TaxLine based on the applicable TaxRate.
However, custom strategies may use any suitable method for calculating TaxLines. For example, a third-party tax API or a lookup of a custom tax table may be used.
Signature
interface TaxLineCalculationStrategy extends InjectableStrategy {
calculate(args: CalculateTaxLinesArgs): TaxLine[] | Promise<TaxLine[]>;
}
Extends
Members
calculate
(args: CalculateTaxLinesArgs) => TaxLine[] | Promise<TaxLine[]>
CalculateTaxLinesArgs
Signature
interface CalculateTaxLinesArgs {
ctx: RequestContext;
order: Order;
orderLine: OrderLine;
orderItem: OrderItem;
applicableTaxRate: TaxRate;
}
Members
ctx
RequestContext
order
Order
orderLine
OrderLine
orderItem
OrderItem
applicableTaxRate
TaxRate