Skip to main content
Skip to main content

FulfillmentProviderService

Helps retrieve fulfillment providers

constructor

Parameters

containerFulfillmentProviderContainerRequired

Properties

manager_EntityManagerRequired
transactionManager_undefined | EntityManagerRequired
__container__anyRequired
container_FulfillmentProviderContainerRequired
fulfillmentProviderRepository_Repository<FulfillmentProvider>Required
__configModule__Record<string, unknown>
__moduleDeclaration__Record<string, unknown>

Accessors

activeManager_

Returns

EntityManagerEntityManagerRequired

Methods

withTransaction

Parameters

transactionManagerEntityManager

Returns

thisthisRequired

shouldRetryTransaction_

Parameters

errRecord<string, unknown> | objectRequired

Returns

booleanbooleanRequired

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.

Type Parameters

TResultobjectRequired
TErrorobjectRequired

Parameters

work(transactionManager: EntityManager) => Promise<TResult>Required
the transactional work to be done
isolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>
the isolation level to be used for the work.
maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>
Potential error handler

Returns

PromisePromise<TResult>Required
the result of the transactional work

registerInstalledProviders

Parameters

providersstring[]Required

Returns

PromisePromise<void>Required

list

Returns

PromisePromise<FulfillmentProvider[]>Required

listFulfillmentOptions

Parameters

providerIdsstring[]Required

Returns

PromisePromise<FulfillmentOptions[]>Required

retrieveProvider

Parameters

providerIdstringRequired
the provider id

Returns

anyanyRequired
the payment fulfillment provider

createFulfillment

Parameters

methodShippingMethodRequired
itemsLineItem[]Required
orderCreateFulfillmentOrderRequired
fulfillmentOmit<Fulfillment, "beforeInsert">Required

Returns

PromisePromise<Record<string, unknown>>Required

canCalculate

Parameters

optionCalculateOptionPriceInputRequired

Returns

PromisePromise<boolean>Required

validateFulfillmentData

Parameters

optionShippingOptionRequired
dataRecord<string, unknown>Required
cartRecord<string, unknown> | CartRequired

Returns

PromisePromise<Record<string, unknown>>Required

cancelFulfillment

Parameters

fulfillmentFulfillmentRequired

Returns

PromisePromise<Fulfillment>Required

calculatePrice

Parameters

optionShippingOptionRequired
dataRecord<string, unknown>Required
cartOrder | Cart

Returns

PromisePromise<number>Required

validateOption

Parameters

optionShippingOptionRequired

Returns

PromisePromise<boolean>Required

createReturn

Parameters

returnOrderCreateReturnTypeRequired

Returns

PromisePromise<Record<string, unknown>>Required

retrieveDocuments

Fetches documents from the fulfillment provider

Parameters

providerIdstringRequired
the id of the provider
fulfillmentDataRecord<string, unknown>Required
the data relating to the fulfillment
documentType"label" | "invoice"Required
the typ of

Returns

PromisePromise<any>Required
document to fetch
Was this section helpful?