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
c0907acc
Commit
c0907acc
authored
Mar 15, 2025
by
zhengxiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增兼容paypal支付方式
parent
dc05037d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
Defined.ts
packages/toolkit/src/Payment/Defined.ts
+10
-5
Payment.ts
packages/toolkit/src/Payment/Payment.ts
+8
-0
No files found.
packages/toolkit/src/Payment/Defined.ts
View file @
c0907acc
...
...
@@ -54,8 +54,11 @@ export enum PayType {
/**
* 花呗分期 + 余额支付
*/
HUABEI_STAGE_BALANCE
=
13
HUABEI_STAGE_BALANCE
=
13
,
/**
* 贝宝支付
*/
PAYPAY
=
26
}
/**
...
...
@@ -70,7 +73,8 @@ export enum PayChannel {
ALI_APP
=
'ALI_APP'
,
ALI_PC
=
'ALI_PC'
,
ALI_QR
=
'ALI_QR'
,
ALI_PCREDIT
=
'ALI_PCREDIT'
ALI_PCREDIT
=
'ALI_PCREDIT'
,
PAYPAY
=
'PAYPAY'
}
export
type
ToPayParams
=
{
...
...
@@ -126,9 +130,10 @@ export enum PayErrorMessage {
export
type
ToPayReturns
=
{
errorMessage
?:
PayErrorMessage
errorType
:
PayError
success
:
boolean
errorType
?
:
PayError
success
?
:
boolean
payUrl
?:
string
payPalOrderId
?:
string
}
...
...
packages/toolkit/src/Payment/Payment.ts
View file @
c0907acc
...
...
@@ -307,12 +307,20 @@ export class Payment {
errorType
:
PayError
.
ALIPAY_H5_BREAK
,
errorMessage
:
PayErrorMessage
.
ALIPAY_H5_PAY_BREAK
}
}
else
if
(
payChannel
===
PayChannel
.
PAYPAY
)
{
return
{
payPalOrderId
:
res
.
data
.
content
.
payPalOrderId
,
errorMessage
:
res
.
msg
as
any
}
}
return
{
success
:
false
,
errorType
:
PayError
.
UNKNOWN
}
}
private
getPayChannel
(
payType
:
PayType
):
PayChannel
|
null
{
switch
(
payType
)
{
case
PayType
.
PAYPAY
:
return
PayChannel
.
PAYPAY
case
PayType
.
WECHAT_BALANCE
:
case
PayType
.
WECHAT
:
return
Utils
.
isWechat
()
?
PayChannel
.
WX_JSAPI
:
PayChannel
.
WX_MWEB
...
...
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