AbstractPaymentService
This will be
Deprecated
in the near future use the AbstractPaymentProcessor instead
constructor
Parameters
containerunknownRequiredconfigRecord<string, unknown>Properties
_isPaymentServicebooleanRequiredDefault: true
identifierstringRequiredmanager_EntityManagerRequiredtransactionManager_undefined | EntityManagerRequired__container__anyRequired__configModule__Record<string, unknown>__moduleDeclaration__Record<string, unknown>Accessors
activeManager_
Returns
EntityManagerEntityManagerRequiredMethods
getIdentifier
Returns
stringstringRequiredgetPaymentData
Parameters
A Payment Session is created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, which is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for payment processing such as capture or refund. Payment sessions can also be used as part of payment collections.
Returns
Deprecated
updatePaymentData
Parameters
Returns
Deprecated
createPayment
Abstract **createPayment**(context): Promise<[PaymentSessionResponse](/references/medusa/types/medusa.PaymentSessionResponse)>
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
Abstract **createPayment**(cart): Promise<[Data](/references/medusa/types/medusa.Data)>
This will be
Parameters
Returns
This will be
Deprecated
in the near future use createPayment(context: Cart & PaymentContext): Promise<PaymentSessionResponse> instead
retrievePayment
Parameters
Returns
Deprecated
updatePayment
Abstract **updatePayment**(paymentSessionData, context): Promise<Record<string, unknown> \| [PaymentSessionResponse](/references/medusa/types/medusa.PaymentSessionResponse)>
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
it return either a PaymentSessionResponse or PaymentSessionResponse["session_data"] to maintain backward compatibility
Abstract **updatePayment**(paymentSessionData, cart): Promise<[Data](/references/medusa/types/medusa.Data)>
This will be
Parameters
Returns
This will be
Deprecated
in the near future use updatePayment(paymentSessionData: PaymentSessionData, context: Cart & PaymentContext): Promise<PaymentSessionResponse> instead
authorizePayment
Parameters
A Payment Session is created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, which is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for payment processing such as capture or refund. Payment sessions can also be used as part of payment collections.
Returns
PromisePromise<object>Required
PromisePromise<object>RequiredDeprecated
capturePayment
This will be
Parameters
A payment is originally created from a payment session. Once a payment session is authorized, the payment is created to represent the authorized amount with a given payment method. Payments can be captured, canceled or refunded. Payments can be made towards orders, swaps, order edits, or other resources.
Returns
This will be
Deprecated
in the near future
refundPayment
This will be
Parameters
A payment is originally created from a payment session. Once a payment session is authorized, the payment is created to represent the authorized amount with a given payment method. Payments can be captured, canceled or refunded. Payments can be made towards orders, swaps, order edits, or other resources.
refundAmountnumberRequiredReturns
This will be
Deprecated
in the near future
cancelPayment
This will be
Parameters
A payment is originally created from a payment session. Once a payment session is authorized, the payment is created to represent the authorized amount with a given payment method. Payments can be captured, canceled or refunded. Payments can be made towards orders, swaps, order edits, or other resources.
Returns
This will be
Deprecated
in the near future
deletePayment
This will be
Parameters
A Payment Session is created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, which is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for payment processing such as capture or refund. Payment sessions can also be used as part of payment collections.
Returns
PromisePromise<void>RequiredDeprecated
in the near future
retrieveSavedMethods
This will be
Parameters
A customer can make purchases in your store and manage their profile.
Returns
This will be
Deprecated
in the near future
getStatus
This will be
Parameters
Returns
This will be
Deprecated
in the near future
withTransaction
Parameters
transactionManagerEntityManagerReturns
thisthisRequiredshouldRetryTransaction_
Parameters
errRecord<string, unknown> | objectRequiredReturns
booleanbooleanRequiredatomicPhase_
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
TResultobjectRequiredTErrorobjectRequiredParameters
work(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>Returns
PromisePromise<TResult>Requiredthe result of the transactional work
PromisePromise<TResult>Required