Skip to content

Commit

Permalink
兼容处理百度 iOS 支付成功返回 string 类型
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzeshuan committed Sep 29, 2019
1 parent 3f6160f commit f26977b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.8.1 (2019-9-29)
- [F] 兼容处理百度 iOS 支付成功返回 string 类型(bug)

## 2.8.0 (2019-9-27)
- [F] web SDK 第三方授权接口 createUser 参数默认为 true
- [A] 百度小程序 SDK 支持百度支付
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minapp-sdk",
"version": "2.8.0",
"version": "2.8.1",
"main": "./lib/index.js",
"browser": "./lib/web.js",
"miniprogram": "lib",
Expand Down Expand Up @@ -35,8 +35,8 @@
},
"homepage": "https://github.com/ifanrx/repository#readme",
"versions": {
"alipay": "2.8.0",
"web": "2.8.0"
"alipay": "2.8.1",
"web": "2.8.1"
},
"devDependencies": {
"@babel/core": "^7.2.2",
Expand Down
6 changes: 6 additions & 0 deletions sdk-file/src/baidu/pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ const createPayFn = BaaS => (params, bannedChannels) => {
orderInfo: data,
bannedChannels: bannedChannels || [],
success: function (res) {
// 百度 iOS 客户端 bug: res 为 string 类型,导致支付成功后,用户无法获取到 transaction_no
if (typeof res === 'string') {
res = {
responseData: res,
}
}
res.transaction_no = data.tpOrderId
return resolve(res)
},
Expand Down

0 comments on commit f26977b

Please sign in to comment.