add payment page
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user