diff --git a/src/navigations/PaymentStackNavigation.tsx b/src/navigations/PaymentStackNavigation.tsx index 5bc4ba4..5cea561 100644 --- a/src/navigations/PaymentStackNavigation.tsx +++ b/src/navigations/PaymentStackNavigation.tsx @@ -2,6 +2,7 @@ import { createNativeStackNavigator } from "@react-navigation/native-stack"; import HomePageWithPaymentOptions from "@screens/HomePageWithPaymentOptions"; import NumberAndOtpForPaymentScreen from "@screens/NumberAndOtpForPaymentScreen"; import PaymentAmountInputScreen from "@screens/PaymentAmountInputScreen"; +import PaymentResultScreen from "@screens/PaymentResultScreen"; import type { PaymentStackParamList } from "./Types"; const Stack = createNativeStackNavigator(); @@ -21,6 +22,13 @@ const PaymentStackNavigator = () => { component={NumberAndOtpForPaymentScreen} /> + ); }; diff --git a/src/screens/PaymentAmountInputScreen.tsx b/src/screens/PaymentAmountInputScreen.tsx index f70fe54..3aeb91e 100644 --- a/src/screens/PaymentAmountInputScreen.tsx +++ b/src/screens/PaymentAmountInputScreen.tsx @@ -65,8 +65,13 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI log.info("result of transactions", JSON.stringify(status, null, 2)); if (status === "SUCCESS") { log.info("Transaction was a success, navigating to success page"); + navigation.navigate("paymentResultScreen"); } else if (status === "FAILED") { log.warn("Transaction was a failed, navigating to error page"); + } else if (status === "INITIATED") { + log.warn( + "Transaction status was still 'INITIATED' after timeout, throwing an error", + ); } } catch (error) { log.error("handlePaymentButton |", error);