FulfillmentProviderService
internal.internal.FulfillmentProviderService
Helps retrieve fulfillment providers
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
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_
calculatePrice
calculatePrice(option
, data
, cart?
): Promise
<number
>
Parameters
Returns
Promise
<number
>
Promise
Promise<number>Required
Promise
Promise<number>RequiredcanCalculate
canCalculate(option
): Promise
<boolean
>
Parameters
Returns
Promise
<boolean
>
Promise
Promise<boolean>Required
Promise
Promise<boolean>RequiredcancelFulfillment
cancelFulfillment(fulfillment
): Promise
<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>>Required
Promise
Promise<Record<string, unknown>>RequiredcreateReturn
createReturn(returnOrder
): Promise
<Record<string
, unknown
>>
Parameters
Returns
Promise
<Record<string
, unknown
>>
Promise
Promise<Record<string, unknown>>Required
Promise
Promise<Record<string, unknown>>Requiredlist
list(): Promise
<FulfillmentProvider
[]>
Returns
Promise
<FulfillmentProvider
[]>
listFulfillmentOptions
listFulfillmentOptions(providerIds
): Promise
<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>Requireddocument to fetch
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
booleanInherited from
TransactionBaseService.shouldRetryTransaction_
validateFulfillmentData
validateFulfillmentData(option
, data
, cart
): Promise
<Record<string
, unknown
>>
Parameters
data
Record<string, unknown>RequiredReturns
Promise
<Record<string
, unknown
>>
Promise
Promise<Record<string, unknown>>Required
Promise
Promise<Record<string, unknown>>RequiredvalidateOption
validateOption(option
): Promise
<boolean
>
Parameters
Returns
Promise
<boolean
>
Promise
Promise<boolean>Required
Promise
Promise<boolean>RequiredwithTransaction
withTransaction(transactionManager?
): FulfillmentProviderService
Parameters
transactionManager
EntityManager