@hoxhaolsi/cloud-sdk
Version:
LiquidCommerce Cloud SDK
29 lines (28 loc) • 1.44 kB
TypeScript
import type { AuthenticatedService, CheckoutHelperService } from '../core';
import type { ICheckoutCompleteParams, ICheckoutCompleteResponse, ICheckoutPrepareParams, ICheckoutPrepareResponse } from '../interfaces';
import type { IApiResponseWithoutData } from '../types';
/**
* A service for managing the checkout process.
*/
export declare class CheckoutService {
private client;
private checkoutHelperService;
private readonly servicePath;
constructor(client: AuthenticatedService, checkoutHelperService: CheckoutHelperService);
/**
* Prepares a checkout based on the provided parameters.
*
* @param {ICheckoutPrepareParams} params - The parameters for preparing the checkout.
* @returns {Promise<IApiResponseWithoutData<ICheckoutPrepareResponse>>} A promise that resolves to the prepared checkout data.
* @throws {Error} If the checkout preparation request fails.
*/
prepare(params: ICheckoutPrepareParams): Promise<IApiResponseWithoutData<ICheckoutPrepareResponse>>;
/**
* Completes the checkout process.
*
* @param params - The parameters required to complete the checkout.
* @returns A promise that resolves to the API response without data for the completed checkout.
* @throws Throws an error if the checkout complete request fails.
*/
complete(params: ICheckoutCompleteParams): Promise<IApiResponseWithoutData<ICheckoutCompleteResponse>>;
}