Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
unidocs-zh
提交
d6a6f4b1
unidocs-zh
项目概览
DCloud
/
unidocs-zh
通知
3598
Star
108
Fork
921
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
120
列表
看板
标记
里程碑
合并请求
109
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
120
Issue
120
列表
看板
标记
里程碑
合并请求
109
合并请求
109
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d6a6f4b1
编写于
9月 22, 2022
作者:
C
chenruilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: update uni-pay
上级
3ca92cb5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
9 deletion
+29
-9
docs/uniCloud/unipay.md
docs/uniCloud/unipay.md
+29
-9
未找到文件。
docs/uniCloud/unipay.md
浏览文件 @
d6a6f4b1
...
@@ -49,14 +49,16 @@ const unipay = require('@dcloudio/unipay')
...
@@ -49,14 +49,16 @@ const unipay = require('@dcloudio/unipay')
**入参说明**
**入参说明**
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|:-------------------:| :-----: |:---:|:----------------:|:----------------------------:|
|:----------------------:| :-----: |:--:|:----------------:|:----------------------------:|
| appId | String | 是 | - | 当前应用在对应支付平台的 appId |
| appId | String | 是 | - | 当前应用在对应支付平台的 appId |
| mchId | String | 是 | - | 商户号 |
| mchId | String | 是 | - | 商户号 |
| v3Key | String | 是 | - | API v3 密钥 |
| v3Key | String | 是 | - | API v3 密钥 |
| appCertPath | String | 是 | - | 商户 API 证书 |
| appCertPath | String | 是 | - | 商户 API 证书文件路径(文件路径与字符串二选一) |
| appPrivateKeyPath | String | 是 | - | 商户 API 私钥 |
| appCertContent | String | 是 | - | 商户 API 证书字符串(文件路径与字符串二选一) |
| timeout | Number | 否 | 5000 | 请求超时时间,单位:毫秒 |
| appPrivateKeyPath | String | 是 | - | 商户 API 私钥文件路径(文件路径与字符串二选一) |
| appPrivateKeyContent | String | 是 | - | 商户 API 私钥字符串(文件路径与字符串二选一) |
| timeout | Number | 否 | 5000 | 请求超时时间,单位:毫秒 |
```
js
```
js
const
unipayIns
=
unipay
.
initWeixinV3
({
const
unipayIns
=
unipay
.
initWeixinV3
({
...
@@ -64,9 +66,27 @@ const unipayIns = unipay.initWeixinV3({
...
@@ -64,9 +66,27 @@ const unipayIns = unipay.initWeixinV3({
mchId
:
'
your mchId
'
,
mchId
:
'
your mchId
'
,
v3Key
:
'
you parterner key
'
,
v3Key
:
'
you parterner key
'
,
appCertPath
:
path
.
resolve
(
'
/path/to/you/cert
'
),
appCertPath
:
path
.
resolve
(
'
/path/to/you/cert
'
),
appPrivateKeyPath
:
path
.
resolve
(
'
/path/to/you/privateKey
'
)
// appCertContent: "",
appPrivateKeyPath
:
path
.
resolve
(
'
/path/to/you/privateKey
'
),
// appPrivateKeyContent: "",
})
})
```
```
**说明**
证书字符串与私钥字符串格式要求:
-
证书字符串不应包含
`-----BEGIN CERTIFICATE-----`
与
`-----END CERTIFICATE-----`
,并且证书内容不能换行
-
私钥字符串不应包含
`-----BEGIN PRIVATE KEY-----`
与
`-----END PRIVATE KEY-----`
,并且私钥内容不能换行
例:
```
// 证书内容
-----BEGIN CERTIFICATE-----
your certificate content...
-----END CERTIFICATE-----
// 证书字符串
appCertContent = 'your certificate content...'
```
### 微信支付v2
### 微信支付v2
**入参说明**
**入参说明**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录