AbstractPaymentProcessor
Payment processor in charge of creating , managing and processing a payment
Implements
Constructors
constructor
Protected
new AbstractPaymentProcessor(container
, config?
)
Parameters
config
Record<string, unknown>Properties
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
paymentSessionData
Record<string, unknown>Requiredcontext
Record<string, unknown>RequiredReturns
Promise
<PaymentProcessorError
| { data
: Record<string
, unknown
> ; status
: PaymentSessionStatus
}>
Promise
Promise<PaymentProcessorError | { data: Record<string, unknown> ; status: PaymentSessionStatus }>RequiredcancelPayment
Abstract
cancelPayment(paymentSessionData
): Promise
<Record<string
, unknown
> | PaymentProcessorError
>
Cancel an existing session
Parameters
paymentSessionData
Record<string, unknown>RequiredReturns
Promise
<Record<string
, unknown
> | PaymentProcessorError
>
capturePayment
Abstract
capturePayment(paymentSessionData
): Promise
<Record<string
, unknown
> | PaymentProcessorError
>
Capture an existing session
Parameters
paymentSessionData
Record<string, unknown>RequiredReturns
Promise
<Record<string
, unknown
> | PaymentProcessorError
>
deletePayment
Abstract
deletePayment(paymentSessionData
): Promise
<Record<string
, unknown
> | PaymentProcessorError
>
Delete an existing session
Parameters
paymentSessionData
Record<string, unknown>RequiredReturns
Promise
<Record<string
, unknown
> | PaymentProcessorError
>
getIdentifier
getIdentifier(): string
Return a unique identifier to retrieve the payment plugin provider
Returns
string
string
stringgetPaymentStatus
Abstract
getPaymentStatus(paymentSessionData
): Promise
<PaymentSessionStatus
>
Return the status of the session
Parameters
paymentSessionData
Record<string, unknown>RequiredReturns
Promise
<PaymentSessionStatus
>
initiatePayment
Abstract
initiatePayment(context
): Promise
<PaymentProcessorError
| PaymentProcessorSessionResponse
>
Initiate a payment session with the external provider
Parameters
Returns
Promise
<PaymentProcessorError
| PaymentProcessorSessionResponse
>
refundPayment
Abstract
refundPayment(paymentSessionData
, refundAmount
): Promise
<Record<string
, unknown
> | PaymentProcessorError
>
Refund an existing session
Parameters
paymentSessionData
Record<string, unknown>RequiredrefundAmount
numberRequiredReturns
Promise
<Record<string
, unknown
> | PaymentProcessorError
>
retrievePayment
Abstract
retrievePayment(paymentSessionData
): Promise
<Record<string
, unknown
> | PaymentProcessorError
>
Retrieve an existing session
Parameters
paymentSessionData
Record<string, unknown>RequiredReturns
Promise
<Record<string
, unknown
> | PaymentProcessorError
>
updatePayment
Abstract
updatePayment(context
): Promise
<void
| PaymentProcessorError
| PaymentProcessorSessionResponse
>
Update an existing payment session
Parameters
Returns
Promise
<void
| PaymentProcessorError
| PaymentProcessorSessionResponse
>
updatePaymentData
Abstract
updatePaymentData(sessionId
, data
): Promise
<Record<string
, unknown
> | PaymentProcessorError
>
Update the session data for a payment session
Parameters
sessionId
stringRequireddata
Record<string, unknown>RequiredReturns
Promise
<Record<string
, unknown
> | PaymentProcessorError
>