From a2ef1df3b0157a1d725c000ffd3a098d1ffa7edf Mon Sep 17 00:00:00 2001 From: G Date: Fri, 17 May 2024 09:22:30 +0000 Subject: [PATCH] use new renamed method from useOrangeMoney : getOmPaymentUrl --- src/screens/PaymentAmountInputScreen.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/screens/PaymentAmountInputScreen.tsx b/src/screens/PaymentAmountInputScreen.tsx index d50cceb..4908079 100644 --- a/src/screens/PaymentAmountInputScreen.tsx +++ b/src/screens/PaymentAmountInputScreen.tsx @@ -18,10 +18,13 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI const { paymentType } = route.params; const [amountToPay, setAmountToPay] = useState(0); - const { omPaymentMutation: orangePaymentMutation } = useOrangeMoney(); + const { getOmPaymentUrl, isBrowserOpen, isWaitingForOmPaymentUrl } = useOrangeMoney(); const insets = useSafeAreaInsets(); + console.log("isWaitingForPaymentUrl", isWaitingForOmPaymentUrl); + console.log("isBrowserOpen", isBrowserOpen); + const updateAmountToPay = (amount: string) => { const amountParsed = Number.parseInt(amount); if (!Number.isNaN(amountParsed)) { @@ -36,13 +39,13 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI case "OM": console.log("OM so we stays on screen !!"); console.log("Calling api with amount :: ", amountToPay); - orangePaymentMutation.mutate(amountToPay); + getOmPaymentUrl(amountToPay); break; default: navigation.navigate("numberAndOtpForPaymentScreen"); break; } - }, [amountToPay, orangePaymentMutation, paymentType, navigation]); + }, [amountToPay, getOmPaymentUrl, paymentType, navigation]); return ( @@ -96,7 +99,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI onPress={handlePaymentButton} variant={"full"} textVariants={"primary"} - label="Payer" + label={`${isWaitingForOmPaymentUrl ? "Chargement..." : "Payer"} `} /> -- libgit2 0.27.1