diff --git a/src/screens/PaymentAmountInputScreen.tsx b/src/screens/PaymentAmountInputScreen.tsx index 2a78405..e958509 100644 --- a/src/screens/PaymentAmountInputScreen.tsx +++ b/src/screens/PaymentAmountInputScreen.tsx @@ -1,4 +1,5 @@ import type { PaymentStackScreenComponentProps } from "@/navigations/Types"; +import { type IorangePaymentStarter, getTransactionsData } from "@/utils/requests/orangePayment"; import BeasyLogoIcon from "@components/BeasyLogoIcon"; import Button from "@components/Button"; import GoBackIconButton from "@components/GoBackIconButton"; @@ -7,6 +8,7 @@ import PaymentOption from "@components/PaymentOption"; import BackgroundDefault from "@components/backgrounds/BackgroundDefault"; import Box from "@components/bases/Box"; import Text from "@components/bases/Text"; +import { useMutation } from "@tanstack/react-query"; import { useState } from "react"; import { useSafeAreaInsets } from "react-native-safe-area-context"; @@ -28,6 +30,38 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI return setAmountToPay(0); }; + const dummyObject: IorangePaymentStarter = { + // biome-ignore lint/style/useNamingConvention: + type_paiement: 1, + marchand: "1", + service: "1", + montant: 10, + commentaire: "commentaire", + numero: "0707070707", + }; + + const omPaymentMutation = useMutation({ + mutationFn: () => getTransactionsData(dummyObject), + onSuccess: (data) => { + console.log("om starter response", data); + }, + onError: (err) => { + console.log("om start error ", err); + }, + }); + + const handlePaymentButton = () => { + switch (paymentType) { + case "OM": + console.log("OM so we stays on screen"); + omPaymentMutation.mutate(); + break; + default: + navigation.navigate("numberAndOtpForPaymentScreen"); + break; + } + }; + return ( {/* */} @@ -77,7 +111,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI />