import { RazorpayPaginationOptions } from 'razorpay/dist/types/api';

declare enum EnvironmentEnum {
    SANDBOX = "sandbox",
    TEST = "test",
    PRODUCTION = "production",
    LIVE = "live"
}

type ProviderTypes$1 = "payu" | "razorpay";

interface IUnifyPaymentGatewayConfigOptions {
    provider: ProviderTypes$1;
    clientId: string;
    clientSecret?: string;
    salt?: string;
    environment?: EnvironmentEnum;
}

declare enum CurrencyEnum {
    INR = "INR"
}

type IOrderCreatePayload = {
    amount: number;
    currency: CurrencyEnum;
    receipt?: string;
    partial_payment?: boolean;
    notes: Record<string, string>;
    name?: string;
    email?: string;
    phone?: string;
    product_info?: string;
    txn_id?: string;
};
type IOrderResponse = {
    id: string;
    entity: string;
    amount: number;
    amount_paid: number;
    amount_due: number;
    currency: CurrencyEnum;
    receipt?: string;
    offer_id?: string;
    status: string;
    attempts: number;
    notes: string;
    created_at: number;
};
type IOrderListResponse = {
    entity: string;
    count: number;
    items: IOrderResponse[];
};
type IOrderQuery = {
    from?: number;
    to?: number;
    count?: number;
    skip?: number;
};
type IOrderPaymentListResponse = {
    entity: string;
    count: number;
    items: IOrderPaymentResponse[];
};
type IOrderPaymentPayUResponse = {
    amount: number;
    name?: string;
    email?: string;
    phone?: string;
    product_info?: string;
    txn_id?: string;
    merchantKey?: string;
    hash?: string;
    service_provider?: string;
};
type IOrderPaymentResponse = {
    id: string;
    entity: string;
    amount: number;
    currency: string;
    status: string;
    order_id: string;
    invoice_id: string;
    international: boolean;
    method: string;
    amount_refunded: number;
    refund_status: string;
    captured: boolean;
    description: string;
    card_id: string;
    bank: string;
    wallet: string;
    vpa: string;
    email: string;
    contact: string;
    notes: Record<string, string>;
    fee: number;
    tax: number;
    error_code: string;
    error_description: string;
    created_at: number;
};

interface IOrder {
    createOrder(order: IOrderCreatePayload): Promise<IOrderResponse | IOrderPaymentPayUResponse>;
    all(options: IOrderQuery): Promise<IOrderListResponse>;
    fetch(orderId: string): Promise<IOrderResponse>;
    fetchPayments(orderId: string): Promise<IOrderPaymentListResponse>;
}

declare class Order implements IOrder {
    private readonly _config;
    private readonly order;
    constructor(config: IUnifyPaymentGatewayConfigOptions);
    createOrder(order: IOrderCreatePayload): Promise<IOrderResponse | IOrderPaymentPayUResponse>;
    all(options: IOrderQuery): Promise<IOrderListResponse>;
    fetch(orderId: string): Promise<IOrderResponse>;
    fetchPayments(orderId: string): Promise<IOrderPaymentListResponse>;
}

interface IPayment {
}

declare class Payment implements IPayment {
    private readonly _config;
    private readonly payment;
    constructor(config: IUnifyPaymentGatewayConfigOptions);
}

type ICustomerCreatePayload = {
    name: string;
    contact?: number;
    email?: string;
    fail_existing?: boolean;
    gstin?: string;
    notes?: Record<string, string>;
};
type ICustomerUpdatePayload = {
    name?: string;
    email?: string;
    contact?: number;
};
type ICustomerResponse = {
    id: string;
    entity: string;
    name: string;
    contact: string;
    email: string;
    gstin: string;
    notes: Record<string, string>;
    created_at: number;
};
type ICustomerListResponse = {
    entity: string;
    count: number;
    items: ICustomerResponse[];
};
type ICustomerBankPayload = {
    ifsc_code: string;
    account_number: string;
    beneficiary_name: string;
    beneficiary_address1?: string;
    beneficiary_address2?: string;
    beneficiary_address3?: string;
    beneficiary_address4?: string;
    beneficiary_email?: string;
    beneficiary_mobile?: string;
    beneficiary_city?: string;
    beneficiary_state?: string;
    beneficiary_country?: string;
    beneficiary_pin?: string;
};
type ICustomerBankResponse = {
    id: string;
    ifsc: string;
    bank_name: string;
    name: string;
    account_number: string;
    status: string;
};

interface ICustomer {
    create(payload: ICustomerCreatePayload): Promise<ICustomerResponse>;
    update(customerId: string, payload: ICustomerUpdatePayload): Promise<ICustomerResponse>;
    all(options: RazorpayPaginationOptions): Promise<ICustomerListResponse>;
    fetchCustomerById(customerId: string): Promise<ICustomerResponse>;
    addBankAccount(customerId: string, payload: ICustomerBankPayload): Promise<ICustomerResponse>;
    deleteBankAccount(customerId: string, accountId: string): Promise<ICustomerBankResponse>;
}

declare class Customer implements ICustomer {
    private readonly _config;
    private readonly customer;
    constructor(config: IUnifyPaymentGatewayConfigOptions);
    create(payload: ICustomerCreatePayload): Promise<ICustomerResponse>;
    update(customerId: string, payload: ICustomerUpdatePayload): Promise<ICustomerResponse>;
    all(options: RazorpayPaginationOptions): Promise<ICustomerListResponse>;
    fetchCustomerById(customerId: string): Promise<ICustomerResponse>;
    addBankAccount(customerId: string, payload: ICustomerBankPayload): Promise<ICustomerResponse>;
    deleteBankAccount(customerId: string, accountId: string): Promise<ICustomerBankResponse>;
}

declare enum ProviderTypes {
    RAZORPAY = "razorpay",
    PAYU = "payu"
}

declare class UnifyPaymentGatewayClient {
    private readonly _config;
    readonly order: Order;
    readonly payment: Payment;
    readonly customer: Customer;
    constructor(config: IUnifyPaymentGatewayConfigOptions);
}

export { CurrencyEnum, EnvironmentEnum, type ICustomer, type ICustomerBankPayload, type ICustomerBankResponse, type ICustomerCreatePayload, type ICustomerListResponse, type ICustomerResponse, type ICustomerUpdatePayload, type IOrder, type IOrderCreatePayload, type IOrderListResponse, type IOrderPaymentListResponse, type IOrderPaymentPayUResponse, type IOrderPaymentResponse, type IOrderQuery, type IOrderResponse, type IPayment, type IUnifyPaymentGatewayConfigOptions, ProviderTypes, UnifyPaymentGatewayClient, UnifyPaymentGatewayClient as default };
