PaymentService
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredEvents
objectRequiredEvents.CREATED
stringRequiredEvents.PAYMENT_CAPTURED
stringRequiredEvents.PAYMENT_CAPTURE_FAILED
stringRequiredEvents.REFUND_CREATED
stringRequiredEvents.REFUND_FAILED
stringRequiredEvents.UPDATED
stringRequiredAccessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
atomicPhase_
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.
Parameters
work
(transactionManager: EntityManager) => Promise<TResult>Requiredthe transactional work to be done
isolationOrErrorHandler
IsolationLevel | (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
Promise<TResult>Requiredthe result of the transactional work
capture
Captures a payment.
Parameters
the id or the class instance of the payment
Returns
the payment captured.
create
Created a new payment.
Parameters
info to create the payment
Returns
the payment created.
refund
refunds a payment.
Parameters
the id or the class instance of the payment
amount
numberRequiredthe amount to be refunded from the payment
reason
stringRequiredthe refund reason
note
stringadditional note of the refund
Returns
the refund created.
retrieve
Retrieves a payment by id.
Parameters
paymentId
stringRequiredthe id of the payment
config
FindConfig<Payment>the config to retrieve the payment
Returns
the payment.
shouldRetryTransaction_
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
booleanupdate
Updates a payment in order to link it to an order or a swap.
Parameters
paymentId
stringRequiredthe id of the payment
data
objectRequiredorder_id or swap_id to link the payment
data.order_id
stringdata.swap_id
stringReturns
the payment updated.
withTransaction
Parameters
transactionManager
EntityManagerReturns
Was this section helpful?