Commit 1d72a5ad by G

makePayment -> orangePaymentTransactionHandler

parent 029c5aa9
...@@ -107,7 +107,7 @@ const useOrangeMoney = () => { ...@@ -107,7 +107,7 @@ const useOrangeMoney = () => {
} }
}; };
const makePayment = async (amount: number) => { const orangePaymentTransactionHandler = async (amount: number) => {
try { try {
showModal(<LoadingModal message="Initialization de la transaction." />); showModal(<LoadingModal message="Initialization de la transaction." />);
const { payment_url, order_id } = const { payment_url, order_id } =
...@@ -126,7 +126,7 @@ const useOrangeMoney = () => { ...@@ -126,7 +126,7 @@ const useOrangeMoney = () => {
isWaitingForOmPaymentUrl: orangeTransactionInitializerMutation.isPending, isWaitingForOmPaymentUrl: orangeTransactionInitializerMutation.isPending,
isCheckingForTransactionStatus: transactionsStatusMutation.isPending, isCheckingForTransactionStatus: transactionsStatusMutation.isPending,
transactionsStatusMutation, transactionsStatusMutation,
makePayment, orangePaymentTransactionHandler,
}; };
}; };
......
...@@ -31,7 +31,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI ...@@ -31,7 +31,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI
isWaitingForOmPaymentUrl, isWaitingForOmPaymentUrl,
isCheckingForTransactionStatus, isCheckingForTransactionStatus,
transactionsStatusMutation, transactionsStatusMutation,
makePayment, orangePaymentTransactionHandler,
} = useOrangeMoney(); } = useOrangeMoney();
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
...@@ -58,7 +58,8 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI ...@@ -58,7 +58,8 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI
log.info("OM so we stays on screen !!"); log.info("OM so we stays on screen !!");
// await orangePaymentSequence(); // await orangePaymentSequence();
try { try {
await makePayment(amountToPay); await orangePaymentTransactionHandler(amountToPay);
navigation.getParent()?.navigate("paymentResultScreen");
} catch (error) { } catch (error) {
log.error("handlePaymentButton |", error); log.error("handlePaymentButton |", error);
} }
...@@ -70,7 +71,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI ...@@ -70,7 +71,7 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI
navigation.navigate("numberAndOtpForPaymentScreen"); navigation.navigate("numberAndOtpForPaymentScreen");
break; break;
} }
}, [paymentType, navigation, amountToPay, makePayment]); }, [paymentType, navigation, amountToPay, orangePaymentTransactionHandler]);
return ( return (
<BackgroundDefault> <BackgroundDefault>
......
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