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
a18866c4
Commit
a18866c4
authored
Nov 15, 2023
by
zhengxiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: openId不一致时重新获取openId
parent
dafaa841
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
Defined.ts
packages/toolkit/src/Payment/Defined.ts
+4
-0
Payment.ts
packages/toolkit/src/Payment/Payment.ts
+3
-0
No files found.
packages/toolkit/src/Payment/Defined.ts
View file @
a18866c4
...
...
@@ -117,6 +117,10 @@ export enum PayErrorMessage {
WECHAT_JSSDK_PAY_ERROR
=
'支付失败'
,
WECHAT_H5_PAY_BREAK
=
'微信h5支付中断'
,
ALIPAY_H5_PAY_BREAK
=
'支付宝支付中断'
,
/**
* 微信支付appid和openid不匹配
*/
WECHAT_OPENID_APPID_NOT_MATCH
=
'微信支付appid和openid不匹配'
,
}
export
type
ToPayReturns
=
{
...
...
packages/toolkit/src/Payment/Payment.ts
View file @
a18866c4
...
...
@@ -272,6 +272,9 @@ export class Payment {
doUnifiedParams
.
payChannel
=
payChannel
}
const
res
=
await
requestForJava
.
post
<
DoUnifiedParams
,
DefaultResponse
>
(
UNIT_PAY
,
doUnifiedParams
)
if
(
Utils
.
isWechat
()
&&
res
.
msg
===
PayErrorMessage
.
WECHAT_OPENID_APPID_NOT_MATCH
)
{
window
.
location
.
href
=
`https://m.ydl.com/pay/wx-pay-open-id?toLink=
${
window
.
location
.
href
}
`
;
}
if
(
res
.
code
!==
'200'
)
return
{
errorMessage
:
res
.
msg
as
any
,
success
:
false
,
errorType
:
PayError
.
BACKEND
}
if
(
params
.
payType
===
PayType
.
BALANCE
&&
res
.
data
)
{
return
{
success
:
res
.
data
.
result
,
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