paystack-sdk
Version:
Paystack SDK written in Typescript
48 lines (47 loc) • 1.5 kB
TypeScript
import { Axios } from 'axios';
import { CreatePlan, ListPlanQueryParams, PlanResponse, UpdatePlan } from './interface';
interface BadRequest {
status: boolean;
message: string;
data: null;
}
/**
* ## Plans
* The Plans API allows you create and manage installment
* payment options on your integration
* @class Plan
*/
export declare class Plan {
private http;
constructor(http: Axios);
/**
* ### Create Plan
* Create a plan on your integration
* @param {CreatePlan} data Body Param
* @returns {Promise<PlanResponse | BadRequest>}
*/
create(data: CreatePlan): Promise<PlanResponse | BadRequest>;
/**
* ### List Plans
* List plans available on your integration
* @param queryParams Query Parameters
* @returns {Promise<PlanResponse | BadRequest>}
*/
list(queryParams?: ListPlanQueryParams): Promise<PlanResponse | BadRequest>;
/**
* ### Fetch Plan
* Get details of a plan on your integration
* @param id The plan `ID` or `code` you want to fetch
* @returns {Promise<PlanResponse | BadRequest>}
*/
fetch(id: string): Promise<PlanResponse | BadRequest>;
/**
* ### Update Plan
* Update a plan details on your integration
* @param id Plans's `ID` or `code`
* @param {UpdatePlan} data Update Plan Data
* @returns {Promise<PlanResponse | BadRequest>}
*/
update(id: string, data: UpdatePlan): Promise<PlanResponse | BadRequest>;
}
export {};