From 1d72a5ad793aedaf7fff4f5c6f8a05a8249b1e7e Mon Sep 17 00:00:00 2001 From: G Date: Tue, 28 May 2024 15:43:55 +0000 Subject: [PATCH] makePayment -> orangePaymentTransactionHandler --- src/hooks/useOrangeMoney.tsx | 4 ++-- src/screens/PaymentAmountInputScreen.tsx | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) 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 ( -- libgit2 0.27.1