PaymentCollectionService
internal.internal.PaymentCollectionService
Properties
__configModule__Record<string, unknown>__container__anyRequired__moduleDeclaration__Record<string, unknown>isValidTotalAmountanyRequiredmanager_EntityManagerRequiredpaymentCollectionRepository_Repository<PaymentCollection> & { getPaymentCollectionIdByPaymentId: Method getPaymentCollectionIdByPaymentId ; getPaymentCollectionIdBySessionId: Method getPaymentCollectionIdBySessionId }RequiredtransactionManager_undefined | EntityManagerRequiredEventsobjectRequiredEvents.CREATEDstringRequiredEvents.DELETEDstringRequiredEvents.PAYMENT_AUTHORIZEDstringRequiredEvents.UPDATEDstringRequiredAccessors
activeManager_
Protected get activeManager_(): EntityManager
Returns
EntityManager
EntityManagerEntityManagerRequiredInherited 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.
TResultobjectRequiredTErrorobjectRequiredParameters
work(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>Returns
Promise<TResult>
PromisePromise<TResult>RequiredInherited from
TransactionBaseService.atomicPhase_
authorizePaymentSessions
authorizePaymentSessions(paymentCollectionId, sessionIds, context?): Promise<PaymentCollection>
Authorizes the payment sessions of a payment collection.
Parameters
paymentCollectionIdstringRequiredsessionIdsstring[]RequiredcontextRecord<string, unknown>Returns
Promise<PaymentCollection>
the payment collection and its payment session.
create
create(data): Promise<PaymentCollection>
Creates a new payment collection.
Parameters
Returns
Promise<PaymentCollection>
the payment collection created.
delete
delete(paymentCollectionId): Promise<undefined | PaymentCollection>
Deletes a payment collection.
Parameters
paymentCollectionIdstringRequiredReturns
Promise<undefined | PaymentCollection>
the payment collection removed.
markAsAuthorized
markAsAuthorized(paymentCollectionId): Promise<PaymentCollection>
Marks a payment collection as authorized bypassing the payment flow.
Parameters
paymentCollectionIdstringRequiredReturns
Promise<PaymentCollection>
the payment session authorized.
refreshPaymentSession
refreshPaymentSession(paymentCollectionId, sessionId, customerId): Promise<PaymentSession>
Removes and recreate a payment session of a payment collection.
Parameters
paymentCollectionIdstringRequiredsessionIdstringRequiredcustomerIdstringRequiredReturns
Promise<PaymentSession>
the new payment session created.
retrieve
retrieve(paymentCollectionId, config?): Promise<PaymentCollection>
Retrieves a payment collection by id.
Parameters
paymentCollectionIdstringRequiredconfigFindConfig<PaymentCollection>Returns
Promise<PaymentCollection>
the payment collection.
setPaymentSession
setPaymentSession(paymentCollectionId, sessionInput, customerId): Promise<PaymentCollection>
Manages a single payment sessions of a payment collection.
Parameters
paymentCollectionIdstringRequiredcustomerIdstringRequiredReturns
Promise<PaymentCollection>
the payment collection and its payment session.
setPaymentSessionsBatch
setPaymentSessionsBatch(paymentCollectionOrId, sessionsInput, customerId): Promise<PaymentCollection>
Manages multiple payment sessions of a payment collection.
Parameters
customerIdstringRequiredReturns
Promise<PaymentCollection>
the payment collection and its payment sessions.
shouldRetryTransaction_
Protected shouldRetryTransaction_(err): boolean
Parameters
errRecord<string, unknown> | { code: string }RequiredReturns
boolean
booleanbooleanInherited from
TransactionBaseService.shouldRetryTransaction_
update
update(paymentCollectionId, data): Promise<PaymentCollection>
Updates a payment collection.
Parameters
paymentCollectionIdstringRequiredReturns
Promise<PaymentCollection>
the payment collection updated.
withTransaction
withTransaction(transactionManager?): PaymentCollectionService
Parameters
transactionManagerEntityManager