Commit cb3b77ed by G

dummy test to assert if its working.

parent 5362842e
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: <API requirements>
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 (
<BackgroundDefault>
{/* <SafeAreaView> */}
......@@ -77,7 +111,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI
/>
</Box>
<Button
onPress={() => navigation.navigate("numberAndOtpForPaymentScreen")}
onPress={handlePaymentButton}
variant={"full"}
textVariants={"primary"}
label="Payer"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment