invoice payments

This commit is contained in:
hamid zarghami
2026-02-24 12:34:04 +03:30
parent 7e17191c1b
commit 0aa70b251e
5 changed files with 172 additions and 3 deletions
+24 -1
View File
@@ -1,5 +1,8 @@
import axios from "@/config/axios";
import type { PayInvoiceParamsType } from "../types/Types";
import type {
GetPaymentInvoiceResponseType,
PayInvoiceParamsType,
} from "../types/Types";
export const payInvoice = async (
invoiceId: string,
@@ -11,3 +14,23 @@ export const payInvoice = async (
);
return data;
};
const DEFAULT_PAGE_SIZE = 10;
export const getPaymentInvoice = async (
invoiceId?: string,
page: number = 1,
limit: number = DEFAULT_PAGE_SIZE,
): Promise<GetPaymentInvoiceResponseType> => {
const { data } = await axios.get<GetPaymentInvoiceResponseType>(
`/public/payments`,
{
params: {
invoiceId,
page,
limit,
},
},
);
return data;
};