Commit 1d72a5ad by G

makePayment -> orangePaymentTransactionHandler

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