Skip to main content

Class: PaymentProviderService

Helps retrive payment providers

Hierarchy

  • "medusa-interfaces"

    PaymentProviderService

Constructors

constructor

new PaymentProviderService(container)

Parameters

NameType
containerany

Overrides

BaseService.constructor

Defined in

services/payment-provider.js:8

Properties

manager_

manager_: any

Defined in

services/payment-provider.js:14


paymentRepository_

paymentRepository_: any

Defined in

services/payment-provider.js:18


paymentSessionRepository_

paymentSessionRepository_: any

Defined in

services/payment-provider.js:16


refundRepository_

refundRepository_: any

Defined in

services/payment-provider.js:20

Methods

authorizePayment

authorizePayment(paymentSession, context): Promise<any>

Parameters

NameType
paymentSessionany
contextany

Returns

Promise<any>

Defined in

services/payment-provider.js:283


cancelPayment

cancelPayment(paymentObj): Promise<any>

Parameters

NameType
paymentObjany

Returns

Promise<any>

Defined in

services/payment-provider.js:324


capturePayment

capturePayment(paymentObj): Promise<any>

Parameters

NameType
paymentObjany

Returns

Promise<any>

Defined in

services/payment-provider.js:343


createPayment

createPayment(cart): Promise<any>

Parameters

NameType
cartany

Returns

Promise<any>

Defined in

services/payment-provider.js:246


createSession

createSession(providerId, cart): Promise<any>

Creates a payment session with the given provider.

Parameters

NameTypeDescription
providerIdstringthe id of the provider to create payment with
cartCarta cart object used to calculate the amount, etc. from

Returns

Promise<any>

the payment session

Defined in

services/payment-provider.js:121


deleteSession

deleteSession(paymentSession): any

Parameters

NameType
paymentSessionany

Returns

any

Defined in

services/payment-provider.js:202


getStatus

getStatus(payment): Promise<any>

Parameters

NameType
paymentany

Returns

Promise<any>

Defined in

services/payment-provider.js:338


list

list(): Promise<any>

Returns

Promise<any>

Defined in

services/payment-provider.js:47


listPayments

listPayments(selector, config?): any

Parameters

NameTypeDefault value
selectoranyundefined
configObjectundefined
config.orderObjectundefined
config.order.created_atstring"DESC"
config.skipnumber0
config.takenumber50

Returns

any

Defined in

services/payment-provider.js:80


refreshSession

refreshSession(paymentSession, cart): Promise<any>

Refreshes a payment session with the given provider. This means, that we delete the current one and create a new.

Parameters

NameTypeDescription
paymentSessionPaymentSessionthe payment session object to update
cartCarta cart object used to calculate the amount, etc. from

Returns

Promise<any>

the payment session

Defined in

services/payment-provider.js:152


refundPayment

refundPayment(payObjs, amount, reason, note): Promise<any>

Parameters

NameType
payObjsany
amountany
reasonany
noteany

Returns

Promise<any>

Defined in

services/payment-provider.js:358


registerInstalledProviders

registerInstalledProviders(providers): Promise<void>

Parameters

NameType
providersany

Returns

Promise<void>

Defined in

services/payment-provider.js:35


retrievePayment

retrievePayment(id, relations?): Promise<any>

Parameters

NameTypeDefault value
idanyundefined
relationsany[][]

Returns

Promise<any>

Defined in

services/payment-provider.js:54


retrieveProvider

retrieveProvider(providerId): PaymentService

Finds a provider given an id

Parameters

NameTypeDescription
providerIdstringthe id of the provider to get

Returns

PaymentService

the payment provider

Defined in

services/payment-provider.js:228


retrieveRefund

retrieveRefund(id, config?): Promise<any>

Parameters

NameType
idany
configObject

Returns

Promise<any>

Defined in

services/payment-provider.js:422


retrieveSession

retrieveSession(id, relations?): Promise<any>

Parameters

NameTypeDefault value
idanyundefined
relationsany[][]

Returns

Promise<any>

Defined in

services/payment-provider.js:89


updatePayment

updatePayment(paymentId, update): Promise<any>

Parameters

NameType
paymentIdany
updateany

Returns

Promise<any>

Defined in

services/payment-provider.js:266


updateSession

updateSession(paymentSession, cart): Promise<any>

Updates an existing payment session.

Parameters

NameTypeDescription
paymentSessionPaymentSessionthe payment session object to update
cartCartthe cart object to update for

Returns

Promise<any>

the updated payment session

Defined in

services/payment-provider.js:188


updateSessionData

updateSessionData(paySession, update): Promise<any>

Parameters

NameType
paySessionany
updateany

Returns

Promise<any>

Defined in

services/payment-provider.js:308


withTransaction

withTransaction(manager): PaymentProviderService

Parameters

NameType
managerany

Returns

PaymentProviderService

Defined in

services/payment-provider.js:23