import axios from "../../../config/axios";
import { PaymentStatusType, RejectPaymentType } from "../types/PaymentTypes";

export const getPayments = async (page: number, type: PaymentStatusType) => {
  const { data } = await axios.get(
    `/payments/deposit/transfer?page=${page}&type=${type}`
  );
  return data;
};

export const approveTransfer = async (id: string) => {
  const { data } = await axios.post(`/payments/deposit/transfer/approve/${id}`);
  return data;
};

export const rejectTransfer = async (params: RejectPaymentType) => {
  const { data } = await axios.post(
    `/payments/deposit/transfer/reject/${params.id}`,
    params
  );
  return data;
};

export const getPaymentGateways = async (page: number) => {
  const { data } = await axios.get(`/payments/deposit/gateway?page=${page}`);
  return data;
};
