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
})
}
})
},
这是支付代码,有人遇到过吗,网上有需要通过苹果审核才有回调的说法
b***@qq.com (作者)
感谢提醒,我去添加沙盒测试员的时候发现。可以通过点击‘编辑’,然后清除这个账号的购买历史,之后就能一个账号进行反复测试
2022-11-14 11:52