PaymentProviderService
Helps retrieve payment providers
constructor
Parameters
container
InjectedDependenciesRequiredProperties
manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequired__container__
anyRequiredcontainer_
InjectedDependenciesRequiredfeatureFlagRouter_
FlagRouterRequired__configModule__
Record<string, unknown>__moduleDeclaration__
Record<string, unknown>Accessors
activeManager_
Returns
EntityManager
EntityManagerRequiredpaymentService_
Returns
PaymentService
objectRequiredMethods
withTransaction
Parameters
transactionManager
EntityManagerReturns
this
thisRequiredshouldRetryTransaction_
Parameters
err
Record<string, unknown> | objectRequiredReturns
boolean
booleanRequiredatomicPhase_
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.
Type Parameters
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
Promise<TResult>RequiredregisterInstalledProviders
Parameters
providerIds
string[]RequiredReturns
Promise
Promise<void>Requiredlist
Returns
retrievePayment
Retrieve a payment entity with the given id.
Parameters
paymentId
stringRequiredrelations
string[]RequiredDefault: []
Returns
listPayments
List all the payments according to the given selector and config.
Parameters
Returns
retrieveSession
Return the payment session for the given id.
Parameters
paymentSessionId
stringRequiredrelations
string[]RequiredDefault: []
Returns
createSession
**createSession**(providerId, cart): Promise<[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)>
Parameters
providerId
stringRequiredReturns
Deprecated
**createSession**(sessionInput): Promise<[PaymentSession](../../entities/classes/entities.PaymentSession.mdx)>
Creates a payment session with the given provider.
Parameters
sessionInput
PaymentSessionInputRequiredReturns
refreshSession
Refreshes a payment session with the given provider. This means, that we delete the current one and create a new.
Parameters
paymentSession
objectRequiredpaymentSession.id
stringRequiredpaymentSession.data
Record<string, unknown>RequiredpaymentSession.provider_id
stringRequiredsessionInput
PaymentSessionInputRequiredReturns
updateSession
Update a payment session with the given provider.
Parameters
paymentSession
objectRequiredpaymentSession.id
stringRequiredpaymentSession.data
Record<string, unknown>RequiredpaymentSession.provider_id
stringRequiredReturns
deleteSession
Parameters
Returns
retrieveProvider
Finds a provider given an id
Type Parameters
TProvider
unknownRequiredParameters
providerId
stringRequiredReturns
TProvider extends AbstractPaymentService ? AbstractPaymentService : TProvider extends AbstractPaymentProcessor ? AbstractPaymentProcessor : any
TProvider extends AbstractPaymentService ? AbstractPaymentService : TProvider extends AbstractPaymentProcessor ? AbstractPaymentProcessor : anyRequired