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
2a4a5862
Commit
2a4a5862
authored
May 23, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix biome linting. overrides biome rules for specific utils files.
parent
7dc3387c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
38 deletions
+61
-38
biome.json
biome.json
+18
-1
orangePayment.ts
src/utils/requests/orangePayment.ts
+43
-37
No files found.
biome.json
View file @
2a4a5862
...
@@ -50,11 +50,28 @@
...
@@ -50,11 +50,28 @@
}
}
}
}
},
},
"overrides"
:
[
{
"include"
:
[
"src/utils/*"
],
"linter"
:
{
"rules"
:
{
"style"
:
{
"useFilenamingConvention"
:
{
"level"
:
"error"
,
"options"
:
{
"filenameCases"
:
[
"camelCase"
,
"export"
]
}
}
}
}
}
}
],
"vcs"
:
{
"vcs"
:
{
"enabled"
:
true
,
"enabled"
:
true
,
"clientKind"
:
"git"
"clientKind"
:
"git"
},
},
"files"
:
{
"files"
:
{
"ignore"
:
[
"babel.config.js"
,
"src/utils/*"
]
"ignore"
:
[
"babel.config.js"
]
}
}
}
}
src/utils/requests/orangePayment.ts
View file @
2a4a5862
...
@@ -2,67 +2,74 @@ import { LOG } from "@logger";
...
@@ -2,67 +2,74 @@ import { LOG } from "@logger";
import
axiosRequest
from
"../axios-request"
;
import
axiosRequest
from
"../axios-request"
;
export
interface
IorangePaymentStarter
{
export
interface
IorangePaymentStarter
{
type_paiement
:
number
,
// biome-ignore lint/style/useNamingConvention: <api expect type_paiement>
marchand
:
"1"
,
type_paiement
:
number
;
service
:
"1"
,
marchand
:
"1"
;
montant
:
number
,
service
:
"1"
;
commentaire
:
string
,
montant
:
number
;
numero
:
string
commentaire
:
string
;
numero
:
string
;
}
}
export
interface
IorangeResponse
{
export
interface
IOrangeResponse
{
status
:
number
;
status
:
number
,
message
:
string
;
message
:
string
,
// biome-ignore lint/style/useNamingConvention: <api expect pay_token>
pay_token
:
string
,
pay_token
:
string
;
payment_url
:
string
,
// biome-ignore lint/style/useNamingConvention: <api expect payment_url>
notif_token
:
string
,
payment_url
:
string
;
order_id
:
string
,
// biome-ignore lint/style/useNamingConvention: <api expect notif_token>
notif_token
:
string
;
// biome-ignore lint/style/useNamingConvention: <api expect order_id>
order_id
:
string
;
}
}
type
OrangeStatus
=
"INITIATED"
|
"SUCCESS"
|
"FAILED"
;
type
OrangeStatus
=
"INITIATED"
|
"SUCCESS"
|
"FAILED"
;
export
interface
IorangePaymentStatus
{
export
interface
IorangePaymentStatus
{
status
:
OrangeStatus
,
status
:
OrangeStatus
;
code
:
number
,
code
:
number
;
message
:
{
message
:
{
status
:
OrangeStatus
,
status
:
OrangeStatus
;
order_id
:
string
,
// biome-ignore lint/style/useNamingConvention: <api expect order_id>
txnid
?:
string
order_id
:
string
;
}
txnid
?:
string
;
};
}
}
const
log
=
LOG
.
extend
(
"orangePayment"
);
const
log
=
LOG
.
extend
(
"orangePayment"
);
export
const
getTransactionsData
=
async
(
payload
:
IorangePaymentStarter
)
=>
{
export
const
getTransactionsData
=
async
(
payload
:
IorangePaymentStarter
)
=>
{
log
.
http
(
"getTransactionsData"
,
payload
);
log
.
http
(
"getTransactionsData"
,
payload
);
// const basictoken = base64.encode("admin:admin");
// const basictoken = base64.encode("admin:admin");
const
response
=
await
axiosRequest
<
IO
rangeResponse
>
({
const
response
=
await
axiosRequest
<
Io
rangeResponse
>
({
url
:
"/transactions/"
,
url
:
"/transactions/"
,
method
:
"POST"
,
method
:
"POST"
,
data
:
payload
data
:
payload
,
});
});
log
.
http
(
"getTransactionsData |"
,
JSON
.
stringify
(
response
,
null
,
2
));
log
.
http
(
"getTransactionsData |"
,
JSON
.
stringify
(
response
,
null
,
2
));
return
response
return
response
;
};
};
export
const
getTransactionStatus
=
async
(
orderId
:
string
)
=>
{
log
.
http
(
"getTransactionStatus |"
,
{
orderId
});
export
const
getTransactionStatus
=
async
(
orderId
:
string
)
=>
{
try
{
log
.
http
(
"getTransactionStatus |"
,
{
orderId
});
const
response
=
await
axiosRequest
<
IorangePaymentStatus
>
({
let
response
=
await
axiosRequest
<
IorangePaymentStatus
>
({
url
:
`/api/TransactionCheckStatus/
${
orderId
}
/`
,
url
:
`/api/TransactionCheckStatus/
${
orderId
}
/`
,
method
:
"GET"
,
method
:
"GET"
,
})
});
log
.
http
(
"getTransactionStatus |"
,
JSON
.
stringify
(
response
,
null
,
2
));
log
.
http
(
"getTransactionStatus |"
,
JSON
.
stringify
(
response
,
null
,
2
));
if
(
response
.
status
===
"INITIATED"
)
{
if
(
response
.
status
===
"INITIATED"
)
{
log
.
http
(
"Payment is still in progress, throwing error for mutation to catch"
);
log
.
warn
(
"Payment is still in progress, throwing error for mutation to catch"
);
throw
new
Error
(
"Payment is still in progress"
);
throw
new
Error
(
"Payment is still in progress"
);
}
else
{
}
log
.
http
(
"getTransactionStatus |"
,
JSON
.
stringify
(
response
,
null
,
2
));
log
.
http
(
"getTransactionStatus |"
,
JSON
.
stringify
(
response
,
null
,
2
));
return
response
return
response
;
}
catch
(
error
)
{
log
.
error
(
"getTransactionStatus |"
,
error
);
throw
error
;
}
}
}
};
\ No newline at end of file
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