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
c9ebead9
Commit
c9ebead9
authored
Jun 19, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
the screen will now require the full wave response.
parent
d105daec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
useWave.tsx
src/hooks/useWave.tsx
+18
-3
Types.ts
src/navigations/Types.ts
+2
-1
No files found.
src/hooks/useWave.tsx
View file @
c9ebead9
...
...
@@ -113,9 +113,7 @@ const useWave = (
// log.info("Opening browser for payment...");
log
.
info
(
"Navigating to the qr code screen..."
);
closeModal
();
navigation
?.
getParent
()
?.
navigate
(
"waveQrCodePaymentScreen"
,
{
paymentUrl
:
response
.
wave_launch_url
});
navigation
?.
getParent
()?.
navigate
(
"waveQrCodePaymentScreen"
,
{
data
:
response
});
// await openBrowserThenCheckStatus(response.wave_launch_url, response.id);
}
catch
(
error
)
{
...
...
@@ -124,9 +122,26 @@ const useWave = (
}
};
const
handlePaymentVerification
=
async
(
id
:
string
)
=>
{
log
.
info
(
"handlePaymentVerification |"
,
id
);
try
{
showModal
(<
LoadingModal
message=
"Vérification du statut de la transaction..."
/>);
const
response
=
await
waveTransactionStatusMutation
.
mutateAsync
(
id
);
closeModal
();
}
catch
(
error
)
{
log
.
error
(
"handlePaymentVerification |"
,
error
);
// closeModal();
// showModal(<ErrorModal message="Le paiment a été echoué." />);
}
finally
{
// TODO : remove this finally block once a proper implementation workflow is set. currently we close the modal after logging whatever response we get from the request
closeModal
();
}
};
return
{
waveTransactionInitializerMutation
,
waveTransactionHandler
,
handlePaymentVerification
,
};
};
...
...
src/navigations/Types.ts
View file @
c9ebead9
import
type
{
PaymentCode
}
from
"@/utils/requests/Types"
;
import
type
{
IwaveStarterRespone
}
from
"@/utils/requests/wavePayment"
;
import
type
{
NativeStackScreenProps
}
from
"@react-navigation/native-stack"
;
export
type
IpaymentStackNavigator
=
{
...
...
@@ -22,7 +23,7 @@ export type ImainStackNavigator = {
appBottomTabsNavigator
:
undefined
;
paymentResultScreen
:
undefined
;
waveQrCodePaymentScreen
:
{
paymentUrl
:
string
;
data
:
IwaveStarterRespone
;
};
};
...
...
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