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_<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.
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
>
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
>
Creates a new payment collection.
Parameters
Returns
Promise
<PaymentCollection
>
delete
delete(paymentCollectionId
): Promise
<undefined
| 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
>
Marks a payment collection as authorized bypassing the payment flow.
Parameters
paymentCollectionId
stringRequiredReturns
Promise
<PaymentCollection
>
refreshPaymentSession
refreshPaymentSession(paymentCollectionId
, sessionId
, customerId
): Promise
<PaymentSession
>
Removes and recreate a payment session of a payment collection.
Parameters
paymentCollectionId
stringRequiredsessionId
stringRequiredcustomerId
stringRequiredReturns
Promise
<PaymentSession
>
retrieve
retrieve(paymentCollectionId
, config?
): Promise
<PaymentCollection
>
Retrieves a payment collection by id.
Parameters
paymentCollectionId
stringRequiredDefault: {}
Returns
Promise
<PaymentCollection
>
setPaymentSession
setPaymentSession(paymentCollectionId
, sessionInput
, customerId
): Promise
<PaymentCollection
>
Manages a single payment sessions of a payment collection.
Parameters
paymentCollectionId
stringRequiredcustomerId
stringRequiredReturns
Promise
<PaymentCollection
>
setPaymentSessionsBatch
setPaymentSessionsBatch(paymentCollectionOrId
, sessionsInput
, customerId
): Promise
<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
>
Updates a payment collection.
Parameters
paymentCollectionId
stringRequiredReturns
Promise
<PaymentCollection
>
withTransaction
withTransaction(transactionManager?
): PaymentCollectionService
Parameters
transactionManager
EntityManager