---
displayed_sidebar: servicesSidebar
---

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

# PaymentProviderService

Helps retrieve payment providers

## constructor

### Parameters

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

___

## Properties

<ParameterTypes parameters={[
  {
    "name": "__configModule__",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__container__",
    "type": "`any`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__moduleDeclaration__",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "container_",
    "type": "`InjectedDependencies`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "customerService_",
    "type": "[CustomerService](services.CustomerService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "featureFlagRouter_",
    "type": "`FlagRouter`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "logger_",
    "type": "[Logger](../../medusa/types/medusa.Logger.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "manager_",
    "type": "`EntityManager`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentProviderRepository_",
    "type": "Repository&#60;[PaymentProvider](../../entities/classes/entities.PaymentProvider.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentRepository_",
    "type": "Repository&#60;[Payment](../../entities/classes/entities.Payment.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentSessionRepository_",
    "type": "Repository&#60;[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "refundRepository_",
    "type": "Repository&#60;[Refund](../../entities/classes/entities.Refund.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "transactionManager_",
    "type": "`undefined` \\| `EntityManager`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

___

## Accessors

### activeManager\_

#### Returns

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

___

### paymentService\_

#### Returns

<ParameterTypes parameters={[
  {
    "name": "PaymentService",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "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": []
  }
]} />

#### Returns

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

___

### authorizePayment

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSession",
    "type": "[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "context",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;undefined \\| [PaymentSession](../../entities/classes/entities.PaymentSession.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### buildPaymentProcessorContext

Build the create session context for both legacy and new API

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "cartOrData",
    "type": "[Cart](../../entities/classes/entities.Cart.mdx) \\| `PaymentSessionInput`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Cart & PaymentContext",
    "type": "[Cart](../../entities/classes/entities.Cart.mdx) & [PaymentContext](../../medusa/types/medusa.PaymentContext.mdx)",
    "optional": true,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### cancelPayment

#### Parameters

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

#### Returns

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

___

### capturePayment

#### Parameters

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

#### Returns

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

___

### createPayment

#### Parameters

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

#### Returns

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

___

### createSession

`**createSession**(providerId, cart): Promise&#60;[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)&#62;`

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "providerId",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "cart",
    "type": "[Cart](../../entities/classes/entities.Cart.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

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

#### Deprecated

`**createSession**(sessionInput): Promise&#60;[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)&#62;`

Creates a payment session with the given provider.

#### Parameters

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

#### Returns

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

___

### deleteSession

#### Parameters

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

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;undefined \\| [PaymentSession](../../entities/classes/entities.PaymentSession.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### getStatus

#### Parameters

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

#### Returns

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

___

### list

#### Returns

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

___

### listPayments

List all the payments according to the given selector and config.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "selector",
    "type": "[Selector](../../medusa/types/medusa.Selector.mdx)&#60;[Payment](../../entities/classes/entities.Payment.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)&#60;[Payment](../../entities/classes/entities.Payment.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

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

___

### processUpdateRequestsData

Process the collected data. Can be used every time we need to process some collected data returned by the provider

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "data",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  },
  {
    "name": "data.customer",
    "type": "`object`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data.customer.id",
    "type": "`string`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentResponse",
    "type": "`Record<string, unknown>` \\| [PaymentSessionResponse](../../medusa/types/medusa.PaymentSessionResponse.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

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

___

### refreshSession

Refreshes a payment session with the given provider.
This means, that we delete the current one and create a new.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSession",
    "type": "`object`",
    "description": "the payment session object to\n   update",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentSession.data",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentSession.id",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentSession.provider_id",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "sessionInput",
    "type": "`PaymentSessionInput`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the payment session",
    "expandable": false,
    "children": []
  }
]} />

___

### refundFromPayment

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "payment",
    "type": "[Payment](../../entities/classes/entities.Payment.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "amount",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "reason",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "note",
    "type": "`string`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

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

___

### refundPayment

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "payObjs",
    "type": "[Payment](../../entities/classes/entities.Payment.mdx)[]",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "amount",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "reason",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "note",
    "type": "`string`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

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

___

### registerInstalledProviders

#### Parameters

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

#### Returns

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

___

### retrievePayment

Retrieve a payment entity with the given id.

#### Parameters

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

#### Returns

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

___

### retrieveProvider

Finds a provider given an id

#### Type Parameters

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

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "providerId",
    "type": "`string`",
    "description": "the id of the provider to get",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "TProvider extends AbstractPaymentService ? AbstractPaymentService : TProvider extends AbstractPaymentProcessor ? AbstractPaymentProcessor : any",
    "type": "`TProvider` extends [AbstractPaymentService](../../medusa/classes/medusa.AbstractPaymentService.mdx) ? [AbstractPaymentService](../../medusa/classes/medusa.AbstractPaymentService.mdx) : `TProvider` extends [AbstractPaymentProcessor](../../medusa/classes/medusa.AbstractPaymentProcessor.mdx) ? [AbstractPaymentProcessor](../../medusa/classes/medusa.AbstractPaymentProcessor.mdx) : `any`",
    "optional": true,
    "defaultValue": "",
    "description": "the payment provider",
    "expandable": false,
    "children": []
  }
]} />

___

### retrieveRefund

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "id",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)&#60;[Refund](../../entities/classes/entities.Refund.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

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

___

### retrieveSession

Return the payment session for the given id.

#### Parameters

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

#### Returns

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

___

### saveSession

Create or update a Payment session data.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "providerId",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data.amount",
    "type": "`number`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data.cartId",
    "type": "`string`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data.isInitiated",
    "type": "`boolean`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data.isSelected",
    "type": "`boolean`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data.payment_session_id",
    "type": "`string`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data.sessionData",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data.status",
    "type": "[PaymentSessionStatus](../../entities/enums/entities.PaymentSessionStatus.mdx)",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

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

___

### shouldRetryTransaction\_

#### Parameters

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

#### Returns

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

___

### throwFromPaymentProcessorError

#### Parameters

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

#### Returns

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

___

### updatePayment

#### Parameters

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

#### Returns

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

___

### updateSession

Update a payment session with the given provider.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSession",
    "type": "`object`",
    "description": "The paymentSession to update",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentSession.data",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentSession.id",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "paymentSession.provider_id",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "sessionInput",
    "type": "[Cart](../../entities/classes/entities.Cart.mdx) \\| `PaymentSessionInput`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the payment session",
    "expandable": false,
    "children": []
  }
]} />

___

### updateSessionData

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "paymentSession",
    "type": "[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

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

___

### withTransaction

#### Parameters

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

#### Returns

<ParameterTypes parameters={[
  {
    "name": "PaymentProviderService",
    "type": "`object`",
    "description": "Helps retrieve payment providers",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />
