Skip to main content
Skip to main content

PaymentService

This will be

Deprecated

in the near future use the new PaymentProcessor interface instead

Properties

manager_EntityManagerRequired
transactionManager_undefined | EntityManagerRequired
__container__anyRequired
__configModule__Record<string, unknown>
__moduleDeclaration__Record<string, unknown>

Accessors

activeManager_

Returns

EntityManagerEntityManagerRequired

Methods

getIdentifier

Returns

stringstringRequired

getPaymentData

This will be

Parameters

paymentSessionPaymentSessionRequired

Returns

PromisePromise<Data>Required
This will be

Deprecated

in the near future use PaymentProcessor.retrievePayment instead

updatePaymentData

This will be

Parameters

paymentSessionDataDataRequired
dataDataRequired

Returns

PromisePromise<Data>Required
This will be

Deprecated

in the near future use PaymentProcessor.updatePayment instead

createPayment

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

This will be

Parameters

contextCart & PaymentContextRequired
The type of this argument is meant to be temporary and once the previous method signature will be removed, the type will only be PaymentContext instead of Cart & PaymentContext

Returns

PromisePromise<PaymentSessionResponse>Required
This will be

Deprecated

in the near future use PaymentProcessor.initiatePayment instead

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

This will be

Parameters

cartCartRequired

Returns

PromisePromise<Data>Required
This will be

Deprecated

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

retrievePayment

This will be

Parameters

paymentDataDataRequired

Returns

PromisePromise<Data>Required
This will be

Deprecated

in the near future use PaymentProcessor.retrievePayment instead

updatePayment

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

Parameters

paymentSessionDataDataRequired
contextCart & PaymentContextRequired

Returns

PromisePromise<PaymentSessionResponse | Data>Required

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

This will be

Parameters

paymentSessionDataDataRequired
cartCartRequired

Returns

PromisePromise<Data>Required
This will be

Deprecated

in the near future use PaymentProcessor.updatePayment instead

authorizePayment

This will be

Parameters

paymentSessionPaymentSessionRequired
contextDataRequired

Returns

PromisePromise<object>Required
This will be

Deprecated

in the near future use PaymentProcessor.authorizePayment instead

capturePayment

This will be

Parameters

paymentPaymentRequired

Returns

PromisePromise<Data>Required
This will be

Deprecated

in the near future use PaymentProcessor.capturePayment instead

refundPayment

This will be

Parameters

paymentPaymentRequired
refundAmountnumberRequired

Returns

PromisePromise<Data>Required
This will be

Deprecated

in the near future use PaymentProcessor.refundPayment instead

cancelPayment

This will be

Parameters

paymentPaymentRequired

Returns

PromisePromise<Data>Required
This will be

Deprecated

in the near future use PaymentProcessor.cancelPayment instead

deletePayment

This will be

Parameters

paymentSessionPaymentSessionRequired

Returns

PromisePromise<void>Required
This will be

Deprecated

in the near future use PaymentProcessor.cancelPayment instead

retrieveSavedMethods

This will be

Parameters

customerCustomerRequired

Returns

PromisePromise<Data[]>Required
This will be

Deprecated

in the near future use PaymentProcessor.getSavedMethods instead

getStatus

This will be

Parameters

dataDataRequired

Returns

PromisePromise<PaymentSessionStatus>Required
This will be

Deprecated

in the near future use PaymentProcessor.getPaymentStatus instead

withTransaction

Parameters

transactionManagerEntityManager

Returns

thisthisRequired

shouldRetryTransaction_

Parameters

errRecord<string, unknown> | objectRequired

Returns

booleanbooleanRequired

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

TResultobjectRequired
TErrorobjectRequired

Parameters

work(transactionManager: EntityManager) => Promise<TResult>Required
the transactional work to be done
isolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>
the isolation level to be used for the work.
maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>
Potential error handler

Returns

PromisePromise<TResult>Required
the result of the transactional work
Was this section helpful?