--- displayed_sidebar: servicesSidebar --- import ParameterTypes from "@site/src/components/ParameterTypes" # TaxProviderService Finds tax providers and assists in tax related operations. ## constructor ### Parameters ___ ## Properties `", "description": "", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "__container__", "type": "`any`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "__moduleDeclaration__", "type": "`Record`", "description": "", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "cacheService_", "type": "`ICacheService`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "container_", "type": "AwilixContainer<any>", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "eventBus_", "type": "`IEventBusService`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "manager_", "type": "`EntityManager`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "smTaxLineRepo_", "type": "Repository<[ShippingMethodTaxLine](../../entities/classes/entities.ShippingMethodTaxLine.mdx)> & `object`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "taxLineRepo_", "type": "Repository<[LineItemTaxLine](../../entities/classes/entities.LineItemTaxLine.mdx)> & `object`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "taxProviderRepo_", "type": "Repository<[TaxProvider](../../entities/classes/entities.TaxProvider.mdx)>", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "taxRateService_", "type": "[TaxRateService](services.TaxRateService.mdx)", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "transactionManager_", "type": "`undefined` \\| `EntityManager`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ]} /> ___ ## Accessors ### activeManager\_ #### Returns ___ ## Methods ### atomicPhase\_ Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. #### Type Parameters #### Parameters Promise<TResult>", "description": "the transactional work to be done", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "isolationOrErrorHandler", "type": "`IsolationLevel` \\| (`error`: `TError`) => Promise<void \\| TResult>", "description": "the isolation level to be used for the work.", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "maybeErrorHandlerOrDontFail", "type": "(`error`: `TError`) => Promise<void \\| TResult>", "description": "Potential error handler", "optional": true, "defaultValue": "", "expandable": false, "children": [] } ]} /> #### Returns ___ ### clearLineItemsTaxLines #### Parameters #### Returns ___ ### clearTaxLines #### Parameters #### Returns ___ ### createShippingTaxLines Persists the tax lines relevant for a shipping method to the database. Used for return shipping methods. #### Parameters #### Returns ___ ### createTaxLines Persists the tax lines relevant for an order to the database. #### Parameters #### Returns ___ ### getCacheKey The cache key to get cache hits by. #### Parameters #### Returns ___ ### getRegionRatesForProduct Gets the tax rates configured for a product. The rates are cached between calls. #### Parameters #### Returns ___ ### getRegionRatesForShipping Gets the tax rates configured for a shipping option. The rates are cached between calls. #### Parameters #### Returns ___ ### getShippingTaxLines Gets the relevant tax lines for a shipping method. Note: this method doesn't persist the tax lines. Use createShippingTaxLines if you wish to persist the tax lines to the DB layer. #### Parameters #### Returns ___ ### getTaxLines Gets the relevant tax lines for an order or cart. If an order is provided the order's tax lines will be returned. If a cart is provided the tax lines will be computed from the tax rules and potentially a 3rd party tax plugin. Note: this method doesn't persist the tax lines. Use createTaxLines if you wish to persist the tax lines to the DB layer. #### Parameters #### Returns ___ ### getTaxLinesMap Return a map of tax lines for line items and shipping methods #### Parameters #### Returns ___ ### list #### Returns ___ ### registerInstalledProviders #### Parameters #### Returns ___ ### retrieveProvider Retrieves the relevant tax provider for the given region. #### Parameters #### Returns ___ ### shouldRetryTransaction\_ #### Parameters ` \\| `object`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ]} /> #### Returns ___ ### withTransaction #### Parameters #### Returns