b***@qq.com
b***@qq.com
  • 发布:2022-11-14 10:38
  • 更新:2022-11-14 10:53
  • 阅读:642

ios内购 在沙盒测试中,支付成功后没有回调,重启app,再次点击支付后,控制台输出了上次支付的结果

分类:uni-app
async jumptoPay(id,iosid) {  
                let that = this;  
                let ajax = new this.$api()  
                let result = await ajax.request(this.$url.addOrder,{  
                    recharge_integral_id : this.id  
                })  
                this.maskShow = true  
                console.log(id)  
                console.log(result.data.order_no)  
                this.order_no = result.data.order_no  
                uni.requestPayment({  
                    provider: 'appleiap',  
                    orderInfo: {  
                        productid: iosid,  
                        username: result.data.order_no,  
                        quantity: 1,  

                    },  
                    success: async (e) => {  
                        console.log(e)  
                        let transactionReceipt = e.transactionReceipt  
                        let order_no = e.payment.username  
                        let ajax = new this.$api()  
                        let check = await ajax.request(this.$url.checkIos,{  
                            order_no,  
                            receipt:transactionReceipt  
                        })  
                        if(check.code == 1) {  
                            that.$refs.uToast.show({  
                                title: check.msg,  
                                type: 'success',  
                            })  
                        }  
                        this.maskShow = false  
                        uni.$emit('updateDot')  
                        console.log(check)  

                    },  
                    fail: (e) => {  
                        uni.hideLoading();  
                        uni.showModal({  
                            content: "支付失败,原因为: " + e.errMsg,  
                            showCancel: false  
                        })  
                    }  
                })  

            },

这是支付代码,有人遇到过吗,网上有需要通过苹果审核才有回调的说法

2022-11-14 10:38 负责人:无 分享
已邀请:
DCloud_uni-ad_HDX

DCloud_uni-ad_HDX

沙盒环境:一个测试账号相同产品仅能购买一次,重复测试需要重新添加沙盒测试账号

  • b***@qq.com (作者)

    感谢提醒,我去添加沙盒测试员的时候发现。可以通过点击‘编辑’,然后清除这个账号的购买历史,之后就能一个账号进行反复测试

    2022-11-14 11:52

该问题目前已经被锁定, 无法添加新回复