FulfillmentProviderService
Helps retrieve fulfillment providers
Constructors
constructor
**new FulfillmentProviderService**(container)
Parameters
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
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>RequiredcalculatePrice
**calculatePrice**(option, data, cart?): Promise<number>
Parameters
data
Record<string, unknown>RequiredReturns
Promise<number>
Promise
Promise<number>RequiredcanCalculate
**canCalculate**(option): Promise<boolean>
Parameters
Returns
Promise<boolean>
Promise
Promise<boolean>RequiredcancelFulfillment
**cancelFulfillment**(fulfillment): Promise<[Fulfillment](/references/services/classes/Fulfillment)>
Parameters
Returns
Promise<Fulfillment>
createFulfillment
**createFulfillment**(method, items, order, fulfillment): Promise<Record<string, unknown>>
Parameters
Returns
Promise<Record<string, unknown>>
Promise
Promise<Record<string, unknown>>RequiredcreateReturn
**createReturn**(returnOrder): Promise<Record<string, unknown>>
Parameters
Returns
Promise<Record<string, unknown>>
Promise
Promise<Record<string, unknown>>Requiredlist
**list**(): Promise<[FulfillmentProvider](/references/services/classes/FulfillmentProvider)[]>
Returns
Promise<FulfillmentProvider[]>
listFulfillmentOptions
**listFulfillmentOptions**(providerIds): Promise<[FulfillmentOptions](/references/services/types/FulfillmentOptions)[]>
Parameters
providerIds
string[]RequiredReturns
Promise<FulfillmentOptions[]>
registerInstalledProviders
**registerInstalledProviders**(providers): Promise<void>
Parameters
providers
string[]RequiredReturns
Promise<void>
Promise
Promise<void>RequiredretrieveDocuments
**retrieveDocuments**(providerId, fulfillmentData, documentType): Promise<any>
Fetches documents from the fulfillment provider
Parameters
providerId
stringRequiredfulfillmentData
Record<string, unknown>RequireddocumentType
"label" | "invoice"RequiredReturns
Promise<any>
Promise
Promise<any>RequiredretrieveProvider
**retrieveProvider**(providerId): any
Parameters
providerId
stringRequiredReturns
any
any
anyshouldRetryTransaction_
Protected **shouldRetryTransaction_**(err): boolean
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
boolean
booleanvalidateFulfillmentData
**validateFulfillmentData**(option, data, cart): Promise<Record<string, unknown>>
Parameters
data
Record<string, unknown>RequiredReturns
Promise<Record<string, unknown>>
Promise
Promise<Record<string, unknown>>RequiredvalidateOption
**validateOption**(option): Promise<boolean>
Parameters
Returns
Promise<boolean>
Promise
Promise<boolean>RequiredwithTransaction
**withTransaction**(transactionManager?): [FulfillmentProviderService](/references/services/classes/FulfillmentProviderService)
Parameters
transactionManager
EntityManager