From fbe1d4d29b161fb0c58e36bd9e7b32f08d93b128 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 14 Jul 2020 18:21:37 +0800 Subject: [PATCH] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 385ae62..bb9dd54 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ $ cd ios && pod install > `Alipay.alipay: (payInfo: string) => Promise;` -- ⚠️ 注意支付成功返回结果是一个字符串,[返回内容](https://github.com/uiwjs/react-native-alipay/blob/05b4dc3d87ea309b6b6153690faee508cd23e2bf/index.d.ts#L50-L74) +- ⚠️ 注意支付成功返回结果是一个字符串,[返回内容](https://github.com/uiwjs/react-native-alipay/blob/74140a294e850884ed1851b9d2c2d2c00ee75003/index.d.ts#L50-L74) - ⚠️ 支付宝需要设置 `Scheme` 和 iOS添加原生代码,才能支持支付和[回弹商家APP](#支付宝返回应用-ios-设置)的功能 - ⚠️ 支付宝 `管理中心-支付宝开放平台` 需要签约 [`APP支付`](https://opendocs.alipay.com/open/200/105310#%E6%B7%BB%E5%8A%A0%E5%BA%94%E7%94%A8%E5%8A%9F%E8%83%BD) @@ -70,7 +70,7 @@ alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=xxxxxxxxxxxxx&biz_content=%7B - ⚠️ 后台 SDK 根据所有数据生成 `sign`,建议通过 API 拿到这个数据,拼接数据会报错。 - ⚠️ `out_trade_no` 订单 id 和 `sign` 签名 是唯一的,每次不一样,需要后台生成。 -支付返回结果,支付宝[返回结果参数说明](https://github.com/uiwjs/react-native-alipay/blob/05b4dc3d87ea309b6b6153690faee508cd23e2bf/index.d.ts#L50-L74): +支付返回结果,支付宝[返回结果参数说明](https://github.com/uiwjs/react-native-alipay/blob/74140a294e850884ed1851b9d2c2d2c00ee75003/index.d.ts#L50-L74): ```json { @@ -84,7 +84,7 @@ alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=xxxxxxxxxxxxx&biz_content=%7B > `Alipay.authInfo: (authInfoStr: string) => Promise`; -- ⚠️ 注意授权成功返回结果是一个字符串,[返回内容](https://github.com/uiwjs/react-native-alipay/blob/05b4dc3d87ea309b6b6153690faee508cd23e2bf/index.d.ts#L89-L113) +- ⚠️ 注意授权成功返回结果是一个字符串,[返回内容](https://github.com/uiwjs/react-native-alipay/blob/74140a294e850884ed1851b9d2c2d2c00ee75003/index.d.ts#L89-L113) - ⚠️ 支付宝需要设置 `Scheme` 和 iOS添加原生代码,才能支持验证[回弹商家APP](#支付宝返回应用-ios-设置)的功能 - ⚠️ 支付宝 `管理中心-支付宝开放平台` 需要签约 [`APP支付宝登录`](https://opendocs.alipay.com/open/200/105310#%E6%B7%BB%E5%8A%A0%E5%BA%94%E7%94%A8%E5%8A%9F%E8%83%BD) @@ -105,7 +105,7 @@ async function authInfo() { } ``` -授权返回结果,支付宝[返回结果参数说明](https://github.com/uiwjs/react-native-alipay/blob/05b4dc3d87ea309b6b6153690faee508cd23e2bf/index.d.ts#L89-L113): +授权返回结果,支付宝[返回结果参数说明](https://github.com/uiwjs/react-native-alipay/blob/74140a294e850884ed1851b9d2c2d2c00ee75003/index.d.ts#L89-L113): ```json { @@ -133,20 +133,20 @@ async function getVersion() { - ⚠️ Android 端不需要做任何设置。 - ⚠️ 如果用户从 `支付宝App` 跳转到 `商家APP`,是通过系统功能切换,而不是通过 `支付宝APP` 功能键返回 `商家APP`,回调函数是不起作用的,可通过 [`AppState.addEventListener`](https://github.com/uiwjs/react-native-alipay/blob/5daea87bf0af05d60d0ae9e4c04e1e2d1a6e4273/example/App.js#L8-L24) 监听事件请求后台 API,来优化这一用户体验。 -1. 在代码中设置支付宝 [`URL Schemes`](https://github.com/uiwjs/react-native-alipay/blob/05b4dc3d87ea309b6b6153690faee508cd23e2bf/example/App.js#L7),下面实例 [`uiwjspay`](https://github.com/uiwjs/react-native-alipay/commit/f6d21b6b7ec7236b195c56281f971092f3c9bb08) 是定义的 `scheme`,你也可以定义为 `alipay` + `appid`,`appid` 为支付宝分配给开发者的应用ID,用来表述 `scheme` 唯一性。 +1. 在代码中设置支付宝 [`URL Schemes`](https://github.com/uiwjs/react-native-alipay/blob/74140a294e850884ed1851b9d2c2d2c00ee75003/example/App.js#L7),下面实例 [`uiwjspay`](https://github.com/uiwjs/react-native-alipay/commit/f6d21b6b7ec7236b195c56281f971092f3c9bb08) 是定义的 `scheme`,你也可以定义为 `alipay` + `appid`,`appid` 为支付宝分配给开发者的应用ID,用来表述 `scheme` 唯一性。 ```js Alipay.setAlipayScheme('uiwjspay'); ``` -2. 在请求支付的 [`payInfo`](https://github.com/uiwjs/react-native-alipay/blob/05b4dc3d87ea309b6b6153690faee508cd23e2bf/example/App.js#L11) 中必须包含 [`return_url=uiwjspay://`](https://github.com/uiwjs/react-native-alipay/blob/05b4dc3d87ea309b6b6153690faee508cd23e2bf/example/App.js#L11),`return_url` 的值为定义的 `scheme` => `uiwjspay://`,才会返回[支付宝订单支付状态结果](https://opendocs.alipay.com/open/204/105301#%E8%BF%94%E5%9B%9E%E7%BB%93%E6%9E%9C%E7%A4%BA%E4%BE%8B%EF%BC%88iOS%7CAndroid%EF%BC%89) +2. 在请求支付的 [`payInfo`](https://github.com/uiwjs/react-native-alipay/blob/74140a294e850884ed1851b9d2c2d2c00ee75003/example/App.js#L11) 中必须包含 [`return_url=uiwjspay://`](https://github.com/uiwjs/react-native-alipay/blob/74140a294e850884ed1851b9d2c2d2c00ee75003/example/App.js#L11),`return_url` 的值为定义的 `scheme` => `uiwjspay://`,才会返回[支付宝订单支付状态结果](https://opendocs.alipay.com/open/204/105301#%E8%BF%94%E5%9B%9E%E7%BB%93%E6%9E%9C%E7%A4%BA%E4%BE%8B%EF%BC%88iOS%7CAndroid%EF%BC%89) ```js // payInfo 是后台拼接好的支付参数,这个参数必须包含 `return_url=uiwjspay://` Alipay.alipay(payInfo, (res)=>console.log(res)) ``` -3. 用的 `URL Schemes` 列为白名单,在 [`ios/<应用名称>/Info.plist`](https://github.com/uiwjs/react-native-alipay/blob/05b4dc3d87ea309b6b6153690faee508cd23e2bf/example/ios/example/Info.plist#L23-L41) 中添加 +3. 用的 `URL Schemes` 列为白名单,在 [`ios/<应用名称>/Info.plist`](https://github.com/uiwjs/react-native-alipay/blob/74140a294e850884ed1851b9d2c2d2c00ee75003/example/ios/example/Info.plist#L23-L41) 中添加 ```xml LSApplicationQueriesSchemes @@ -168,7 +168,7 @@ Alipay.alipay(payInfo, (res)=>console.log(res)) ``` -4. 修改 [`ios/<应用名称>/AppDelegate.m`](https://github.com/uiwjs/react-native-alipay/blob/05b4dc3d87ea309b6b6153690faee508cd23e2bf/example/ios/example/AppDelegate.m#L60-L70) 添加下列代码: +4. 修改 [`ios/<应用名称>/AppDelegate.m`](https://github.com/uiwjs/react-native-alipay/blob/74140a294e850884ed1851b9d2c2d2c00ee75003/example/ios/example/AppDelegate.m#L60-L70) 添加下列代码: ```objective-c #import