PaymentService
This will be
Deprecated
in the near future use the new PaymentProcessor interface instead
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
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
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
Promise<TResult>Requiredthe result of the transactional work
Promise
Promise<TResult>RequiredauthorizePayment
This will be
Parameters
Returns
Promise
Promise<object>Required
Promise
Promise<object>RequiredDeprecated
in the near future use PaymentProcessor.authorizePayment instead
cancelPayment
This will be
Parameters
Returns
Deprecated
in the near future use PaymentProcessor.cancelPayment instead
capturePayment
This will be
Parameters
Returns
Deprecated
in the near future use PaymentProcessor.capturePayment instead
createPayment
**createPayment**(context): Promise<[PaymentSessionResponse](/references/medusa/types/medusa.PaymentSessionResponse)>
This will be
Parameters
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
Deprecated
in the near future use PaymentProcessor.initiatePayment instead
**createPayment**(cart): Promise<[Data](/references/medusa/types/medusa.Data)>
This will be
Parameters
Returns
Deprecated
in the near future use createPayment(context: Cart & PaymentContext): Promise<PaymentSessionResponse>
instead
deletePayment
This will be
Parameters
Returns
Promise
Promise<void>RequiredDeprecated
in the near future use PaymentProcessor.cancelPayment instead
getIdentifier
Returns
string
stringgetPaymentData
This will be
Parameters
Returns
Deprecated
in the near future use PaymentProcessor.retrievePayment instead
getStatus
This will be
Parameters
Returns
Deprecated
in the near future use PaymentProcessor.getPaymentStatus instead
refundPayment
This will be
Parameters
refundAmount
numberRequiredReturns
Deprecated
in the near future use PaymentProcessor.refundPayment instead
retrievePayment
This will be
Parameters
Returns
Deprecated
in the near future use PaymentProcessor.retrievePayment instead
retrieveSavedMethods
This will be
Parameters
Returns
Deprecated
in the near future use PaymentProcessor.getSavedMethods instead
shouldRetryTransaction_
Parameters
err
Record<string, unknown> | objectRequiredReturns
boolean
booleanupdatePayment
**updatePayment**(paymentSessionData, context): Promise<[PaymentSessionResponse](/references/medusa/types/medusa.PaymentSessionResponse) \| [Data](/references/medusa/types/medusa.Data)>
Parameters
Returns
**updatePayment**(paymentSessionData, cart): Promise<[Data](/references/medusa/types/medusa.Data)>
This will be
Parameters
Returns
Deprecated
in the near future use PaymentProcessor.updatePayment instead
updatePaymentData
This will be
Parameters
Returns
Deprecated
in the near future use PaymentProcessor.updatePayment instead
withTransaction
Parameters
transactionManager
EntityManagerReturns
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredactiveManager_
objectRequiredatomicPhase_
<TResult, TError>(work: (transactionManager: EntityManager) => Promise<TResult>, isolationOrErrorHandler?: IsolationLevel | (error: TError) => Promise<void | TResult>, maybeErrorHandlerOrDontFail?: (error: TError) => Promise<void | TResult>) => Promise<TResult>RequiredauthorizePayment
(paymentSession: PaymentSession, context: Data) => Promise<{ data: Data ; status: PaymentSessionStatus }>RequiredcreatePayment
(context: Cart & PaymentContext) => Promise<PaymentSessionResponse>(cart: Cart) => Promise<Data>RequiredgetIdentifier
() => stringRequiredshouldRetryTransaction_
(err: Record<string, unknown> | { code: string }) => booleanRequiredupdatePayment
(paymentSessionData: Data, context: Cart & PaymentContext) => Promise<PaymentSessionResponse | Data>(paymentSessionData: Data, cart: Cart) => Promise<Data>Required