bc-clearpay-sdk
Version:
BetterCommerce's ClearPay NodeJS SDK enables BC client applications to integrate with ClearPay merchant API system. It publishes an interface to interact with [ClearPay API v2](https://developers.clearpay.co.uk/clearpay-online/reference) endpoints.
39 lines (38 loc) • 1.92 kB
TypeScript
import { IPayment } from "../base/contracts/IPayment";
import { IPaymentIntent } from "../models/IPaymentIntent";
/**
* Class {Payment} implements the IPayment interface and provides a convenient interface for making payment-related API calls.
* @implements IPayment
*/
export declare class Payment implements IPayment {
/**
* Initiates a payment process by creating a checkout session.
* This endpoint is used to start the Clearpay payment process, utilizing
* the provided order information for consumer pre-approval.
*
* API Reference - https://developers.clearpay.co.uk/clearpay-online/reference/create-checkout
*
* @param data - The payment intent data containing order details
* @returns A promise that resolves with the result of the checkout session creation,
* or an error object if the request fails.
*/
initIntent(data: IPaymentIntent): Promise<any>;
/**
* Capture Full Payment. This endpoint performs a payment capture for the full value of the payment plan.
*
* API Reference - https://developers.clearpay.co.uk/clearpay-online/reference/capture-full-payment
*
* @param data - The payment capture data containing the checkout session token
* @returns A promise that resolves with the result of the payment capture, or an error object if the request fails.
*/
requestPayment(data: any): Promise<any>;
/**
* Get Payment By Order ID. This endpoint retrieves an individual payment along with its order details.
*
* API Reference - https://developers.clearpay.co.uk/clearpay-online/reference/get-payment-by-order-id
*
* @param data - The order ID
* @returns A promise that resolves with the result of the get payment by order ID request, or an error object if the request fails.
*/
getDetails(data: any): Promise<any>;
}