Comments (20)
0.2.3只是更新了支付宝iOS SDK,你测试使用的是正确的支付参数吗?我这边没有条件,用错误的支付参数测试,确实存在这问题
from react-native-alipay.
参数是可以的,我0.2.2上使用一切是正常的,你试试用0.2.3在IOS下跳转支付然后取消看看能否收到正确的取消提示,目前我这边(0.2.3)是收不到用户正确取消的信息,但是0.2.2版本一切正常
from react-native-alipay.
目前是IOS下面取消支付不能正确提示‘支付取消,请返回重新支付!’
这里是支付代码:
`
async pay() {
try {
let {cartInfo, orderType, resParams} = this.props.navigation.state.params
let res = null, payResult = null
this.setState({
requesting: true
})
if(this.state.payType == 0) {
res = await api.aliPay(resParams)
} else if(this.state.payType == 1) {
res = await api.weixinPay(resParams)
}
this.setState({
requesting: false
})
if (res && res.data.status == 1) {
if (orderType == 2) {
this.props.dispatch(ShopActions.cartRemoveShop(id))
}
if(this.state.payType == 0) {
payResult = await Alipay.pay(res.data.data)
if(payResult.resultStatus == 9000) {
this.props.navigation.dispatch({
type: 'ReplaceCurrentScreen',
routeName: "PayResult",
params: {res: 'ok', msg: `${cartInfo.totalPrice} 元`}
})
} else if(payResult.resultStatus == 6001) {
this.props.navigation.navigate('PayResult', {res: 'fail', msg: '支付取消,请返回重新支付!'})
} else {
this.props.navigation.navigate('PayResult', {res: 'fail', msg: '支付失败,请返回重新支付!'})
}
} else if(this.state.payType == 1) {
let payParam = {
partnerId: res.data.data.partnerid, // 商家向财付通申请的商家id
prepayId: res.data.data.prepayid, // 预支付订单
nonceStr: res.data.data.noncestr, // 随机串,防重发
timeStamp: res.data.data.timestamp.toString(), // 时间戳,防重发
package: res.data.data.package, // 商家根据财付通文档填写的数据和签名
sign: res.data.data.sign // 商家根据微信开放平台文档对数据做的签名
}
payResult = await WeChat.pay(payParam)
if(payResult.type == 'PayReq.Resp') {
if(payResult.errCode == 0) {
this.props.navigation.dispatch({
type: 'ReplaceCurrentScreen',
routeName: "PayResult",
params: {res: 'ok', msg: `${cartInfo.totalPrice} 元`}
})
}
}
}
} else {
Alert.alert(
'提示',
res.data.err_msg || '订单提交失败!',
[
{
text: '确定', onPress: () => {
}, style: 'cancel'
}
],
{cancelable: false}
)
}
} catch (e) {
this.setState({
requesting: false
})
if(e.name == 'WechatError') {
if(e.code == -1) {
this.props.navigation.navigate('PayResult', {res: 'fail', msg: '支付失败,请返回重新支付!'})
} else if(e.code == -2) {
this.props.navigation.navigate('PayResult', {res: 'fail', msg: '支付取消,请返回重新支付!'})
}
}
}
}
`
from react-native-alipay.
退回了0.2.2版本。。。
from react-native-alipay.
目前只能回退版本了,等作者更新
from react-native-alipay.
我用支付宝demo试下来的情况是 Alipay iOS SDK v15.5.0 的[AlipaySDK.defaultService payOrder:fromScheme:callback:]
回调没有执行,而v15.4.1是正常的。。。先回退吧,我再确认下如果确实是这问题的话,等官方修复了😅
from react-native-alipay.
🙃哈哈只能这样了
from react-native-alipay.
from react-native-alipay.
@woshizhoujie 还有别的编译错误一起出现吗?试试删除node_modules/react-native/third-party
目录重新编译一下,看下这个:facebook/react-native#14382
from react-native-alipay.
+1
from react-native-alipay.
sdk 升到15.5.3 实测支付回调还是不执行@0x5e
追加:
在 RCTAlipay.m 的 handleOpenURL 方法始终是执行的, 可以在这里调用resolve(),
from react-native-alipay.
已经在develop分支更新了sdk并作了兼容,我电脑近期没有测试环境,几位方便的话帮忙测试一下 @dioxide @django-wong @fuxianwei ,谢谢了
from react-native-alipay.
@0x5e Tested on Android and iOS latest Alipay App (10.1.22), and works fine. But you have to fix this issue first #9
from react-native-alipay.
@0x5e Now that #9 is closed, I think it's time to release the new version.
from react-native-alipay.
@evianzhow Sure, thanks😄
from react-native-alipay.
在最新版的 0.2.4 上,ios网页跳转支付完成之后,还是不会触发回调。
from react-native-alipay.
试了一下0.2.4的Alipay.pay()
返回的Promise不会被Resolve, 我又downgrade到0.2.2了
[email protected]
[email protected]
from react-native-alipay.
试了0.2.4和0.2.2 都不能正确触发回调 代码如下:
async alipayLogin() {
// 快捷登录授权
try {
let response = await Alipay.authWithInfo(this.state.infoStr);
console.info('alipayLogin------>', response);
let { resultStatus, result, memo } = response;
// let { success, result_code, auth_code, user_id } = QueryString.parse(result);
} catch (error) {
console.error(error);
}
}
另外native端iOS openURL也没有触发。有人有遇到类似问题么
from react-native-alipay.
@Icacls 请试一下develop分支看看(0.2.5)
from react-native-alipay.
develop分支(0.2.5)测试OK 👌多谢了!
from react-native-alipay.
Related Issues (20)
- Task :app:transformClassesAndResourcesWithProguardForRelease FAILED HOT 1
- When subject content contains '&' , alipay can't be successfully called.
- Manifest merger failed
- alipaySdk
- 支付宝支付和阿里云推送sdk冲突
- ios build failed HOT 2
- Alipay.setAlipaySandbox failed HOT 5
- Alipay.setAlipaySandbox(true) failed HOT 2
- rn0.61.4 ios 支付完成后不能自动跳转回到APP HOT 5
- iOS手机没有安装支付宝app的情况下,接收不到回调
- Update AlipaySDK to remove UIWebView HOT 5
- Can I delete the comments about uiwebview? IOS store can't submit them HOT 1
- UIWebView替换成WKWebView HOT 1
- ios 没有回调
- ExceptionsManager.js:126 Exception '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]' was thrown while invoking pay on target Alipay with params
- iOS运行报错
- Gradle sync failed: Could not find com.android.tools.build:gradle:4.0.1.
- IOS没回调且不返回App HOT 5
- Failed to resolve: :alipaySdk-15.7.5-20200422171619: Affected Modules: app
- 跟微信冲突了,怎么解决?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-alipay.