Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beasy-mobile
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
G
beasy-mobile
Commits
9d4c6ff4
Commit
9d4c6ff4
authored
May 23, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
navigate to payment result screen when transaction is a success
parent
6ce2a3d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
PaymentStackNavigation.tsx
src/navigations/PaymentStackNavigation.tsx
+8
-0
PaymentAmountInputScreen.tsx
src/screens/PaymentAmountInputScreen.tsx
+5
-0
No files found.
src/navigations/PaymentStackNavigation.tsx
View file @
9d4c6ff4
...
...
@@ -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
<
PaymentStackParamList
>
();
...
...
@@ -21,6 +22,13 @@ const PaymentStackNavigator = () => {
component=
{
NumberAndOtpForPaymentScreen
}
/>
<
Stack
.
Screen
name=
"paymentAmountInputScreen"
component=
{
PaymentAmountInputScreen
}
/>
<
Stack
.
Screen
name=
"paymentResultScreen"
component=
{
PaymentResultScreen
}
options=
{
{
headerShown
:
false
,
}
}
/>
</
Stack
.
Navigator
>
);
};
...
...
src/screens/PaymentAmountInputScreen.tsx
View file @
9d4c6ff4
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment