Skip to main content
Skip to main content

AbstractPaymentService

internal.internal.AbstractPaymentService

This will be

Deprecated

in the near future use the AbstractPaymentProcessor instead

Implements

Properties

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

Accessors

activeManager_

Protected get activeManager_(): EntityManager

Returns

EntityManager

EntityManagerEntityManagerRequired

Implementation of

PaymentService.activeManager_

Inherited from

TransactionBaseService.activeManager_

Methods

atomicPhase_

Protected atomicPhase_<TResult, TError>(work, isolationOrErrorHandler?, maybeErrorHandlerOrDontFail?): Promise<TResult>

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.

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

Promise<TResult>

PromisePromise<TResult>Required
the result of the transactional work

Implementation of

PaymentService.atomicPhase_

Inherited from

TransactionBaseService.atomicPhase_


authorizePayment

Abstract authorizePayment(paymentSession, context): Promise<{ data: Data ; status: PaymentSessionStatus }>

Parameters

paymentSessionPaymentSessionRequired
contextDataRequired

Returns

Promise<{ data: Data ; status: PaymentSessionStatus }>

PromisePromise<{ data: Data ; status: PaymentSessionStatus }>Required

Deprecated

Implementation of

PaymentService.authorizePayment


cancelPayment

Abstract cancelPayment(payment): Promise<Data>

This will be

Parameters

paymentPaymentRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future

Implementation of

PaymentService.cancelPayment


capturePayment

Abstract capturePayment(payment): Promise<Data>

This will be

Parameters

paymentPaymentRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future

Implementation of

PaymentService.capturePayment


createPayment

Abstract createPayment(context): Promise<PaymentSessionResponse>

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

Promise<PaymentSessionResponse>

PromisePromise<PaymentSessionResponse>Required

Implementation of

PaymentService.createPayment

Abstract createPayment(cart): Promise<Data>

This will be

Parameters

cartCartRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

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

Implementation of

PaymentService.createPayment


deletePayment

Abstract deletePayment(paymentSession): Promise<void>

This will be

Parameters

paymentSessionPaymentSessionRequired

Returns

Promise<void>

PromisePromise<void>Required

Deprecated

in the near future

Implementation of

PaymentService.deletePayment


getIdentifier

getIdentifier(): string

Returns

string

stringstring

Implementation of

PaymentService.getIdentifier


getPaymentData

Abstract getPaymentData(paymentSession): Promise<Data>

Parameters

paymentSessionPaymentSessionRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

Implementation of

PaymentService.getPaymentData


getStatus

Abstract getStatus(data): Promise<PaymentSessionStatus>

This will be

Parameters

dataDataRequired

Returns

Promise<PaymentSessionStatus>

PromisePromise<PaymentSessionStatus>Required

Deprecated

in the near future

Implementation of

PaymentService.getStatus


refundPayment

Abstract refundPayment(payment, refundAmount): Promise<Data>

This will be

Parameters

paymentPaymentRequired
refundAmountnumberRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future

Implementation of

PaymentService.refundPayment


retrievePayment

Abstract retrievePayment(paymentData): Promise<Data>

Parameters

paymentDataDataRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

Implementation of

PaymentService.retrievePayment


retrieveSavedMethods

retrieveSavedMethods(customer): Promise<Data[]>

This will be

Parameters

customerCustomerRequired

Returns

Promise<Data[]>

PromisePromise<Data[]>Required

Deprecated

in the near future

Implementation of

PaymentService.retrieveSavedMethods


shouldRetryTransaction_

Protected shouldRetryTransaction_(err): boolean

Parameters

errRecord<string, unknown> | { code: string }Required

Returns

boolean

booleanboolean

Implementation of

PaymentService.shouldRetryTransaction_

Inherited from

TransactionBaseService.shouldRetryTransaction_


updatePayment

Abstract updatePayment(paymentSessionData, context): Promise<Record<string, unknown> | PaymentSessionResponse>

Parameters

paymentSessionDataDataRequired
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

Promise<Record<string, unknown> | PaymentSessionResponse>

PromisePromise<Record<string, unknown> | PaymentSessionResponse>Required
it return either a PaymentSessionResponse or PaymentSessionResponse["session_data"] to maintain backward compatibility

Implementation of

PaymentService.updatePayment

Abstract updatePayment(paymentSessionData, cart): Promise<Data>

This will be

Parameters

paymentSessionDataDataRequired
cartCartRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future use updatePayment(paymentSessionData: PaymentSessionData, context: Cart & PaymentContext): Promise<PaymentSessionResponse> instead

Implementation of

PaymentService.updatePayment


updatePaymentData

Abstract updatePaymentData(paymentSessionData, data): Promise<Data>

Parameters

paymentSessionDataDataRequired
dataDataRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

Implementation of

PaymentService.updatePaymentData


withTransaction

withTransaction(transactionManager?): AbstractPaymentService

Parameters

transactionManagerEntityManager

Returns

AbstractPaymentService

AbstractPaymentServiceAbstractPaymentServiceRequired

Implementation of

PaymentService.withTransaction

Inherited from

TransactionBaseService.withTransaction

Was this section helpful?