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
d32de7b1
Commit
d32de7b1
authored
Aug 22, 2022
by
许振钊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat_add_parms_220822' into 'master'
feat(custom): add pay params appId\&openId See merge request
!1
parents
b951c3f2
a20e4eed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
Defined.ts
packages/toolkit/src/Payment/Defined.ts
+6
-1
Payment.ts
packages/toolkit/src/Payment/Payment.ts
+3
-1
No files found.
packages/toolkit/src/Payment/Defined.ts
View file @
d32de7b1
...
...
@@ -92,7 +92,12 @@ export type ToPayParams = {
* 微信h5支付回调地址
* doc: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/combine/chapter10_1.shtml
*/
redirectUrl
?:
string
redirectUrl
?:
string
;
/**
* 用户在微信公众号或小程序的openId
*/
openId
?:
string
;
appId
?:
string
;
}
export
enum
PayError
{
...
...
packages/toolkit/src/Payment/Payment.ts
View file @
d32de7b1
...
...
@@ -146,7 +146,7 @@ export class Payment {
}
async
toPay
(
params
:
ToPayParams
):
Promise
<
ToPayReturns
>
{
const
{
totalAmount
,
payType
,
returnUrl
,
orderId
,
redirectUrl
}
=
params
const
{
totalAmount
,
payType
,
returnUrl
,
orderId
,
redirectUrl
,
openId
,
appId
,
}
=
params
let
quitUrl
=
params
.
quitUrl
// validate start >>>
switch
(
payType
)
{
...
...
@@ -219,6 +219,8 @@ export class Payment {
quitUrl
,
orderId
,
payType
,
openId
,
appId
,
...
this
.
computeAmount
(
totalAmount
,
this
.
balance
),
}
if
(
payChannel
!==
null
)
{
...
...
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