@payunit/nodejs-sdk
Version:
PayUnit Payment Processor SDK
114 lines • 2.79 kB
TypeScript
export declare enum InvoiceType {
NORMAL = "NORMAL",
INSTALLMENT = "INSTALLMENT"
}
export interface InvoiceItem {
name: string;
amount: number;
quantity: number;
}
export interface Installment {
amount: number;
title: string;
due_date: string;
}
export interface InstallmentResponse {
uuid: string;
ref: string;
amount: number;
title: string;
due_date: string;
status: string;
transaction_id?: string;
}
export interface CustomBillingCompany {
name: string;
logo: string;
email: string;
phone_number: string;
}
export interface NormalInvoiceRequest {
client_name: string;
client_email: string;
client_phone_number: string;
due_date: string;
partial_payment: boolean;
is_custom_company: boolean;
type: 'NORMAL';
currency: string;
callback_url?: string;
custom_billing_company?: CustomBillingCompany;
items: InvoiceItem[];
}
export interface InstallmentInvoiceRequest {
client_name: string;
client_email: string;
client_phone_number: string;
due_date: string;
partial_payment: false;
type: 'INSTALLMENT';
currency: string;
items: InvoiceItem[];
callback_url: string;
is_custom_company: boolean;
custom_billing_company?: CustomBillingCompany;
installments: Installment[];
}
export type InvoiceRequest = NormalInvoiceRequest | InstallmentInvoiceRequest;
export interface InvoicePaymentRequest {
invoice_id: string;
amount: number;
currency: string;
installment_id?: string;
callback_url?: string;
}
export interface InvoicePaymentResponse {
transaction_url: string;
transaction_id: string;
reference_id: string;
}
export interface InvoiceResponse {
ref: string;
amount_paid: number;
remaining_amount: number;
status: 'UNPAID' | 'PAID' | 'PARTIALLY_PAID';
client: {
uuid: string;
created_at: string;
name: string;
email: string;
phone_number: string;
};
total_amount: number;
due_date: string;
sub_total: number;
company: {
uuid: string;
created_at: string;
name: string;
email: string;
phone_number: string;
logo: string;
};
is_custom_company: boolean;
custom_billing_company?: {
name: string;
logo: string;
email: string;
phone_number: string;
};
callback_url: string;
type: 'NORMAL' | 'INSTALLMENT';
partial_payment: boolean;
currency: string;
items: InvoiceItem[];
fees: string;
uuid: string;
created_at: string;
installments?: InstallmentResponse[];
}
export interface InvoiceCreateResponse {
link: string;
invoice: InvoiceResponse;
}
//# sourceMappingURL=invoice.d.ts.map