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
73d1c1eb
Commit
73d1c1eb
authored
Jan 05, 2023
by
许振钊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat_subOrder_221128' into 'master'
Feat sub order 221128 See merge request
!6
parents
4f37e19f
81dbb618
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
package.json
packages/toolkit/package.json
+1
-1
API.ts
packages/toolkit/src/Payment/API.ts
+11
-8
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 @
73d1c1eb
{
{
"name"
:
"@ydl-packages/toolkit"
,
"name"
:
"@ydl-packages/toolkit"
,
"version"
:
"1.0.
4
"
,
"version"
:
"1.0.
6
"
,
"description"
:
""
,
"description"
:
""
,
"main"
:
"./dist/index.umd.js"
,
"main"
:
"./dist/index.umd.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
packages/toolkit/src/Payment/API.ts
View file @
73d1c1eb
let
BASE_URL_JAVA
=
""
;
let
BASE_URL_JAVA
=
""
;
let
BASE_GATEWAY
=
""
;
let
BASE_GATEWAY
=
""
;
const
isDev
=
typeof
window
!==
'undefined'
?
window
.
location
.
hostname
.
indexOf
(
"dev"
)
>
-
1
:
false
;
const
isTest
=
typeof
window
!==
'undefined'
?
window
.
location
.
hostname
.
indexOf
(
"-test"
)
>
-
1
:
false
;
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
&&
window
.
location
.
hostname
.
indexOf
(
"localhost"
)
==
-
1
&&
window
.
location
.
hostname
.
indexOf
(
"127.0.0.1"
)
==
-
1
)
:
false
;
const
isLocal
=
typeof
window
!==
'undefined'
?
window
.
location
.
hostname
.
indexOf
(
"localhost"
)
>
-
1
:
false
;
if
(
isProd
){
if
(
isDev
||
isTest
||
isLocal
){
BASE_URL_JAVA
=
'https://testapi.ydl.com'
;
BASE_GATEWAY
=
'https://testapp2.yidianling.com'
}
else
{
BASE_URL_JAVA
=
'https://api.ydl.com'
;
BASE_URL_JAVA
=
'https://api.ydl.com'
;
BASE_GATEWAY
=
'https://app2.yidianling.com'
BASE_GATEWAY
=
'https://app2.yidianling.com'
}
}
else
if
(
isTest
){
BASE_URL_JAVA
=
'https://api-test.ydl.com'
;
BASE_GATEWAY
=
'https://app2-test.ydl.com'
}
else
{
BASE_URL_JAVA
=
'https://testapi.ydl.com'
;
BASE_GATEWAY
=
'https://testapp2.yidianling.com'
}
/**
/**
* doc: http://47.96.181.183:8806/api/swagger-ui.html#!/finance45v45245controller/doUnityPayUsingPOST
* doc: http://47.96.181.183:8806/api/swagger-ui.html#!/finance45v45245controller/doUnityPayUsingPOST
*/
*/
...
...
packages/toolkit/src/Payment/Defined.ts
View file @
73d1c1eb
...
@@ -74,7 +74,8 @@ export enum PayChannel {
...
@@ -74,7 +74,8 @@ export enum PayChannel {
export
type
ToPayParams
=
{
export
type
ToPayParams
=
{
orderId
:
number
;
orderId
:
number
;
totalAmount
:
number
subOrderIds
?:
string
;
totalAmount
:
number
;
payType
:
PayType
;
payType
:
PayType
;
/**
/**
* 支付宝h5支付失败回调地址
* 支付宝h5支付失败回调地址
...
...
packages/toolkit/src/Payment/Payment.ts
View file @
73d1c1eb
...
@@ -189,7 +189,7 @@ export class Payment {
...
@@ -189,7 +189,7 @@ export class Payment {
}
}
async
toPay
(
params
:
ToPayParams
):
Promise
<
ToPayReturns
>
{
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
let
quitUrl
=
params
.
quitUrl
// validate start >>>
// validate start >>>
switch
(
payType
)
{
switch
(
payType
)
{
...
@@ -258,7 +258,8 @@ export class Payment {
...
@@ -258,7 +258,8 @@ export class Payment {
orderId
,
orderId
,
payType
,
payType
,
payAmount
,
payAmount
,
payBalance
payBalance
,
subOrderIds
}
}
if
(
payChannel
!==
null
)
{
if
(
payChannel
!==
null
)
{
doUnifiedParams
.
payChannel
=
payChannel
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