Commit a2ef1df3 by G

use new renamed method from useOrangeMoney : getOmPaymentUrl

parent 8e81b972
...@@ -18,10 +18,13 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI ...@@ -18,10 +18,13 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI
const { paymentType } = route.params; const { paymentType } = route.params;
const [amountToPay, setAmountToPay] = useState(0); const [amountToPay, setAmountToPay] = useState(0);
const { omPaymentMutation: orangePaymentMutation } = useOrangeMoney(); const { getOmPaymentUrl, isBrowserOpen, isWaitingForOmPaymentUrl } = useOrangeMoney();
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
console.log("isWaitingForPaymentUrl", isWaitingForOmPaymentUrl);
console.log("isBrowserOpen", isBrowserOpen);
const updateAmountToPay = (amount: string) => { const updateAmountToPay = (amount: string) => {
const amountParsed = Number.parseInt(amount); const amountParsed = Number.parseInt(amount);
if (!Number.isNaN(amountParsed)) { if (!Number.isNaN(amountParsed)) {
...@@ -36,13 +39,13 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI ...@@ -36,13 +39,13 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI
case "OM": case "OM":
console.log("OM so we stays on screen !!"); console.log("OM so we stays on screen !!");
console.log("Calling api with amount :: ", amountToPay); console.log("Calling api with amount :: ", amountToPay);
orangePaymentMutation.mutate(amountToPay); getOmPaymentUrl(amountToPay);
break; break;
default: default:
navigation.navigate("numberAndOtpForPaymentScreen"); navigation.navigate("numberAndOtpForPaymentScreen");
break; break;
} }
}, [amountToPay, orangePaymentMutation, paymentType, navigation]); }, [amountToPay, getOmPaymentUrl, paymentType, navigation]);
return ( return (
<BackgroundDefault> <BackgroundDefault>
...@@ -96,7 +99,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI ...@@ -96,7 +99,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI
onPress={handlePaymentButton} onPress={handlePaymentButton}
variant={"full"} variant={"full"}
textVariants={"primary"} textVariants={"primary"}
label="Payer" label={`${isWaitingForOmPaymentUrl ? "Chargement..." : "Payer"} `}
/> />
</Box> </Box>
</Box> </Box>
......
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