Commit a2ef1df3 by G

use new renamed method from useOrangeMoney : getOmPaymentUrl

parent 8e81b972
......@@ -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 (
<BackgroundDefault>
......@@ -96,7 +99,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI
onPress={handlePaymentButton}
variant={"full"}
textVariants={"primary"}
label="Payer"
label={`${isWaitingForOmPaymentUrl ? "Chargement..." : "Payer"} `}
/>
</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