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
214f7101
Commit
214f7101
authored
Jan 03, 2023
by
郑炬波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 组合支付
parent
8883e158
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
+7
-5
package.json
packages/toolkit/package.json
+1
-1
API.ts
packages/toolkit/src/Payment/API.ts
+1
-1
Defined.ts
packages/toolkit/src/Payment/Defined.ts
+2
-1
Payment.ts
packages/toolkit/src/Payment/Payment.ts
+3
-2
No files found.
packages/toolkit/package.json
View file @
214f7101
{
"name"
:
"@ydl-packages/toolkit"
,
"version"
:
"1.0.4-next.
1
"
,
"version"
:
"1.0.4-next.
3
"
,
"description"
:
""
,
"main"
:
"./dist/index.umd.js"
,
"scripts"
:
{
...
...
packages/toolkit/src/Payment/API.ts
View file @
214f7101
let
BASE_URL_JAVA
=
""
;
let
BASE_GATEWAY
=
""
;
const
isTest
=
typeof
window
!==
'undefined'
?
window
.
location
.
hostname
.
indexOf
(
"-test"
)
>
-
1
:
false
;
const
isProd
=
typeof
window
!==
'undefined'
?
(
window
.
location
.
hostname
.
indexOf
(
"dev"
)
==
-
1
&&
window
.
location
.
hostname
.
indexOf
(
"test"
)
==
-
1
)
:
false
;
const
isProd
=
typeof
window
!==
'undefined'
?
(
window
.
location
.
hostname
.
indexOf
(
"dev"
)
==
-
1
&&
window
.
location
.
hostname
.
indexOf
(
"test"
)
==
-
1
&&
window
.
location
.
hostname
.
indexOf
(
"localhost"
)
==
-
1
&&
window
.
location
.
hostname
.
indexOf
(
"127.0.0.1"
)
==
-
1
)
:
false
;
if
(
isProd
){
BASE_URL_JAVA
=
'https://api.ydl.com'
;
BASE_GATEWAY
=
'https://app2.yidianling.com'
...
...
packages/toolkit/src/Payment/Defined.ts
View file @
214f7101
...
...
@@ -74,7 +74,8 @@ export enum PayChannel {
export
type
ToPayParams
=
{
orderId
:
number
;
totalAmount
:
number
subOrderIds
?:
string
;
totalAmount
:
number
;
payType
:
PayType
;
/**
* 支付宝h5支付失败回调地址
...
...
packages/toolkit/src/Payment/Payment.ts
View file @
214f7101
...
...
@@ -189,7 +189,7 @@ export class Payment {
}
async
toPay
(
params
:
ToPayParams
):
Promise
<
ToPayReturns
>
{
const
{
totalAmount
,
payType
,
returnUrl
,
orderId
,
redirectUrl
}
=
params
const
{
totalAmount
,
payType
,
returnUrl
,
orderId
,
subOrderIds
,
redirectUrl
}
=
params
let
quitUrl
=
params
.
quitUrl
// validate start >>>
switch
(
payType
)
{
...
...
@@ -258,7 +258,8 @@ export class Payment {
orderId
,
payType
,
payAmount
,
payBalance
payBalance
,
subOrderIds
}
if
(
payChannel
!==
null
)
{
doUnifiedParams
.
payChannel
=
payChannel
...
...
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