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
162f7736
Commit
162f7736
authored
Aug 19, 2022
by
xuzhenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(custom): replace topay api
-
parent
d08b360d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
API.ts
packages/toolkit/src/Payment/API.ts
+9
-0
Payment.ts
packages/toolkit/src/Payment/Payment.ts
+2
-2
No files found.
packages/toolkit/src/Payment/API.ts
View file @
162f7736
...
...
@@ -3,8 +3,17 @@ const BASE_URL_JAVA = process.env.NODE_ENV === 'production' ? 'https://api.ydl.c
const
BASE_GATEWAY
=
process
.
env
.
NODE_ENV
===
'production'
?
'https://app2.yidianling.com'
:
'https://testapp2.yidianling.com'
/**
* doc: http://47.96.181.183:8806/api/swagger-ui.html#!/finance45v45245controller/doUnityPayUsingPOST
*/
export
const
DO_UNIFIED_ORDER
=
`
${
BASE_URL_JAVA
}
/api/auth/cashierV2/doUnifiedOrder`
/**
* 新版支付,api同doUnifiedOrder
* doc: http://47.96.181.183:8806/api/swagger-ui.html#!/finance45v45245controller/unityPayUsingPOST
*/
export
const
UNIT_PAY
=
`
${
BASE_URL_JAVA
}
/api/auth/cashierV2/unityPay`
export
const
COMMIT_ORDER
=
`
${
BASE_URL_JAVA
}
/api/consult/consult/commit-order`
export
const
IS_PAY
=
`
${
BASE_URL_JAVA
}
/api/auth/Order/isPay`
...
...
packages/toolkit/src/Payment/Payment.ts
View file @
162f7736
import
{
DO_UNIFIED_ORDER
,
IS_PAY
,
MY_BALANCE
}
from
"./API"
;
import
{
UNIT_PAY
,
IS_PAY
,
MY_BALANCE
}
from
"./API"
;
import
md5
from
'blueimp-md5'
import
qs
from
'qs'
import
{
Utils
}
from
"@/Utils/Utils"
;
...
...
@@ -224,7 +224,7 @@ export class Payment {
if
(
payChannel
!==
null
)
{
doUnifiedParams
.
payChannel
=
payChannel
}
const
res
=
await
requestForJava
.
post
<
DoUnifiedParams
,
DefaultResponse
>
(
DO_UNIFIED_ORDER
,
doUnifiedParams
)
const
res
=
await
requestForJava
.
post
<
DoUnifiedParams
,
DefaultResponse
>
(
UNIT_PAY
,
doUnifiedParams
)
if
(
res
.
code
!==
'200'
)
return
{
errorMessage
:
res
.
msg
as
any
,
success
:
false
,
errorType
:
PayError
.
BACKEND
}
if
(
params
.
payType
===
PayType
.
BALANCE
&&
res
.
data
.
balancePayResult
)
{
return
{
success
:
res
.
data
.
balancePayResult
===
'true'
,
errorType
:
PayError
.
BALANCE
}
...
...
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