Skip to main content
Skip to main content

AbstractPaymentProcessor

internal.internal.AbstractPaymentProcessor

Payment processor in charge of creating , managing and processing a payment

Implements

Properties

configRecord<string, unknown>
containerMedusaContainerRequired
identifierstringRequired

Methods

authorizePayment

Abstract authorizePayment(paymentSessionData, context): Promise<PaymentProcessorError | { data: Record<string, unknown> ; status: PaymentSessionStatus }>

Authorize an existing session if it is not already authorized

Parameters

paymentSessionDataRecord<string, unknown>Required
contextRecord<string, unknown>Required

Returns

Promise<PaymentProcessorError | { data: Record<string, unknown> ; status: PaymentSessionStatus }>

PromisePromise<PaymentProcessorError | { data: Record<string, unknown> ; status: PaymentSessionStatus }>Required

Implementation of

PaymentProcessor.authorizePayment


cancelPayment

Abstract cancelPayment(paymentSessionData): Promise<Record<string, unknown> | PaymentProcessorError>

Cancel an existing session

Parameters

paymentSessionDataRecord<string, unknown>Required

Returns

Promise<Record<string, unknown> | PaymentProcessorError>

PromisePromise<Record<string, unknown> | PaymentProcessorError>Required

Implementation of

PaymentProcessor.cancelPayment


capturePayment

Abstract capturePayment(paymentSessionData): Promise<Record<string, unknown> | PaymentProcessorError>

Capture an existing session

Parameters

paymentSessionDataRecord<string, unknown>Required

Returns

Promise<Record<string, unknown> | PaymentProcessorError>

PromisePromise<Record<string, unknown> | PaymentProcessorError>Required

Implementation of

PaymentProcessor.capturePayment


deletePayment

Abstract deletePayment(paymentSessionData): Promise<Record<string, unknown> | PaymentProcessorError>

Delete an existing session

Parameters

paymentSessionDataRecord<string, unknown>Required

Returns

Promise<Record<string, unknown> | PaymentProcessorError>

PromisePromise<Record<string, unknown> | PaymentProcessorError>Required

Implementation of

PaymentProcessor.deletePayment


getIdentifier

getIdentifier(): string

Return a unique identifier to retrieve the payment plugin provider

Returns

string

stringstring

Implementation of

PaymentProcessor.getIdentifier


getPaymentStatus

Abstract getPaymentStatus(paymentSessionData): Promise<PaymentSessionStatus>

Return the status of the session

Parameters

paymentSessionDataRecord<string, unknown>Required

Returns

Promise<PaymentSessionStatus>

PromisePromise<PaymentSessionStatus>Required

Implementation of

PaymentProcessor.getPaymentStatus


initiatePayment

Abstract initiatePayment(context): Promise<PaymentProcessorError | PaymentProcessorSessionResponse>

Initiate a payment session with the external provider

Parameters

Returns

Promise<PaymentProcessorError | PaymentProcessorSessionResponse>

Implementation of

PaymentProcessor.initiatePayment


refundPayment

Abstract refundPayment(paymentSessionData, refundAmount): Promise<Record<string, unknown> | PaymentProcessorError>

Refund an existing session

Parameters

paymentSessionDataRecord<string, unknown>Required
refundAmountnumberRequired

Returns

Promise<Record<string, unknown> | PaymentProcessorError>

PromisePromise<Record<string, unknown> | PaymentProcessorError>Required

Implementation of

PaymentProcessor.refundPayment


retrievePayment

Abstract retrievePayment(paymentSessionData): Promise<Record<string, unknown> | PaymentProcessorError>

Retrieve an existing session

Parameters

paymentSessionDataRecord<string, unknown>Required

Returns

Promise<Record<string, unknown> | PaymentProcessorError>

PromisePromise<Record<string, unknown> | PaymentProcessorError>Required

Implementation of

PaymentProcessor.retrievePayment


updatePayment

Abstract updatePayment(context): Promise<void | PaymentProcessorError | PaymentProcessorSessionResponse>

Update an existing payment session

Parameters

Returns

Promise<void | PaymentProcessorError | PaymentProcessorSessionResponse>

Implementation of

PaymentProcessor.updatePayment


updatePaymentData

Abstract updatePaymentData(sessionId, data): Promise<Record<string, unknown> | PaymentProcessorError>

Update the session data for a payment session

Parameters

sessionIdstringRequired
dataRecord<string, unknown>Required

Returns

Promise<Record<string, unknown> | PaymentProcessorError>

PromisePromise<Record<string, unknown> | PaymentProcessorError>Required

Implementation of

PaymentProcessor.updatePaymentData

Was this section helpful?