diff --git a/src/features/pay/api.ts b/src/features/pay/api.ts new file mode 100644 index 0000000..fae028a --- /dev/null +++ b/src/features/pay/api.ts @@ -0,0 +1,6 @@ +import { axiosInstance } from "@/axios"; +import type { DjangoPaginated, PaymentType } from "./types"; + +export const getPaymentTypes = () => { + return axiosInstance.get>>("/operateur/"); +}; diff --git a/src/features/pay/types.ts b/src/features/pay/types.ts new file mode 100644 index 0000000..2a01fa1 --- /dev/null +++ b/src/features/pay/types.ts @@ -0,0 +1,36 @@ +export type PaymentTypeCode = "OM" | "FLOOZ" | "MTN" | "WAVE" | "CB"; + +export interface PaymentType { + reference: number; + nom: string; + description: string; + code: PaymentTypeCode; + etat: boolean; + type_operateur: string; +} + +export interface DjangoPaginated { + count: number; + next: string | null; + previous: string | null; + results: T; +} + +export interface Merchant { + marchand_id: string; + nom: string; + code: string; + adresse: string; + url_succes: string; + url_echec: string; + entreprise: number; + user: number; +} + +export interface IuserInformations { + username: string; + email: string; + first_name: string; + last_name: string; + marchand: Merchant; +}