27 lines
827 B
TypeScript
27 lines
827 B
TypeScript
import axios from '@/config/axios';
|
|
import type { GetPaymentsParams, GetPaymentsResponseType } from '../types/Types';
|
|
|
|
export const getPayments = async (
|
|
params: GetPaymentsParams
|
|
): Promise<GetPaymentsResponseType> => {
|
|
const { data } = await axios.get<GetPaymentsResponseType>('/admin/payments', {
|
|
params,
|
|
});
|
|
return data;
|
|
};
|
|
|
|
export const confirmCashPayment = async (paymentId: string) => {
|
|
const { data } = await axios.post(`/admin/payments/${paymentId}/cash/verify`);
|
|
return data;
|
|
};
|
|
|
|
export const denyCashPayment = async (paymentId: string) => {
|
|
const { data } = await axios.delete(`/admin/payments/${paymentId}/cash/deny`);
|
|
return data;
|
|
};
|
|
|
|
export const verifyOnlinePayment = async (token: string) => {
|
|
const { data } = await axios.post(`/admin/payments/online/${token}/verify`);
|
|
return data;
|
|
};
|