diff --git a/src/hooks/useOrangeMoney.tsx b/src/hooks/useOrangeMoney.tsx index f8dba8a..01f6f3a 100644 --- a/src/hooks/useOrangeMoney.tsx +++ b/src/hooks/useOrangeMoney.tsx @@ -107,7 +107,7 @@ const useOrangeMoney = () => { } }; - const makePayment = async (amount: number) => { + const orangePaymentTransactionHandler = async (amount: number) => { try { showModal(); const { payment_url, order_id } = @@ -126,7 +126,7 @@ const useOrangeMoney = () => { isWaitingForOmPaymentUrl: orangeTransactionInitializerMutation.isPending, isCheckingForTransactionStatus: transactionsStatusMutation.isPending, transactionsStatusMutation, - makePayment, + orangePaymentTransactionHandler, }; }; diff --git a/src/screens/PaymentAmountInputScreen.tsx b/src/screens/PaymentAmountInputScreen.tsx index b144880..4f7dc7b 100644 --- a/src/screens/PaymentAmountInputScreen.tsx +++ b/src/screens/PaymentAmountInputScreen.tsx @@ -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 (