Commit c9ebead9 by G

the screen will now require the full wave response.

parent d105daec
......@@ -113,9 +113,7 @@ const useWave = (
// log.info("Opening browser for payment...");
log.info("Navigating to the qr code screen...");
closeModal();
navigation
?.getParent()
?.navigate("waveQrCodePaymentScreen", { paymentUrl: response.wave_launch_url });
navigation?.getParent()?.navigate("waveQrCodePaymentScreen", { data: response });
// await openBrowserThenCheckStatus(response.wave_launch_url, response.id);
} catch (error) {
......@@ -124,9 +122,26 @@ const useWave = (
}
};
const handlePaymentVerification = async (id: string) => {
log.info("handlePaymentVerification |", id);
try {
showModal(<LoadingModal message="Vérification du statut de la transaction..." />);
const response = await waveTransactionStatusMutation.mutateAsync(id);
closeModal();
} catch (error) {
log.error("handlePaymentVerification |", error);
// closeModal();
// showModal(<ErrorModal message="Le paiment a été echoué." />);
} finally {
// TODO : remove this finally block once a proper implementation workflow is set. currently we close the modal after logging whatever response we get from the request
closeModal();
}
};
return {
waveTransactionInitializerMutation,
waveTransactionHandler,
handlePaymentVerification,
};
};
......
import type { PaymentCode } from "@/utils/requests/Types";
import type { IwaveStarterRespone } from "@/utils/requests/wavePayment";
import type { NativeStackScreenProps } from "@react-navigation/native-stack";
export type IpaymentStackNavigator = {
......@@ -22,7 +23,7 @@ export type ImainStackNavigator = {
appBottomTabsNavigator: undefined;
paymentResultScreen: undefined;
waveQrCodePaymentScreen: {
paymentUrl: string;
data: IwaveStarterRespone;
};
};
......
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