---
displayed_sidebar: homepage
---

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

# PaymentService

This will be

## Deprecated

in the near future use the new PaymentProcessor interface instead

## 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": "manager_",
    "type": "`EntityManager`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "transactionManager_",
    "type": "`undefined` \\| `EntityManager`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

___

## Accessors

### activeManager\_

#### Returns

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

___

## 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

<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": []
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

___

### authorizePayment

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSession",
    "type": "[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "amount",
        "type": "`number`",
        "description": "The amount that the Payment Session has been authorized for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "cart",
        "type": "[Cart](../../entities/classes/entities.Cart.mdx)",
        "description": "The details of the cart that the payment session was created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "cart_id",
        "type": "`null` \\| `string`",
        "description": "The ID of the cart that the payment session was created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "data",
        "type": "`Record<string, unknown>`",
        "description": "The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The payment session's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "is_initiated",
        "type": "`boolean`",
        "description": "A flag to indicate if a communication with the third party provider has been initiated.",
        "optional": false,
        "defaultValue": "false",
        "expandable": false,
        "children": []
      },
      {
        "name": "is_selected",
        "type": "`null` \\| `boolean`",
        "description": "A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_authorized_at",
        "type": "`Date`",
        "description": "The date with timezone at which the Payment Session was authorized.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "provider_id",
        "type": "`string`",
        "description": "The ID of the Payment Provider that is responsible for the Payment Session",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "status",
        "type": "`string`",
        "description": "Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires\\_more` to indicate that further actions are to be completed by the Customer.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  },
  {
    "name": "context",
    "type": "[Data](../types/medusa.Data.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.authorizePayment instead

___

### cancelPayment

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "payment",
    "type": "[Payment](../../entities/classes/entities.Payment.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "amount",
        "type": "`number`",
        "description": "The amount that the Payment has been authorized for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "amount_refunded",
        "type": "`number`",
        "description": "The amount of the original Payment amount that has been refunded back to the Customer.",
        "optional": false,
        "defaultValue": "0",
        "expandable": false,
        "children": []
      },
      {
        "name": "canceled_at",
        "type": "`string` \\| `Date`",
        "description": "The date with timezone at which the Payment was canceled.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "captured_at",
        "type": "`string` \\| `Date`",
        "description": "The date with timezone at which the Payment was captured.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "cart",
        "type": "[Cart](../../entities/classes/entities.Cart.mdx)",
        "description": "The details of the cart that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "cart_id",
        "type": "`string`",
        "description": "The ID of the cart that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "currency",
        "type": "[Currency](../../entities/classes/entities.Currency.mdx)",
        "description": "The details of the currency of the payment.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "currency_code",
        "type": "`string`",
        "description": "The 3 character ISO currency code of the payment.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "data",
        "type": "`Record<string, unknown>`",
        "description": "The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The payment's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a payment in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional key-value map with additional details",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "order",
        "type": "[Order](../../entities/classes/entities.Order.mdx)",
        "description": "The details of the order that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "order_id",
        "type": "`string`",
        "description": "The ID of the order that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "provider_id",
        "type": "`string`",
        "description": "The id of the Payment Provider that is responsible for the Payment",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "swap",
        "type": "[Swap](../../entities/classes/entities.Swap.mdx)",
        "description": "The details of the swap that this payment was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "swap_id",
        "type": "`string`",
        "description": "The ID of the swap that this payment was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.cancelPayment instead

___

### capturePayment

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "payment",
    "type": "[Payment](../../entities/classes/entities.Payment.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "amount",
        "type": "`number`",
        "description": "The amount that the Payment has been authorized for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "amount_refunded",
        "type": "`number`",
        "description": "The amount of the original Payment amount that has been refunded back to the Customer.",
        "optional": false,
        "defaultValue": "0",
        "expandable": false,
        "children": []
      },
      {
        "name": "canceled_at",
        "type": "`string` \\| `Date`",
        "description": "The date with timezone at which the Payment was canceled.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "captured_at",
        "type": "`string` \\| `Date`",
        "description": "The date with timezone at which the Payment was captured.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "cart",
        "type": "[Cart](../../entities/classes/entities.Cart.mdx)",
        "description": "The details of the cart that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "cart_id",
        "type": "`string`",
        "description": "The ID of the cart that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "currency",
        "type": "[Currency](../../entities/classes/entities.Currency.mdx)",
        "description": "The details of the currency of the payment.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "currency_code",
        "type": "`string`",
        "description": "The 3 character ISO currency code of the payment.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "data",
        "type": "`Record<string, unknown>`",
        "description": "The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The payment's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a payment in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional key-value map with additional details",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "order",
        "type": "[Order](../../entities/classes/entities.Order.mdx)",
        "description": "The details of the order that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "order_id",
        "type": "`string`",
        "description": "The ID of the order that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "provider_id",
        "type": "`string`",
        "description": "The id of the Payment Provider that is responsible for the Payment",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "swap",
        "type": "[Swap](../../entities/classes/entities.Swap.mdx)",
        "description": "The details of the swap that this payment was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "swap_id",
        "type": "`string`",
        "description": "The ID of the swap that this payment was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.capturePayment instead

___

### createPayment

`**createPayment**(context): Promise&#60;[PaymentSessionResponse](../types/medusa.PaymentSessionResponse.mdx)&#62;`

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "context",
    "type": "[Cart](../../entities/classes/entities.Cart.mdx) & [PaymentContext](../types/medusa.PaymentContext.mdx)",
    "description": "The type of this argument is meant to be temporary and once the previous method signature\nwill be removed, the type will only be PaymentContext instead of Cart & PaymentContext",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "billing_address",
        "type": "[Address](../../entities/classes/entities.Address.mdx)",
        "description": "The details of the billing address associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "billing_address_id",
        "type": "`string`",
        "description": "The billing address's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "completed_at",
        "type": "`Date`",
        "description": "The date with timezone at which the cart was completed.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "context",
        "type": "`Record<string, unknown>`",
        "description": "The context of the cart which can include info like IP or user agent.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "customer",
        "type": "[Customer](../../entities/classes/entities.Customer.mdx)",
        "description": "The details of the customer the cart belongs to.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "customer_id",
        "type": "`string`",
        "description": "The customer's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "deleted_at",
        "type": "`null` \\| `Date`",
        "description": "The date with timezone at which the resource was deleted.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "discount_total",
        "type": "`number`",
        "description": "The total of discount rounded",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "discounts",
        "type": "[Discount](../../entities/classes/entities.Discount.mdx)[]",
        "description": "An array of details of all discounts applied to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "email",
        "type": "`string`",
        "description": "The email associated with the cart",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_card_tax_total",
        "type": "`number`",
        "description": "The total of gift cards with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_card_total",
        "type": "`number`",
        "description": "The total of gift cards",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_cards",
        "type": "[GiftCard](../../entities/classes/entities.GiftCard.mdx)[]",
        "description": "An array of details of all gift cards applied to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The cart's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "item_tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of items with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "items",
        "type": "[LineItem](../../entities/classes/entities.LineItem.mdx)[]",
        "description": "The line items added to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional key-value map with additional details",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "object",
        "type": "`\"cart\"`",
        "description": "",
        "optional": false,
        "defaultValue": "\"cart\"",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment",
        "type": "[Payment](../../entities/classes/entities.Payment.mdx)",
        "description": "The details of the payment associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "payment_authorized_at",
        "type": "`Date`",
        "description": "The date with timezone at which the payment was authorized.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_id",
        "type": "`string`",
        "description": "The payment's ID if available",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_session",
        "type": "`null` \\| [PaymentSession](../../entities/classes/entities.PaymentSession.mdx)",
        "description": "The details of the selected payment session in the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "payment_sessions",
        "type": "[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)[]",
        "description": "The details of all payment sessions created on the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "raw_discount_total",
        "type": "`number`",
        "description": "The total of discount",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "refundable_amount",
        "type": "`number`",
        "description": "The amount that can be refunded",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "refunded_total",
        "type": "`number`",
        "description": "The total amount refunded if the order associated with this cart is returned.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "region",
        "type": "[Region](../../entities/classes/entities.Region.mdx)",
        "description": "The details of the region associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "region_id",
        "type": "`string`",
        "description": "The region's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "sales_channel",
        "type": "[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)",
        "description": "The details of the sales channel associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "sales_channel_id",
        "type": "`null` \\| `string`",
        "description": "The sales channel ID the cart is associated with.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_address",
        "type": "`null` \\| [Address](../../entities/classes/entities.Address.mdx)",
        "description": "The details of the shipping address associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "shipping_address_id",
        "type": "`string`",
        "description": "The shipping address's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_methods",
        "type": "[ShippingMethod](../../entities/classes/entities.ShippingMethod.mdx)[]",
        "description": "The details of the shipping methods added to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "shipping_tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of shipping with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_total",
        "type": "`number`",
        "description": "The total of shipping",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "subtotal",
        "type": "`number`",
        "description": "The subtotal of the cart",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of tax",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "total",
        "type": "`number`",
        "description": "The total amount of the cart",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "type",
        "type": "[CartType](../../entities/enums/entities.CartType.mdx)",
        "description": "The cart's type.",
        "optional": false,
        "defaultValue": "default",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "amount",
        "type": "`number`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "cart",
        "type": "`object`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "currency_code",
        "type": "`string`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "customer",
        "type": "[Customer](../../entities/classes/entities.Customer.mdx)",
        "description": "A customer can make purchases in your store and manage their profile.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "paymentSessionData",
        "type": "`Record<string, unknown>`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "resource_id",
        "type": "`string`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.initiatePayment instead

`**createPayment**(cart): Promise&#60;[Data](../types/medusa.Data.mdx)&#62;`

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "cart",
    "type": "[Cart](../../entities/classes/entities.Cart.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "billing_address",
        "type": "[Address](../../entities/classes/entities.Address.mdx)",
        "description": "The details of the billing address associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "billing_address_id",
        "type": "`string`",
        "description": "The billing address's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "completed_at",
        "type": "`Date`",
        "description": "The date with timezone at which the cart was completed.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "context",
        "type": "`Record<string, unknown>`",
        "description": "The context of the cart which can include info like IP or user agent.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "customer",
        "type": "[Customer](../../entities/classes/entities.Customer.mdx)",
        "description": "The details of the customer the cart belongs to.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "customer_id",
        "type": "`string`",
        "description": "The customer's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "deleted_at",
        "type": "`null` \\| `Date`",
        "description": "The date with timezone at which the resource was deleted.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "discount_total",
        "type": "`number`",
        "description": "The total of discount rounded",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "discounts",
        "type": "[Discount](../../entities/classes/entities.Discount.mdx)[]",
        "description": "An array of details of all discounts applied to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "email",
        "type": "`string`",
        "description": "The email associated with the cart",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_card_tax_total",
        "type": "`number`",
        "description": "The total of gift cards with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_card_total",
        "type": "`number`",
        "description": "The total of gift cards",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_cards",
        "type": "[GiftCard](../../entities/classes/entities.GiftCard.mdx)[]",
        "description": "An array of details of all gift cards applied to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The cart's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "item_tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of items with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "items",
        "type": "[LineItem](../../entities/classes/entities.LineItem.mdx)[]",
        "description": "The line items added to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional key-value map with additional details",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "object",
        "type": "`\"cart\"`",
        "description": "",
        "optional": false,
        "defaultValue": "\"cart\"",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment",
        "type": "[Payment](../../entities/classes/entities.Payment.mdx)",
        "description": "The details of the payment associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "payment_authorized_at",
        "type": "`Date`",
        "description": "The date with timezone at which the payment was authorized.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_id",
        "type": "`string`",
        "description": "The payment's ID if available",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_session",
        "type": "`null` \\| [PaymentSession](../../entities/classes/entities.PaymentSession.mdx)",
        "description": "The details of the selected payment session in the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "payment_sessions",
        "type": "[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)[]",
        "description": "The details of all payment sessions created on the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "raw_discount_total",
        "type": "`number`",
        "description": "The total of discount",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "refundable_amount",
        "type": "`number`",
        "description": "The amount that can be refunded",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "refunded_total",
        "type": "`number`",
        "description": "The total amount refunded if the order associated with this cart is returned.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "region",
        "type": "[Region](../../entities/classes/entities.Region.mdx)",
        "description": "The details of the region associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "region_id",
        "type": "`string`",
        "description": "The region's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "sales_channel",
        "type": "[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)",
        "description": "The details of the sales channel associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "sales_channel_id",
        "type": "`null` \\| `string`",
        "description": "The sales channel ID the cart is associated with.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_address",
        "type": "`null` \\| [Address](../../entities/classes/entities.Address.mdx)",
        "description": "The details of the shipping address associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "shipping_address_id",
        "type": "`string`",
        "description": "The shipping address's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_methods",
        "type": "[ShippingMethod](../../entities/classes/entities.ShippingMethod.mdx)[]",
        "description": "The details of the shipping methods added to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "shipping_tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of shipping with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_total",
        "type": "`number`",
        "description": "The total of shipping",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "subtotal",
        "type": "`number`",
        "description": "The subtotal of the cart",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of tax",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "total",
        "type": "`number`",
        "description": "The total amount of the cart",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "type",
        "type": "[CartType](../../entities/enums/entities.CartType.mdx)",
        "description": "The cart's type.",
        "optional": false,
        "defaultValue": "default",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use createPayment(context: `Cart & PaymentContext): Promise<PaymentSessionResponse>` instead

___

### deletePayment

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSession",
    "type": "[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "amount",
        "type": "`number`",
        "description": "The amount that the Payment Session has been authorized for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "cart",
        "type": "[Cart](../../entities/classes/entities.Cart.mdx)",
        "description": "The details of the cart that the payment session was created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "cart_id",
        "type": "`null` \\| `string`",
        "description": "The ID of the cart that the payment session was created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "data",
        "type": "`Record<string, unknown>`",
        "description": "The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The payment session's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "is_initiated",
        "type": "`boolean`",
        "description": "A flag to indicate if a communication with the third party provider has been initiated.",
        "optional": false,
        "defaultValue": "false",
        "expandable": false,
        "children": []
      },
      {
        "name": "is_selected",
        "type": "`null` \\| `boolean`",
        "description": "A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_authorized_at",
        "type": "`Date`",
        "description": "The date with timezone at which the Payment Session was authorized.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "provider_id",
        "type": "`string`",
        "description": "The ID of the Payment Provider that is responsible for the Payment Session",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "status",
        "type": "`string`",
        "description": "Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires\\_more` to indicate that further actions are to be completed by the Customer.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.cancelPayment instead

___

### getIdentifier

#### Returns

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

___

### getPaymentData

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSession",
    "type": "[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "amount",
        "type": "`number`",
        "description": "The amount that the Payment Session has been authorized for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "cart",
        "type": "[Cart](../../entities/classes/entities.Cart.mdx)",
        "description": "The details of the cart that the payment session was created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "cart_id",
        "type": "`null` \\| `string`",
        "description": "The ID of the cart that the payment session was created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "data",
        "type": "`Record<string, unknown>`",
        "description": "The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The payment session's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "is_initiated",
        "type": "`boolean`",
        "description": "A flag to indicate if a communication with the third party provider has been initiated.",
        "optional": false,
        "defaultValue": "false",
        "expandable": false,
        "children": []
      },
      {
        "name": "is_selected",
        "type": "`null` \\| `boolean`",
        "description": "A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_authorized_at",
        "type": "`Date`",
        "description": "The date with timezone at which the Payment Session was authorized.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "provider_id",
        "type": "`string`",
        "description": "The ID of the Payment Provider that is responsible for the Payment Session",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "status",
        "type": "`string`",
        "description": "Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires\\_more` to indicate that further actions are to be completed by the Customer.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.retrievePayment instead

___

### getStatus

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "data",
    "type": "[Data](../types/medusa.Data.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.getPaymentStatus instead

___

### refundPayment

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "payment",
    "type": "[Payment](../../entities/classes/entities.Payment.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "amount",
        "type": "`number`",
        "description": "The amount that the Payment has been authorized for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "amount_refunded",
        "type": "`number`",
        "description": "The amount of the original Payment amount that has been refunded back to the Customer.",
        "optional": false,
        "defaultValue": "0",
        "expandable": false,
        "children": []
      },
      {
        "name": "canceled_at",
        "type": "`string` \\| `Date`",
        "description": "The date with timezone at which the Payment was canceled.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "captured_at",
        "type": "`string` \\| `Date`",
        "description": "The date with timezone at which the Payment was captured.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "cart",
        "type": "[Cart](../../entities/classes/entities.Cart.mdx)",
        "description": "The details of the cart that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "cart_id",
        "type": "`string`",
        "description": "The ID of the cart that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "currency",
        "type": "[Currency](../../entities/classes/entities.Currency.mdx)",
        "description": "The details of the currency of the payment.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "currency_code",
        "type": "`string`",
        "description": "The 3 character ISO currency code of the payment.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "data",
        "type": "`Record<string, unknown>`",
        "description": "The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The payment's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a payment in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional key-value map with additional details",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "order",
        "type": "[Order](../../entities/classes/entities.Order.mdx)",
        "description": "The details of the order that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "order_id",
        "type": "`string`",
        "description": "The ID of the order that the payment session was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "provider_id",
        "type": "`string`",
        "description": "The id of the Payment Provider that is responsible for the Payment",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "swap",
        "type": "[Swap](../../entities/classes/entities.Swap.mdx)",
        "description": "The details of the swap that this payment was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "swap_id",
        "type": "`string`",
        "description": "The ID of the swap that this payment was potentially created for.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  },
  {
    "name": "refundAmount",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.refundPayment instead

___

### retrievePayment

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentData",
    "type": "[Data](../types/medusa.Data.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.retrievePayment instead

___

### retrieveSavedMethods

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "customer",
    "type": "[Customer](../../entities/classes/entities.Customer.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "billing_address",
        "type": "[Address](../../entities/classes/entities.Address.mdx)",
        "description": "The details of the billing address associated with the customer.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "billing_address_id",
        "type": "`null` \\| `string`",
        "description": "The customer's billing address ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "deleted_at",
        "type": "`null` \\| `Date`",
        "description": "The date with timezone at which the resource was deleted.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "email",
        "type": "`string`",
        "description": "The customer's email",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "first_name",
        "type": "`string`",
        "description": "The customer's first name",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "groups",
        "type": "[CustomerGroup](../../entities/classes/entities.CustomerGroup.mdx)[]",
        "description": "The customer groups the customer belongs to.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "has_account",
        "type": "`boolean`",
        "description": "Whether the customer has an account or not",
        "optional": false,
        "defaultValue": "false",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The customer's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "last_name",
        "type": "`string`",
        "description": "The customer's last name",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional key-value map with additional details",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "orders",
        "type": "[Order](../../entities/classes/entities.Order.mdx)[]",
        "description": "The details of the orders this customer placed.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "password_hash",
        "type": "`string`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "phone",
        "type": "`string`",
        "description": "The customer's phone number",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_addresses",
        "type": "[Address](../../entities/classes/entities.Address.mdx)[]",
        "description": "The details of the shipping addresses associated with the customer.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.getSavedMethods instead

___

### shouldRetryTransaction\_

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "err",
    "type": "`Record<string, unknown>` \\| `object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

___

### updatePayment

`**updatePayment**(paymentSessionData, context): Promise&#60;[PaymentSessionResponse](../types/medusa.PaymentSessionResponse.mdx) \| [Data](../types/medusa.Data.mdx)&#62;`

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSessionData",
    "type": "[Data](../types/medusa.Data.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "context",
    "type": "[Cart](../../entities/classes/entities.Cart.mdx) & [PaymentContext](../types/medusa.PaymentContext.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "billing_address",
        "type": "[Address](../../entities/classes/entities.Address.mdx)",
        "description": "The details of the billing address associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "billing_address_id",
        "type": "`string`",
        "description": "The billing address's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "completed_at",
        "type": "`Date`",
        "description": "The date with timezone at which the cart was completed.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "context",
        "type": "`Record<string, unknown>`",
        "description": "The context of the cart which can include info like IP or user agent.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "customer",
        "type": "[Customer](../../entities/classes/entities.Customer.mdx)",
        "description": "The details of the customer the cart belongs to.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "customer_id",
        "type": "`string`",
        "description": "The customer's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "deleted_at",
        "type": "`null` \\| `Date`",
        "description": "The date with timezone at which the resource was deleted.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "discount_total",
        "type": "`number`",
        "description": "The total of discount rounded",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "discounts",
        "type": "[Discount](../../entities/classes/entities.Discount.mdx)[]",
        "description": "An array of details of all discounts applied to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "email",
        "type": "`string`",
        "description": "The email associated with the cart",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_card_tax_total",
        "type": "`number`",
        "description": "The total of gift cards with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_card_total",
        "type": "`number`",
        "description": "The total of gift cards",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_cards",
        "type": "[GiftCard](../../entities/classes/entities.GiftCard.mdx)[]",
        "description": "An array of details of all gift cards applied to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The cart's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "item_tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of items with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "items",
        "type": "[LineItem](../../entities/classes/entities.LineItem.mdx)[]",
        "description": "The line items added to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional key-value map with additional details",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "object",
        "type": "`\"cart\"`",
        "description": "",
        "optional": false,
        "defaultValue": "\"cart\"",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment",
        "type": "[Payment](../../entities/classes/entities.Payment.mdx)",
        "description": "The details of the payment associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "payment_authorized_at",
        "type": "`Date`",
        "description": "The date with timezone at which the payment was authorized.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_id",
        "type": "`string`",
        "description": "The payment's ID if available",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_session",
        "type": "`null` \\| [PaymentSession](../../entities/classes/entities.PaymentSession.mdx)",
        "description": "The details of the selected payment session in the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "payment_sessions",
        "type": "[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)[]",
        "description": "The details of all payment sessions created on the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "raw_discount_total",
        "type": "`number`",
        "description": "The total of discount",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "refundable_amount",
        "type": "`number`",
        "description": "The amount that can be refunded",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "refunded_total",
        "type": "`number`",
        "description": "The total amount refunded if the order associated with this cart is returned.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "region",
        "type": "[Region](../../entities/classes/entities.Region.mdx)",
        "description": "The details of the region associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "region_id",
        "type": "`string`",
        "description": "The region's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "sales_channel",
        "type": "[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)",
        "description": "The details of the sales channel associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "sales_channel_id",
        "type": "`null` \\| `string`",
        "description": "The sales channel ID the cart is associated with.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_address",
        "type": "`null` \\| [Address](../../entities/classes/entities.Address.mdx)",
        "description": "The details of the shipping address associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "shipping_address_id",
        "type": "`string`",
        "description": "The shipping address's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_methods",
        "type": "[ShippingMethod](../../entities/classes/entities.ShippingMethod.mdx)[]",
        "description": "The details of the shipping methods added to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "shipping_tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of shipping with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_total",
        "type": "`number`",
        "description": "The total of shipping",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "subtotal",
        "type": "`number`",
        "description": "The subtotal of the cart",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of tax",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "total",
        "type": "`number`",
        "description": "The total amount of the cart",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "type",
        "type": "[CartType](../../entities/enums/entities.CartType.mdx)",
        "description": "The cart's type.",
        "optional": false,
        "defaultValue": "default",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "amount",
        "type": "`number`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "cart",
        "type": "`object`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "currency_code",
        "type": "`string`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "customer",
        "type": "[Customer](../../entities/classes/entities.Customer.mdx)",
        "description": "A customer can make purchases in your store and manage their profile.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "paymentSessionData",
        "type": "`Record<string, unknown>`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "resource_id",
        "type": "`string`",
        "description": "",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

`**updatePayment**(paymentSessionData, cart): Promise&#60;[Data](../types/medusa.Data.mdx)&#62;`

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSessionData",
    "type": "[Data](../types/medusa.Data.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "cart",
    "type": "[Cart](../../entities/classes/entities.Cart.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "billing_address",
        "type": "[Address](../../entities/classes/entities.Address.mdx)",
        "description": "The details of the billing address associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "billing_address_id",
        "type": "`string`",
        "description": "The billing address's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "completed_at",
        "type": "`Date`",
        "description": "The date with timezone at which the cart was completed.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "context",
        "type": "`Record<string, unknown>`",
        "description": "The context of the cart which can include info like IP or user agent.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "customer",
        "type": "[Customer](../../entities/classes/entities.Customer.mdx)",
        "description": "The details of the customer the cart belongs to.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "customer_id",
        "type": "`string`",
        "description": "The customer's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "deleted_at",
        "type": "`null` \\| `Date`",
        "description": "The date with timezone at which the resource was deleted.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "discount_total",
        "type": "`number`",
        "description": "The total of discount rounded",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "discounts",
        "type": "[Discount](../../entities/classes/entities.Discount.mdx)[]",
        "description": "An array of details of all discounts applied to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "email",
        "type": "`string`",
        "description": "The email associated with the cart",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_card_tax_total",
        "type": "`number`",
        "description": "The total of gift cards with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_card_total",
        "type": "`number`",
        "description": "The total of gift cards",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "gift_cards",
        "type": "[GiftCard](../../entities/classes/entities.GiftCard.mdx)[]",
        "description": "An array of details of all gift cards applied to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The cart's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "idempotency_key",
        "type": "`string`",
        "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "item_tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of items with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "items",
        "type": "[LineItem](../../entities/classes/entities.LineItem.mdx)[]",
        "description": "The line items added to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional key-value map with additional details",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "object",
        "type": "`\"cart\"`",
        "description": "",
        "optional": false,
        "defaultValue": "\"cart\"",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment",
        "type": "[Payment](../../entities/classes/entities.Payment.mdx)",
        "description": "The details of the payment associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "payment_authorized_at",
        "type": "`Date`",
        "description": "The date with timezone at which the payment was authorized.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_id",
        "type": "`string`",
        "description": "The payment's ID if available",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "payment_session",
        "type": "`null` \\| [PaymentSession](../../entities/classes/entities.PaymentSession.mdx)",
        "description": "The details of the selected payment session in the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "payment_sessions",
        "type": "[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)[]",
        "description": "The details of all payment sessions created on the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "raw_discount_total",
        "type": "`number`",
        "description": "The total of discount",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "refundable_amount",
        "type": "`number`",
        "description": "The amount that can be refunded",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "refunded_total",
        "type": "`number`",
        "description": "The total amount refunded if the order associated with this cart is returned.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "region",
        "type": "[Region](../../entities/classes/entities.Region.mdx)",
        "description": "The details of the region associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "region_id",
        "type": "`string`",
        "description": "The region's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "sales_channel",
        "type": "[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)",
        "description": "The details of the sales channel associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "sales_channel_id",
        "type": "`null` \\| `string`",
        "description": "The sales channel ID the cart is associated with.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_address",
        "type": "`null` \\| [Address](../../entities/classes/entities.Address.mdx)",
        "description": "The details of the shipping address associated with the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "shipping_address_id",
        "type": "`string`",
        "description": "The shipping address's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_methods",
        "type": "[ShippingMethod](../../entities/classes/entities.ShippingMethod.mdx)[]",
        "description": "The details of the shipping methods added to the cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "shipping_tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of shipping with taxes",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "shipping_total",
        "type": "`number`",
        "description": "The total of shipping",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "subtotal",
        "type": "`number`",
        "description": "The subtotal of the cart",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "tax_total",
        "type": "`null` \\| `number`",
        "description": "The total of tax",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "total",
        "type": "`number`",
        "description": "The total amount of the cart",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "type",
        "type": "[CartType](../../entities/enums/entities.CartType.mdx)",
        "description": "The cart's type.",
        "optional": false,
        "defaultValue": "default",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.updatePayment instead

___

### updatePaymentData

This will be

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSessionData",
    "type": "[Data](../types/medusa.Data.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data",
    "type": "[Data](../types/medusa.Data.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

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

#### Deprecated

in the near future use PaymentProcessor.updatePayment instead

___

### withTransaction

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "transactionManager",
    "type": "`EntityManager`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records"/>

#### Returns

<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": "manager_",
    "type": "`EntityManager`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "transactionManager_",
    "type": "`undefined` \\| `EntityManager`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "activeManager_",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "atomicPhase_",
    "type": "`<TResult, TError>`(`work`: (`transactionManager`: `EntityManager`) => Promise&#60;TResult&#62;, `isolationOrErrorHandler?`: `IsolationLevel` \\| (`error`: `TError`) => Promise&#60;void \\| TResult&#62;, `maybeErrorHandlerOrDontFail?`: (`error`: `TError`) => Promise&#60;void \\| TResult&#62;) => Promise&#60;TResult&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "authorizePayment",
    "type": "(`paymentSession`: [PaymentSession](../../entities/classes/entities.PaymentSession.mdx), `context`: [Data](../types/medusa.Data.mdx)) => Promise&#60;&#123; data: [Data](../types/medusa.Data.mdx) ; status: [PaymentSessionStatus](../../entities/enums/entities.PaymentSessionStatus.mdx)  &#125;&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "cancelPayment",
    "type": "(`payment`: [Payment](../../entities/classes/entities.Payment.mdx)) => Promise&#60;[Data](../types/medusa.Data.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "capturePayment",
    "type": "(`payment`: [Payment](../../entities/classes/entities.Payment.mdx)) => Promise&#60;[Data](../types/medusa.Data.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "createPayment",
    "type": "(`context`: [Cart](../../entities/classes/entities.Cart.mdx) & [PaymentContext](../types/medusa.PaymentContext.mdx)) => Promise&#60;[PaymentSessionResponse](../types/medusa.PaymentSessionResponse.mdx)&#62;(`cart`: [Cart](../../entities/classes/entities.Cart.mdx)) => Promise&#60;[Data](../types/medusa.Data.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "deletePayment",
    "type": "(`paymentSession`: [PaymentSession](../../entities/classes/entities.PaymentSession.mdx)) => Promise&#60;void&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "getIdentifier",
    "type": "() => `string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "getPaymentData",
    "type": "(`paymentSession`: [PaymentSession](../../entities/classes/entities.PaymentSession.mdx)) => Promise&#60;[Data](../types/medusa.Data.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "getStatus",
    "type": "(`data`: [Data](../types/medusa.Data.mdx)) => Promise&#60;[PaymentSessionStatus](../../entities/enums/entities.PaymentSessionStatus.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "refundPayment",
    "type": "(`payment`: [Payment](../../entities/classes/entities.Payment.mdx), `refundAmount`: `number`) => Promise&#60;[Data](../types/medusa.Data.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "retrievePayment",
    "type": "(`paymentData`: [Data](../types/medusa.Data.mdx)) => Promise&#60;[Data](../types/medusa.Data.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "retrieveSavedMethods",
    "type": "(`customer`: [Customer](../../entities/classes/entities.Customer.mdx)) => Promise&#60;[Data](../types/medusa.Data.mdx)[]&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "shouldRetryTransaction_",
    "type": "(`err`: `Record<string, unknown>` \\| ``{ code: string  }``) => `boolean`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "updatePayment",
    "type": "(`paymentSessionData`: [Data](../types/medusa.Data.mdx), `context`: [Cart](../../entities/classes/entities.Cart.mdx) & [PaymentContext](../types/medusa.PaymentContext.mdx)) => Promise&#60;[PaymentSessionResponse](../types/medusa.PaymentSessionResponse.mdx) \\| [Data](../types/medusa.Data.mdx)&#62;(`paymentSessionData`: [Data](../types/medusa.Data.mdx), `cart`: [Cart](../../entities/classes/entities.Cart.mdx)) => Promise&#60;[Data](../types/medusa.Data.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "updatePaymentData",
    "type": "(`paymentSessionData`: [Data](../types/medusa.Data.mdx), `data`: [Data](../types/medusa.Data.mdx)) => Promise&#60;[Data](../types/medusa.Data.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "withTransaction",
    "type": "(`transactionManager?`: `EntityManager`) => [PaymentService](medusa.PaymentService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />
