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
f24f4f5a
Commit
f24f4f5a
authored
May 28, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
invalide transactionsHistory
parent
8980c856
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
useOrangeMoney.tsx
src/hooks/useOrangeMoney.tsx
+6
-1
No files found.
src/hooks/useOrangeMoney.tsx
View file @
f24f4f5a
...
...
@@ -9,7 +9,7 @@ import InformationModal from "@components/modals/InformationModal";
import
LoadingModal
from
"@components/modals/LoadingModal"
;
import
{
LOG
}
from
"@logger"
;
import
{
useMutation
}
from
"@tanstack/react-query"
;
import
{
useMutation
,
useQueryClient
}
from
"@tanstack/react-query"
;
import
*
as
WebBrowser
from
"expo-web-browser"
;
import
{
useState
}
from
"react"
;
...
...
@@ -25,6 +25,8 @@ const paymentObjectDefault: IorangePaymentStarter = {
commentaire
:
"Un commentaire"
,
};
const
useOrangeMoney
=
()
=>
{
const
queryClient
=
useQueryClient
();
const
[
isBrowserOpen
,
setIsBrowserOpen
]
=
useState
(
false
);
const
{
showModal
,
closeModal
}
=
useModalsManagerContext
();
...
...
@@ -45,6 +47,7 @@ const useOrangeMoney = () => {
onSuccess
:
(
data
)
=>
{
// return data.payment_url
log
.
debug
(
"orangeTransactionInitializerMutation request success, opening browser..."
);
queryClient
.
invalidateQueries
({
queryKey
:
[
"transactionsHistory"
]
});
// await handlePaymentUsingBrowser(data.payment_url);
// await transactionsStatusMutation.mutate(data.order_id);
// setResult(result);
...
...
@@ -61,10 +64,12 @@ const useOrangeMoney = () => {
mutationFn
:
(
orderId
:
string
)
=>
getTransactionStatus
(
orderId
),
onSuccess
:
(
data
)
=>
{
log
.
debug
(
"transactionsStatusMutation request success"
);
queryClient
.
invalidateQueries
({
queryKey
:
[
"transactionsHistory"
]
});
return
data
.
status
;
},
onError
:
(
err
)
=>
{
log
.
error
(
"transactionsStatusMutation |"
,
err
);
queryClient
.
invalidateQueries
({
queryKey
:
[
"transactionsHistory"
]
});
},
// retry: (failureCount, error) => {
// log.warn("transactionsStatusMutation | retrying", failureCount, 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