UNPKG

bc-payments-sdk

Version:

BetterCommerce's Payments NodeJS SDK is a complete solution for storefront clients that integrate payments. `bc-payments-sdk` is a single point interface for storefront clients for interacting with payment gateways.

38 lines (37 loc) 1.65 kB
import { IPaymentProvider } from "../../base/contracts/IPaymentProvider"; import { BasePaymentProvider } from "../../base/entity/BasePaymentProvider"; /** * Class {OpayoPayment} extends {BasePaymentProvider} and implements {IPaymentProvider}. * It provides the concrete implementation of the Opayo/Sagepay payment provider. * * @class OpayoPayment * @extends BasePaymentProvider * @implements IPaymentProvider * * @remark * This class is responsible for initializing the Opayo SDK and providing the concrete * implementation of the Opayo/Sagepay payment provider methods. */ export declare class OpayoPayment extends BasePaymentProvider implements IPaymentProvider { initPaymentIntent(data: any): void; /** * Requests a payment or payout through the Opayo/Sagepay payment provider. * * This method initializes the SDK and attempts to request a payment or payout * with the provided data. If the SDK initialization is successful, it returns * the result of the transaction request. If the SDK initialization fails, it * returns null. In case of an error during the process, it returns an object * containing the error details. * * _____ * OPAYO * ‾‾‾‾‾ * API Reference - https://developer.elavon.com/products/hosted-payment-page/v1/take-a-payment * * @param data - The payment data required by Opayo/Sagepay. * @returns A promise that resolves to the result of the payment request * or an object with error details if an error occurs. */ requestPayment(data: any): Promise<any>; getOrderDetails(data: any): void; }