invoice payments
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user