Commit 8e81b972 by G

- state for browser openning state

- export mutation handler for request retrieving payment url
parent 3559b180
......@@ -17,15 +17,16 @@ const useOrangeMoney = () => {
const [isBrowserOpen, setIsBrowserOpen] = useState(false);
const handlePaymentUsingBrowser = async (url: string) => {
setIsBrowserOpen(true);
const result = await WebBrowser.openBrowserAsync(url);
// setResult(result);
console.log("result", result);
setIsBrowserOpen(false);
};
const omPaymentMutation = useMutation({
const { isPending, mutate } = useMutation({
mutationFn: (amount: number) =>
getTransactionsData({
// biome-ignore lint/style/useNamingConvention: <explanation>
...paymentObjectDefault,
montant: amount,
}),
......@@ -38,7 +39,7 @@ const useOrangeMoney = () => {
},
});
return { omPaymentMutation, isBrowserOpen };
return { getOmPaymentUrl: mutate, isBrowserOpen, isWaitingForOmPaymentUrl: isPending };
};
export default useOrangeMoney;
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