import { GenericFields, Pageable, Response } from "../../types/generic"; import RestClient from "../../utils/RestClient"; import { Contact } from "../Contact"; export interface FundAccount extends Omit { entity: "fund_account"; contact_id?: Contact["id"]; account_type: "vpa" | "bank_account"; } export interface FundAccountWithContact extends Omit { contact: Omit; contact_id?: never; } export interface FundAccountBankWithContact extends FundAccountWithContact { bank_account: { name: string; ifsc: string; account_number: string; }; } export interface FundAccountVPAWithContact extends FundAccountWithContact { vpa: { address: string; }; } export interface FundAccountBank extends FundAccount { bank_account: { name: string; ifsc: string; account_number: string; }; } export interface FundAccountVPA extends FundAccount { vpa: { address: string; }; } declare class RPXAccount { client: RestClient; constructor(client: RestClient); /** * Creates a fund account for a contact * @link https://razorpay.com/docs/api/x/fund-accounts#create-a-fund-account */ create(accountInfo: Pick & (FundAccountBank | FundAccountVPA)): Promise; /** * Fetches all fund accounts * @link https://razorpay.com/docs/api/x/fund-accounts#fetch-all-fund-accounts */ getAll(filter?: Pageable & Partial>): Promise>; /** * Fetches details of an fund account * @link https://razorpay.com/docs/api/x/fund-accounts#fetch-fund-account-details-by-id */ get(accountId: FundAccount["id"]): Promise; /** * validate the fund account * @link https://razorpay.com/docs/api/x/account-validation#validate-a-bank-account * @link https://razorpay.com/docs/api/x/account-validation#validate-a-vpa */ validate(accountInfo: { account_number: string; fund_account: { id: FundAccount["id"]; }; amount: number; currency: "INR"; notes?: Record; }): Promise; /** * Activates a fund account * @link https://razorpay.com/docs/api/x/fund-accounts#activate-or-deactivate-a-fund-account */ activate(accountId: FundAccount["id"]): Promise; /** * Deactivates a fund account * @link https://razorpay.com/docs/api/x/fund-accounts#activate-or-deactivate-a-fund-account */ deactivate(accountId: FundAccount["id"]): Promise; } export default RPXAccount;