Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-packages
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
许振钊
ydl-packages
Commits
1433b669
Commit
1433b669
authored
Sep 09, 2022
by
郑炬波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 时间配置
parent
a9728212
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
2 deletions
+22
-2
units.test.ts
packages/toolkit/__tests__/payment/units.test.ts
+6
-0
package.json
packages/toolkit/package.json
+1
-1
API.ts
packages/toolkit/src/Payment/API.ts
+3
-0
Payment.ts
packages/toolkit/src/Payment/Payment.ts
+12
-1
No files found.
packages/toolkit/__tests__/payment/units.test.ts
View file @
1433b669
...
@@ -157,3 +157,8 @@ test('测试微信浏览器支付方式', () => {
...
@@ -157,3 +157,8 @@ test('测试微信浏览器支付方式', () => {
expect
(
methods
.
length
).
toBe
(
1
)
expect
(
methods
.
length
).
toBe
(
1
)
expect
(
methods
[
0
].
value
).
toBe
(
PayType
.
WECHAT
)
expect
(
methods
[
0
].
value
).
toBe
(
PayType
.
WECHAT
)
})
})
test
(
'测试时间接口'
,
async
()
=>
{
const
interval
=
await
Payment
.
PayCheckIntervaL
()
expect
(
interval
).
toBe
(
2000
)
})
\ No newline at end of file
packages/toolkit/package.json
View file @
1433b669
{
{
"name"
:
"@ydl-packages/toolkit"
,
"name"
:
"@ydl-packages/toolkit"
,
"version"
:
"1.0.1-next.2
4
"
,
"version"
:
"1.0.1-next.2
5
"
,
"description"
:
""
,
"description"
:
""
,
"main"
:
"./dist/index.umd.js"
,
"main"
:
"./dist/index.umd.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
packages/toolkit/src/Payment/API.ts
View file @
1433b669
...
@@ -19,3 +19,5 @@ export const COMMIT_ORDER = `${BASE_URL_JAVA}/api/consult/consult/commit-order`
...
@@ -19,3 +19,5 @@ export const COMMIT_ORDER = `${BASE_URL_JAVA}/api/consult/consult/commit-order`
export
const
IS_PAY
=
`
${
BASE_URL_JAVA
}
/api/auth/Order/isPay`
export
const
IS_PAY
=
`
${
BASE_URL_JAVA
}
/api/auth/Order/isPay`
export
const
MY_BALANCE
=
`
${
BASE_GATEWAY
}
/v3/uc/mybalance`
export
const
MY_BALANCE
=
`
${
BASE_GATEWAY
}
/v3/uc/mybalance`
export
const
PAY_CHECK_INTERVAL
=
`
${
BASE_URL_JAVA
}
/api/pay/auth/pay/payCheckInterval`
\ No newline at end of file
packages/toolkit/src/Payment/Payment.ts
View file @
1433b669
import
{
UNIT_PAY
,
IS_PAY
,
MY_BALANCE
}
from
"./API"
;
import
{
UNIT_PAY
,
IS_PAY
,
MY_BALANCE
,
PAY_CHECK_INTERVAL
}
from
"./API"
;
import
md5
from
'blueimp-md5'
import
md5
from
'blueimp-md5'
import
qs
from
'qs'
import
qs
from
'qs'
import
{
Utils
}
from
"@/Utils/Utils"
;
import
{
Utils
}
from
"@/Utils/Utils"
;
...
@@ -364,4 +364,14 @@ export class Payment {
...
@@ -364,4 +364,14 @@ export class Payment {
query
[
BACK_ORDER_ID
]
=
backOrderId
.
toString
()
query
[
BACK_ORDER_ID
]
=
backOrderId
.
toString
()
return
`
${
path
}
?
${
qs
.
stringify
(
query
)}
`
return
`
${
path
}
?
${
qs
.
stringify
(
query
)}
`
}
}
static
async
PayCheckIntervaL
():
Promise
<
number
>
{
const
res
=
await
requestForJava
.
get
<
Record
<
string
,
string
>
,
DefaultResponse
>
(
PAY_CHECK_INTERVAL
)
let
interval
=
3000
;
if
(
res
.
code
===
'200'
){
interval
=
res
.
data
*
1000
;
return
interval
}
return
interval
;
}
}
}
\ 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