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
34531f52
Commit
34531f52
authored
Sep 06, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more logs and add a custom error name for unknown case
parent
a821cee3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
orangePayment.ts
src/utils/requests/orangePayment.ts
+6
-3
No files found.
src/utils/requests/orangePayment.ts
View file @
34531f52
...
@@ -27,7 +27,7 @@ export interface IorangeResponse {
...
@@ -27,7 +27,7 @@ export interface IorangeResponse {
const
basictoken
=
base64
.
encode
(
"admin:admin"
);
const
basictoken
=
base64
.
encode
(
"admin:admin"
);
type
OrangeStatus
=
"INITIATED"
|
"SUCCESS"
|
"FAILED"
;
export
type
OrangeStatus
=
"INITIATED"
|
"SUCCESS"
|
"FAILED"
;
export
interface
IorangePaymentStatus
{
export
interface
IorangePaymentStatus
{
status
:
OrangeStatus
;
status
:
OrangeStatus
;
code
:
number
;
code
:
number
;
...
@@ -95,12 +95,15 @@ export const getTransactionStatus = async (orderId: string) => {
...
@@ -95,12 +95,15 @@ export const getTransactionStatus = async (orderId: string) => {
default
:
{
default
:
{
log
.
warn
(
"An unknown error occured, throwing error for mutation to catch"
);
log
.
warn
(
"An unknown error occured, throwing error for mutation to catch"
);
const
error
=
new
Error
(
"Payment failed"
);
const
error
=
new
Error
(
"Payment failed"
);
error
.
name
=
"UNKNOWN_PAYMENT_ERROR"
;
error
.
name
=
"
ORANGE_
UNKNOWN_PAYMENT_ERROR"
;
throw
error
;
throw
error
;
}
}
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
log
.
error
(
"getTransactionStatus |"
,
error
);
log
.
error
(
"getTransactionStatus | An unexpected error occured |"
,
JSON
.
stringify
(
error
,
null
,
2
),
);
throw
error
;
throw
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