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"} `} />