PaymentService
admin/discounts.internal.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_
Protected
get
activeManager_(): EntityManager
Returns
EntityManager
EntityManager
EntityManagerRequiredInherited 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.
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>RequiredInherited from
TransactionBaseService.atomicPhase_
capture
capture(paymentOrId
): Promise
<Payment
>
Captures a payment.
Parameters
Returns
Promise
<Payment
>
the payment captured.
create
create(paymentInput
): Promise
<Payment
>
Created a new payment.
Parameters
Returns
Promise
<Payment
>
the payment created.
refund
refund(paymentOrId
, amount
, reason
, note?
): Promise
<Refund
>
refunds a payment.
Parameters
amount
numberRequiredreason
stringRequirednote
stringReturns
Promise
<Refund
>
the refund created.
retrieve
retrieve(paymentId
, config?
): Promise
<Payment
>
Retrieves a payment by id.
Parameters
paymentId
stringRequiredconfig
FindConfig<Payment>Returns
Promise
<Payment
>
the payment.
shouldRetryTransaction_
Protected
shouldRetryTransaction_(err
): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanInherited from
TransactionBaseService.shouldRetryTransaction_
update
update(paymentId
, data
): Promise
<Payment
>
Updates a payment in order to link it to an order or a swap.
Parameters
paymentId
stringRequireddata
objectRequireddata.order_id
stringdata.swap_id
stringReturns
Promise
<Payment
>
the payment updated.
withTransaction
withTransaction(transactionManager?
): PaymentService
Parameters
transactionManager
EntityManager