---
displayed_sidebar: servicesSidebar
---

import ParameterTypes from "@site/src/components/ParameterTypes"

# NewTotalsService

## Constructors

### constructor

`**new NewTotalsService**(«destructured»)`

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "__namedParameters",
    "type": "[InjectedDependencies](../types/InjectedDependencies-15.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

## Properties

<ParameterTypes parameters={[
  {
    "name": "__configModule__",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__container__",
    "type": "`any`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__moduleDeclaration__",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "featureFlagRouter_",
    "type": "[FlagRouter](FlagRouter.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "manager_",
    "type": "EntityManager",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "taxCalculationStrategy_",
    "type": "[ITaxCalculationStrategy](../interfaces/ITaxCalculationStrategy.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "taxProviderService_",
    "type": "[TaxProviderService](TaxProviderService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "transactionManager_",
    "type": "`undefined` \\| EntityManager",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

## Accessors

### activeManager\_

`Protected get**activeManager_**(): EntityManager`

#### Returns

EntityManager

<ParameterTypes parameters={[
  {
    "name": "EntityManager",
    "type": "EntityManager",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

## Methods

### atomicPhase\_

`Protected **atomicPhase_**<TypeParameter TResult, TypeParameter TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise&#60;TResult&#62;`

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.

<ParameterTypes parameters={[
  {
    "name": "TResult",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "TError",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "work",
    "type": "(`transactionManager`: EntityManager) => Promise&#60;TResult&#62;",
    "description": "the transactional work to be done",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "isolationOrErrorHandler",
    "type": "`IsolationLevel` \\| (`error`: `TError`) => Promise&#60;void \\| TResult&#62;",
    "description": "the isolation level to be used for the work.",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "maybeErrorHandlerOrDontFail",
    "type": "(`error`: `TError`) => Promise&#60;void \\| TResult&#62;",
    "description": "Potential error handler",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

Promise&#60;TResult&#62;

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;TResult&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the result of the transactional work",
    "expandable": false,
    "children": []
  }
]} />

___

### getGiftCardTotals

`**getGiftCardTotals**(giftCardableAmount, «destructured»): Promise&#60;&#123; tax_total: number ; total: number  &#125;&#62;`

Calculate and return the gift cards totals

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "giftCardableAmount",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.giftCardTransactions",
    "type": "[GiftCardTransaction](../types/GiftCardTransaction-1.mdx)[]",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.giftCards",
    "type": "[GiftCard](GiftCard.mdx)[]",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.region",
    "type": "[Region](Region.mdx)",
    "description": "A region holds settings specific to a geographical location, including the currency, tax rates, and fulfillment and payment providers. A Region can consist of multiple countries to accomodate common shopping settings across countries.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

Promise&#60;&#123; tax_total: number ; total: number  &#125;&#62;

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;&#123; tax_total: number ; total: number  &#125;&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getGiftCardTransactionsTotals

`**getGiftCardTransactionsTotals**(«destructured»): &#123; tax_total: number ; total: number  &#125;`

Calculate and return the gift cards totals based on their transactions

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.giftCardTransactions",
    "type": "[GiftCardTransaction](../types/GiftCardTransaction-1.mdx)[]",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.region",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.region.gift_cards_taxable",
    "type": "`boolean`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.region.tax_rate",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

`object`

<ParameterTypes parameters={[
  {
    "name": "object",
    "type": "`object`",
    "optional": true,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

<ParameterTypes parameters={[
  {
    "name": "tax_total",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "total",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getGiftCardableAmount

`**getGiftCardableAmount**(«destructured»): number`

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.discount_total",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.gift_cards_taxable",
    "type": "`boolean`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.shipping_total",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.subtotal",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.tax_total",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

`number`

<ParameterTypes parameters={[
  {
    "name": "number",
    "type": "`number`",
    "optional": true,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getLineItemRefund

`**getLineItemRefund**(lineItem, «destructured»): number`

Return the amount that can be refund on a line item

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "lineItem",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "lineItem.id",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "lineItem.includes_tax",
    "type": "`boolean`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "lineItem.quantity",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "lineItem.tax_lines",
    "type": "[LineItemTaxLine](LineItemTaxLine.mdx)[]",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "lineItem.unit_price",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.calculationContext",
    "type": "[TaxCalculationContext](../types/TaxCalculationContext.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.taxRate",
    "type": "``null`` \\| `number`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

`number`

<ParameterTypes parameters={[
  {
    "name": "number",
    "type": "`number`",
    "optional": true,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getLineItemRefundLegacy

`Protected **getLineItemRefundLegacy**(lineItem, «destructured»): number`

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "lineItem",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "lineItem.id",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "lineItem.includes_tax",
    "type": "`boolean`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "lineItem.quantity",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "lineItem.unit_price",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.calculationContext",
    "type": "[TaxCalculationContext](../types/TaxCalculationContext.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.taxRate",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

`number`

<ParameterTypes parameters={[
  {
    "name": "number",
    "type": "`number`",
    "optional": true,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getLineItemTotals

`**getLineItemTotals**(items, «destructured»): Promise&#60;&#123; [lineItemId: string]: [LineItemTotals](../types/LineItemTotals.mdx);  &#125;&#62;`

Calculate and return the items totals for either the legacy calculation or the new calculation

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "items",
    "type": "[LineItem](LineItem.mdx) \\| [LineItem](LineItem.mdx)[]",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.calculationContext",
    "type": "[TaxCalculationContext](../types/TaxCalculationContext.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.includeTax",
    "type": "`boolean`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.taxRate",
    "type": "``null`` \\| `number`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

Promise&#60;&#123; [lineItemId: string]: [LineItemTotals](../types/LineItemTotals.mdx);  &#125;&#62;

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;&#123; [lineItemId: string]: [LineItemTotals](../types/LineItemTotals.mdx);  &#125;&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getLineItemTotalsLegacy

`Protected **getLineItemTotalsLegacy**(item, «destructured»): Promise&#60;[LineItemTotals](../types/LineItemTotals.mdx)&#62;`

Calculate and return the legacy calculated totals using the tax rate

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "item",
    "type": "[LineItem](LineItem.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.calculationContext",
    "type": "[TaxCalculationContext](../types/TaxCalculationContext.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.lineItemAllocation",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.lineItemAllocation.discount",
    "type": "[DiscountAllocation](../types/DiscountAllocation.mdx)",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.lineItemAllocation.gift_card",
    "type": "[GiftCardAllocation](../types/GiftCardAllocation.mdx)",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.taxRate",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

Promise&#60;[LineItemTotals](../types/LineItemTotals.mdx)&#62;

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[LineItemTotals](../types/LineItemTotals.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getLineItemTotals\_

`Protected **getLineItemTotals_**(item, «destructured»): Promise&#60;[LineItemTotals](../types/LineItemTotals.mdx)&#62;`

Calculate and return the totals for an item

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "item",
    "type": "[LineItem](LineItem.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.calculationContext",
    "type": "[TaxCalculationContext](../types/TaxCalculationContext.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.includeTax",
    "type": "`boolean`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.lineItemAllocation",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.lineItemAllocation.discount",
    "type": "[DiscountAllocation](../types/DiscountAllocation.mdx)",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.lineItemAllocation.gift_card",
    "type": "[GiftCardAllocation](../types/GiftCardAllocation.mdx)",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.taxLines",
    "type": "[LineItemTaxLine](LineItemTaxLine.mdx)[]",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

Promise&#60;[LineItemTotals](../types/LineItemTotals.mdx)&#62;

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[LineItemTotals](../types/LineItemTotals.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getShippingMethodTotals

`**getShippingMethodTotals**(shippingMethods, «destructured»): Promise&#60;&#123; [shippingMethodId: string]: [ShippingMethodTotals](../types/ShippingMethodTotals.mdx);  &#125;&#62;`

Calculate and return the shipping methods totals for either the legacy calculation or the new calculation

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "shippingMethods",
    "type": "[ShippingMethod](ShippingMethod.mdx) \\| [ShippingMethod](ShippingMethod.mdx)[]",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.calculationContext",
    "type": "[TaxCalculationContext](../types/TaxCalculationContext.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.discounts",
    "type": "[Discount](Discount.mdx)[]",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.includeTax",
    "type": "`boolean`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.taxRate",
    "type": "``null`` \\| `number`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

Promise&#60;&#123; [shippingMethodId: string]: [ShippingMethodTotals](../types/ShippingMethodTotals.mdx);  &#125;&#62;

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;&#123; [shippingMethodId: string]: [ShippingMethodTotals](../types/ShippingMethodTotals.mdx);  &#125;&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getShippingMethodTotalsLegacy

`Protected **getShippingMethodTotalsLegacy**(shippingMethod, «destructured»): Promise&#60;[ShippingMethodTotals](../types/ShippingMethodTotals.mdx)&#62;`

Calculate and return the shipping method totals legacy using the tax rate

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "shippingMethod",
    "type": "[ShippingMethod](ShippingMethod.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.calculationContext",
    "type": "[TaxCalculationContext](../types/TaxCalculationContext.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.discounts",
    "type": "[Discount](Discount.mdx)[]",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.taxRate",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

Promise&#60;[ShippingMethodTotals](../types/ShippingMethodTotals.mdx)&#62;

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[ShippingMethodTotals](../types/ShippingMethodTotals.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getShippingMethodTotals\_

`Protected **getShippingMethodTotals_**(shippingMethod, «destructured»): Promise&#60;[ShippingMethodTotals](../types/ShippingMethodTotals.mdx)&#62;`

Calculate and return the shipping method totals

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "shippingMethod",
    "type": "[ShippingMethod](ShippingMethod.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.calculationContext",
    "type": "[TaxCalculationContext](../types/TaxCalculationContext.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.discounts",
    "type": "[Discount](Discount.mdx)[]",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.includeTax",
    "type": "`boolean`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__namedParameters.taxLines",
    "type": "[ShippingMethodTaxLine](ShippingMethodTaxLine.mdx)[]",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

Promise&#60;[ShippingMethodTotals](../types/ShippingMethodTotals.mdx)&#62;

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[ShippingMethodTotals](../types/ShippingMethodTotals.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### shouldRetryTransaction\_

`Protected **shouldRetryTransaction_**(err): boolean`

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "err",
    "type": "`Record<string, unknown>` \\| `&#123; code: string  &#125;`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

`boolean`

<ParameterTypes parameters={[
  {
    "name": "boolean",
    "type": "`boolean`",
    "optional": true,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### withTransaction

`**withTransaction**(transactionManager?): [NewTotalsService](NewTotalsService.mdx)`

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "transactionManager",
    "type": "EntityManager",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

[NewTotalsService](NewTotalsService.mdx)

<ParameterTypes parameters={[
  {
    "name": "default",
    "type": "[NewTotalsService](NewTotalsService.mdx)",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />
