PaymentCollectionService
Constructors
constructor
**new PaymentCollectionService**(«destructured»)
Parameters
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredpaymentCollectionRepository_
Repository<PaymentCollection> & { getPaymentCollectionIdByPaymentId: Method getPaymentCollectionIdByPaymentId ; getPaymentCollectionIdBySessionId: Method getPaymentCollectionIdBySessionId }RequiredtransactionManager_
undefined | EntityManagerRequiredEvents
objectRequiredEvents.CREATED
stringRequiredDefault: "payment-collection.created"
Events.DELETED
stringRequiredDefault: "payment-collection.deleted"
Events.PAYMENT_AUTHORIZED
stringRequiredDefault: "payment-collection.payment_authorized"
Events.UPDATED
stringRequiredDefault: "payment-collection.updated"
Accessors
activeManager_
Protected get**activeManager_**(): EntityManager
Returns
EntityManager
EntityManager
EntityManagerRequiredMethods
atomicPhase_
Protected **atomicPhase_**<TypeParameter TResult, TypeParameter 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.
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise<TResult>
Promise
Promise<TResult>RequiredauthorizePaymentSessions
**authorizePaymentSessions**(paymentCollectionId, sessionIds, context?): Promise<[PaymentCollection](/references/services/classes/PaymentCollection)>
Authorizes the payment sessions of a payment collection.
Parameters
paymentCollectionId
stringRequiredsessionIds
string[]Requiredcontext
Record<string, unknown>RequiredDefault: {}
Returns
Promise<PaymentCollection>
create
**create**(data): Promise<[PaymentCollection](/references/services/classes/PaymentCollection)>
Creates a new payment collection.
Parameters
Returns
Promise<PaymentCollection>
delete
**delete**(paymentCollectionId): Promise<undefined \| [PaymentCollection](/references/services/classes/PaymentCollection)>
Deletes a payment collection.
Parameters
paymentCollectionId
stringRequiredReturns
Promise<undefined | PaymentCollection>
isValidTotalAmount
Private **isValidTotalAmount**(total, sessionsInput): boolean
Parameters
total
numberRequiredReturns
boolean
boolean
booleanmarkAsAuthorized
**markAsAuthorized**(paymentCollectionId): Promise<[PaymentCollection](/references/services/classes/PaymentCollection)>
Marks a payment collection as authorized bypassing the payment flow.
Parameters
paymentCollectionId
stringRequiredReturns
Promise<PaymentCollection>
refreshPaymentSession
**refreshPaymentSession**(paymentCollectionId, sessionId, customerId): Promise<[PaymentSession](/references/services/classes/PaymentSession)>
Removes and recreate a payment session of a payment collection.
Parameters
paymentCollectionId
stringRequiredsessionId
stringRequiredcustomerId
stringRequiredReturns
Promise<PaymentSession>
retrieve
**retrieve**(paymentCollectionId, config?): Promise<[PaymentCollection](/references/services/classes/PaymentCollection)>
Retrieves a payment collection by id.
Parameters
paymentCollectionId
stringRequiredDefault: {}
Returns
Promise<PaymentCollection>
setPaymentSession
**setPaymentSession**(paymentCollectionId, sessionInput, customerId): Promise<[PaymentCollection](/references/services/classes/PaymentCollection)>
Manages a single payment sessions of a payment collection.
Parameters
paymentCollectionId
stringRequiredcustomerId
stringRequiredReturns
Promise<PaymentCollection>
setPaymentSessionsBatch
**setPaymentSessionsBatch**(paymentCollectionOrId, sessionsInput, customerId): Promise<[PaymentCollection](/references/services/classes/PaymentCollection)>
Manages multiple payment sessions of a payment collection.
Parameters
customerId
stringRequiredReturns
Promise<PaymentCollection>
shouldRetryTransaction_
Protected **shouldRetryTransaction_**(err): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanupdate
**update**(paymentCollectionId, data): Promise<[PaymentCollection](/references/services/classes/PaymentCollection)>
Updates a payment collection.
Parameters
paymentCollectionId
stringRequiredReturns
Promise<PaymentCollection>
withTransaction
**withTransaction**(transactionManager?): [PaymentCollectionService](/references/services/classes/PaymentCollectionService)
Parameters
transactionManager
EntityManager