Files
medusa-store/docs/content/references/services/classes/SwapService.md
Shahed Nasser e134f6d237 chore: fixed commit branch on generate reference action (#1857)
* fixed commit branch

* fixes after yarn upgrade
2022-07-15 18:08:07 +03:00

7.5 KiB

Class: SwapService

Hierarchy

  • "medusa-interfaces"

    SwapService

Constructors

constructor

new SwapService(__namedParameters)

Parameters

Name Type
__namedParameters Object

Overrides

BaseService.constructor

Defined in

services/swap.js:21

Properties

Events

Static Events: Object

Type declaration

Name Type
CREATED string
FULFILLMENT_CREATED string
PAYMENT_CAPTURED string
PAYMENT_CAPTURE_FAILED string
PAYMENT_COMPLETED string
PROCESS_REFUND_FAILED string
RECEIVED string
REFUND_PROCESSED string
SHIPMENT_CREATED string

Defined in

services/swap.js:9

Methods

cancel

cancel(swapId): Promise<Swap>

Parameters

Name Type Description
swapId string

Returns

Promise<Swap>

Defined in

services/swap.js:790


cancelFulfillment

cancelFulfillment(fulfillmentId): Swap

Parameters

Name Type Description
fulfillmentId string

Returns

Swap

Defined in

services/swap.js:983


create

create(order, returnItems, additionalItems, returnShipping, custom?): Promise<Swap>

Parameters

Name Type Description
order Order
returnItems ReturnItem[]
additionalItems undefined | PreliminaryLineItem[]
returnShipping any
custom any

Returns

Promise<Swap>

Defined in

services/swap.js:313


createCart

createCart(swapId, customShippingOptions?): Promise<Swap>

Parameters

Name Type Default value Description
swapId string undefined
customShippingOptions any[] []

Returns

Promise<Swap>

Defined in

services/swap.js:544


createFulfillment

createFulfillment(swapId, config?): Promise<Swap>

Parameters

Name Type Description
swapId string
config any

Returns

Promise<Swap>

Defined in

services/swap.js:848


createShipment

createShipment(swapId, fulfillmentId, trackingLinks, config?): Promise<Swap>

Parameters

Name Type Description
swapId string
fulfillmentId string
trackingLinks undefined | TrackingLink[]
config any

Returns

Promise<Swap>

Defined in

services/swap.js:1016


deleteMetadata

deleteMetadata(swapId, key): Promise<any>

Parameters

Name Type Description
swapId string
key string

Returns

Promise<any>

Defined in

services/swap.js:1089


list

list(selector, config?): Promise<any>

Parameters

Name Type Description
selector any
config any

Returns

Promise<any>

Defined in

services/swap.js:238


processDifference

processDifference(swapId): Promise<any>

Parameters

Name Type
swapId any

Returns

Promise<any>

Defined in

services/swap.js:395


registerCartCompletion

registerCartCompletion(swapId): Promise<any>

Parameters

Name Type Description
swapId string

Returns

Promise<any>

Defined in

services/swap.js:659


registerReceived

registerReceived(id): Promise<Order>

Parameters

Name Type Description
id string

Returns

Promise<Order>

Defined in

services/swap.js:1114


retrieve

retrieve(id, config?): Promise<Swap>

Parameters

Name Type Description
id string
config any

Returns

Promise<Swap>

Defined in

services/swap.js:181


retrieveByCartId

retrieveByCartId(cartId, relations?): Promise<Swap>

Parameters

Name Type Default value Description
cartId string undefined
relations string[] []

Returns

Promise<Swap>

Defined in

services/swap.js:216


transformQueryForCart_

transformQueryForCart_(config): any

Parameters

Name Type
config any

Returns

any

Defined in

services/swap.js:114


update

update(swapId, update): Promise<any>

Parameters

Name Type
swapId any
update any

Returns

Promise<any>

Defined in

services/swap.js:511


validateReturnItems_

validateReturnItems_(order, returnItems): ReturnItems[]

Parameters

Name Type Description
order OrderLike
returnItems ReturnItem[]

Returns

ReturnItems[]

Defined in

services/swap.js:269


withTransaction

withTransaction(transactionManager): SwapService

Parameters

Name Type
transactionManager any

Returns

SwapService

Defined in

services/swap.js:86