1***@163.com
1***@163.com
  • 发布:2021-11-11 10:54
  • 更新:2023-08-18 17:04
  • 阅读:2179

app内微信支付成功后点击返回商户,前端没有收到回调

分类:uni-app

前端商城项目打包为原生APP-制作应用wgt包集成到ios系统的app中,发起微信支付,支付成功或者失败后都没有进入到前端的回调函数当中

编辑器为3.2.12.20211029版本 ios系统为14.6 微信版本为8.0.16

uni.requestPayment({  
        provider: paymentType,  
        orderInfo: payForm,  
        success: (res) => {  
            console.log('支付成功:' + JSON.stringify(res));  
            uni.showToast({  
                icon: "none",  
                title: "支付成功!",  
            });  
            // this.callback(paymentMethod)  
        },  
        fail: (err) => {  
            console.log('支付失败:' + JSON.stringify(err));  
            // this.exception = err;  
            uni.showModal({  
                content: "支付失败,如果您已支付,请勿反复支付",  
                showCancel: false,  
            });  
        },  
});

奇怪的出现了,当微信版本为8.0.10,ios系统版本为11.4.1的时候微信支付成功或者失败前端都可以收到回调,请教下这是为什么?是ios客户端拦截了吗?

ios打印的报错信息
2021-11-10 18:54:13.823276+0800 DanQue[33483:1727259] [connection] nw_read_request_report [C17] Receive failed with error "Software caused connection abort"
2021-11-10 18:54:13.826598+0800 DanQue[33483:1727259] [connection] nw_read_request_report [C20] Receive failed with error "Software caused connection abort"
2021-11-10 18:54:13.834885+0800 DanQue[33483:1727259] [connection] nw_read_request_report [C5] Receive failed with error "Software caused connection abort"
2021-11-10 18:54:13.875227+0800 DanQue[33483:1727259] [connection] nw_read_request_report [C3] Receive failed with error "Software caused connection abort"
2021-11-10 18:54:13.881349+0800 DanQue[33483:1727259] [connection] nw_read_request_report [C2] Receive failed with error "Software caused connection abort"
2021-11-10 18:54:13.910374+0800 DanQue[33483:1727259] [connection] nw_read_request_report [C6] Receive failed with error "Software caused connection abort"
2021-11-10 18:54:13.978076+0800 DanQue[33483:1727259] Connection 16: received failure notification
2021-11-10 18:54:13.978216+0800 DanQue[33483:1727259] [connection] nw_flow_add_write_request [C16.1.1 39.107.77.185:443 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] cannot accept write requests
2021-11-10 18:54:13.979545+0800 DanQue[33483:1727259] [connection] nw_write_request_report [C16] Send failed with error "Socket is not connected"
2021-11-10 18:54:15.132760+0800 DanQue[33483:1725995] resp -2
2021-11-10 18:54:15.192990+0800 DanQue[33483:1726140] <Weex>[error]WXBridgeContext.m:1310, jsLog: [JS Framework] Failed to execute the callback function:
TypeError: undefined is not an object (evaluating 'a.indexOf') __ERROR
2021-11-10 18:54:15.233273+0800 DanQue[33483:1725995] status = 3
2021-11-10 18:54:15.238447+0800 DanQue[33483:1726140] <Weex>[error]WXExceptionUtils.m:38, Weex exception errCode: -9400 function: func: (null) arg:(null) message: [WX_KEY_EXCEPTION_WXBRIDGE] exception: TypeError: undefined is not an object (evaluating 'a.indexOf')
stack:@app-service.js:14:112267
@weex-main-jsfm.js:2:513778
@weex-main-jsfm.js:2:1418
map@[native code]
2021-11-10 18:54:15.238651+0800 DanQue[33483:1726140] <Weex>[error]WXMonitor.m:289, [WX_KEY_EXCEPTION_WXBRIDGE] exception: TypeError: undefined is not an object (evaluating 'a.indexOf')
stack:@app-service.js:14:112267
@weex-main-jsfm.js:2:513778
@weex-main-jsfm.js:2:1418
map@[native code]

2021-11-11 10:54 负责人:无 分享
已邀请:
小马哥xmg

小马哥xmg

请问解决了吗?我这边也是IOS微信支付调起微信支付后,不管是支付成功还是取消支付都没有任何回调。

  • 1***@163.com (作者)

    没有,我是在返回前端后向后台请求验证了一下是否已支付

    2021-11-19 12:04

3***@qq.com

3***@qq.com - fly

我刚遇到这个问题!最后解决了。
开发背景:Uniapp项目打包成wgt包,集成到原生APP里面,manifest.json中也配置了支付模块&appid等。
问题描述:Android&Ios都可以成功调起微信支付,但是两端的uni.requestpayment的成功或失败回调都一直不触发。
问题原因:原生APP也集成了微信支付模块,并写了onResp回调函数处理导致!如果原生APP和Uniapp项目都写了回调,会直接执行原生APP的回调,忽略Uniapp的。
解决办法: 让原生APP开发人员,注释掉他们写的onResp函数即可。-- 隐患:后续如果原生APP也需要实现原生支付,需要重新设计,不然2者回调有冲突。

要回复问题请先登录注册