Skip to main content
Skip to main content

PaymentService

internal.internal.PaymentService

This will be

Deprecated

in the near future use the new PaymentProcessor interface instead

Implemented by

Properties

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

Accessors

activeManager_

Protected get activeManager_(): EntityManager

Returns

EntityManager

EntityManagerEntityManagerRequired

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

Inherited from

TransactionBaseService.atomicPhase_


authorizePayment

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

This will be

Parameters

paymentSessionPaymentSessionRequired
contextDataRequired

Returns

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

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

Deprecated

in the near future use PaymentProcessor.authorizePayment instead


cancelPayment

cancelPayment(payment): Promise<Data>

This will be

Parameters

paymentPaymentRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future use PaymentProcessor.cancelPayment instead


capturePayment

capturePayment(payment): Promise<Data>

This will be

Parameters

paymentPaymentRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future use PaymentProcessor.capturePayment instead


createPayment

createPayment(context): Promise<PaymentSessionResponse>

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

Promise<PaymentSessionResponse>

PromisePromise<PaymentSessionResponse>Required

Deprecated

in the near future use PaymentProcessor.initiatePayment instead

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


deletePayment

deletePayment(paymentSession): Promise<void>

This will be

Parameters

paymentSessionPaymentSessionRequired

Returns

Promise<void>

PromisePromise<void>Required

Deprecated

in the near future use PaymentProcessor.cancelPayment instead


getIdentifier

getIdentifier(): string

Returns

string

stringstring

getPaymentData

getPaymentData(paymentSession): Promise<Data>

This will be

Parameters

paymentSessionPaymentSessionRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future use PaymentProcessor.retrievePayment instead


getStatus

getStatus(data): Promise<PaymentSessionStatus>

This will be

Parameters

dataDataRequired

Returns

Promise<PaymentSessionStatus>

PromisePromise<PaymentSessionStatus>Required

Deprecated

in the near future use PaymentProcessor.getPaymentStatus instead


refundPayment

refundPayment(payment, refundAmount): Promise<Data>

This will be

Parameters

paymentPaymentRequired
refundAmountnumberRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future use PaymentProcessor.refundPayment instead


retrievePayment

retrievePayment(paymentData): Promise<Data>

This will be

Parameters

paymentDataDataRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future use PaymentProcessor.retrievePayment instead


retrieveSavedMethods

retrieveSavedMethods(customer): Promise<Data[]>

This will be

Parameters

customerCustomerRequired

Returns

Promise<Data[]>

PromisePromise<Data[]>Required

Deprecated

in the near future use PaymentProcessor.getSavedMethods instead


shouldRetryTransaction_

Protected shouldRetryTransaction_(err): boolean

Parameters

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

Returns

boolean

booleanboolean

Inherited from

TransactionBaseService.shouldRetryTransaction_


updatePayment

updatePayment(paymentSessionData, context): Promise<Data | PaymentSessionResponse>

Parameters

paymentSessionDataDataRequired
contextCart & PaymentContextRequired

Returns

Promise<Data | PaymentSessionResponse>

PromisePromise<Data | PaymentSessionResponse>Required

updatePayment(paymentSessionData, cart): Promise<Data>

This will be

Parameters

paymentSessionDataDataRequired
cartCartRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future use PaymentProcessor.updatePayment instead


updatePaymentData

updatePaymentData(paymentSessionData, data): Promise<Data>

This will be

Parameters

paymentSessionDataDataRequired
dataDataRequired

Returns

Promise<Data>

PromisePromise<Data>Required

Deprecated

in the near future use PaymentProcessor.updatePayment instead


withTransaction

withTransaction(transactionManager?): PaymentService

Parameters

transactionManagerEntityManager

Returns

PaymentService

PaymentServicePaymentServiceRequired

Inherited from

TransactionBaseService.withTransaction

Was this section helpful?