PSPDriver | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Interface PSPDriver<PayMetaType>

    Interface to be implemented by a payment driver

    interface PSPDriver<PayMetaType = unknown> {
        checkStatus(paymeta: PayMetaType): Promise<PSPCheckResult>;
        connect(): Promise<PSPSetup | { error: string }>;
        precheckPayment(request: PSPPrecheckRequest): Promise<PSPPrecheckResult>;
        processPush(
            paymeta: PayMetaType,
            req: PSPWebRequest,
        ): Promise<PSPPushResult>;
        processReturn(
            paymeta: PayMetaType,
            req: PSPWebRequest,
        ): Promise<PSPCheckResult>;
        startPayment(request: PSPRequest): Promise<PSPPayResult<PayMetaType>>;
    }

    Type Parameters

    • PayMetaType = unknown

      Data cached after sending a payment request to the API to be able to request the status later (eg a transaction id)

    Index

    Methods

    • Connect with the API, verify the configuration as passed to the constructor

      Returns Promise<PSPSetup | { error: string }>

    • Process the user returning from the payment portal. If not implemented we'll fall back to a checkStatus call.

      Parameters

      • paymeta: PayMetaType

        Data cached after sending a payment request to the API to be able to request the status later (eg a transaction id)

      • req: PSPWebRequest

        Current request landing on the return page

      Returns Promise<PSPCheckResult>